diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index a78ab07cf02b68..8f6e387896f82b 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -128,6 +128,12 @@ jobs: timeout-minutes: 10 run: | scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false + - name: Build OTA image files with software version number 5 + timeout-minutes: 10 + run: | + scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0 chip_device_config_device_software_version=5 chip_device_config_device_software_version_string='"5.0"' + src/app/ota_image_tool.py create -v 0xFF01 -p 0x8001 -vn 5 -vs "5.0" -da sha256 out/debug/chip-ota-requestor-app /tmp/ota-test005-image + cp out/debug/chip-ota-requestor-app /tmp/ota-test005-raw-image - name: Build example OTA Requestor timeout-minutes: 10 run: | diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 0f5db5783411e4..1772f5b931333e 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -88,6 +88,7 @@ jobs: timeout-minutes: 30 run: | scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4187C --slc_generate --docker + scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4164A --slc_generate --docker rm -rf ./out/ - name: Build some BRD4187C variants timeout-minutes: 90 diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index 3b39c71b58a836..5f9582c5eced37 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -90,31 +90,31 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm-chip-tool build" - name: Clean out build output - run: rm -rf ./out + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* - name: Build Android arm-tv-casting-app run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm-tv-casting-app build" - name: Clean out build output - run: rm -rf ./out + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* - name: Build Android arm-tv-server run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm-tv-server build" - name: Clean out build output - run: rm -rf ./out + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* - name: Build Android arm64-tv-casting-app run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm64-tv-casting-app build" - name: Clean out build output - run: rm -rf ./out + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* - name: Build Android arm64-tv-server run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm64-tv-server build" - name: Clean out build output - run: rm -rf ./out + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* - name: Build Android arm64-chip-tool run: | ./scripts/run_in_build_env.sh \ @@ -124,7 +124,7 @@ jobs: ./scripts/run_in_build_env.sh \ "ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test" - name: Clean out build output - run: rm -rf ./out + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* # - name: Build Android Studio build (arm64 only) # run: | # ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index cce15a04079562..21837f201ccfec 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -84,6 +84,8 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test" + - name: Clean out build output + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* - name: Build Android arm64-tv-casting-app run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2d641bb21a0e53..75a29d165a3eba 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -140,7 +140,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml \ @@ -155,18 +155,20 @@ jobs: src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/low-power-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml \ @@ -175,11 +177,11 @@ jobs: src/app/zap-templates/zcl/data-model/chip/proxy-valid-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/pwm-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml \ src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/scene.xml \ src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml \ @@ -509,6 +511,7 @@ jobs: run: | scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --script-args "--log-level INFO -t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"' scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_RR_1_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"' + scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_DeviceBasicComposition.py" --script-args "--storage-path admin_storage.json --manual-code 10054912339"' scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_SC_3_6.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"' scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_DA_1_7.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --bool-arg allow_sdk_dac:true"' scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1 --enable-key 000102030405060708090a0b0c0d0e0f" --script "src/python_testing/TC_TestEventTrigger.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --bool-arg allow_sdk_dac:true"' diff --git a/.restyled.yaml b/.restyled.yaml index 75613cbb95619e..a57f9ce75a838a 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -190,6 +190,9 @@ restylers: - name: prettier-yaml image: restyled/restyler-prettier:v1.19.1-2 enabled: true + command: + - prettier + - "--write" include: - "**/*.yml" - "**/*.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 dd8e49f387652d..a28f341209feea 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 @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { @@ -2304,40 +2314,19 @@ server cluster IcdManagement = 70 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; @@ -4355,9 +4344,14 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { readonly attribute nullable single measuredValue = 0; readonly attribute nullable single minMeasuredValue = 1; readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; readonly attribute single uncertainty = 7; readonly attribute MeasurementUnitEnum measurementUnit = 8; readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4402,6 +4396,15 @@ server cluster OzoneConcentrationMeasurement = 1045 { kAverageMeasurement = 0x20; } + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; readonly attribute MeasurementMediumEnum measurementMedium = 9; readonly attribute LevelValueEnum levelValue = 10; readonly attribute command_id generatedCommandList[] = 65528; @@ -4503,6 +4506,16 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { kAverageMeasurement = 0x20; } + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; readonly attribute LevelValueEnum levelValue = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -4668,6 +4681,7 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { readonly attribute single uncertainty = 7; readonly attribute MeasurementUnitEnum measurementUnit = 8; readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4712,6 +4726,15 @@ server cluster RadonConcentrationMeasurement = 1071 { kAverageMeasurement = 0x20; } + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; readonly attribute MeasurementMediumEnum measurementMedium = 9; readonly attribute LevelValueEnum levelValue = 10; readonly attribute command_id generatedCommandList[] = 65528; @@ -6606,25 +6629,39 @@ endpoint 1 { ram attribute measuredValue default = 3; ram attribute minMeasuredValue default = 1; ram attribute maxMeasuredValue default = 150; + ram attribute peakMeasuredValue default = 3; + ram attribute peakMeasuredValueWindow default = 120; + ram attribute averageMeasuredValue default = 3; + ram attribute averageMeasuredValueWindow default = 120; ram attribute uncertainty default = 1; ram attribute measurementUnit default = 1; ram attribute measurementMedium default = 0; + ram attribute levelValue default = 1; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 1; + ram attribute featureMap default = 63; ram attribute clusterRevision default = 1; } server cluster OzoneConcentrationMeasurement { + ram attribute measuredValue default = 10; + ram attribute minMeasuredValue default = 3; + ram attribute maxMeasuredValue default = 300; + ram attribute peakMeasuredValue default = 50; + ram attribute peakMeasuredValueWindow default = 3600; + ram attribute averageMeasuredValue default = 20; + ram attribute averageMeasuredValueWindow default = 3600; + ram attribute uncertainty default = 0; + ram attribute measurementUnit default = 0; ram attribute measurementMedium default = 0; ram attribute levelValue default = 1; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 14; + ram attribute featureMap default = 63; ram attribute clusterRevision default = 1; } @@ -6649,12 +6686,22 @@ endpoint 1 { } server cluster FormaldehydeConcentrationMeasurement { - ram attribute levelValue default = 3; + ram attribute measuredValue default = 10; + ram attribute minMeasuredValue default = 0; + ram attribute maxMeasuredValue default = 200; + ram attribute peakMeasuredValue default = 10; + ram attribute peakMeasuredValueWindow default = 7200; + ram attribute averageMeasuredValue default = 2; + ram attribute averageMeasuredValueWindow default = 7200; + ram attribute uncertainty default = 0; + ram attribute measurementUnit default = 3; + ram attribute measurementMedium default = 0; + ram attribute levelValue default = 2; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 2; + ram attribute featureMap default = 63; ram attribute clusterRevision default = 1; } @@ -6679,7 +6726,7 @@ endpoint 1 { } server cluster Pm10ConcentrationMeasurement { - ram attribute measuredValue; + ram attribute measuredValue default = 7; ram attribute minMeasuredValue default = 2; ram attribute maxMeasuredValue default = 400; ram attribute peakMeasuredValue default = 49; @@ -6709,22 +6756,32 @@ endpoint 1 { ram attribute uncertainty default = 1; ram attribute measurementUnit default = 1; ram attribute measurementMedium default = 0; + ram attribute levelValue default = 1; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 49; + ram attribute featureMap default = 63; ram attribute clusterRevision default = 1; } server cluster RadonConcentrationMeasurement { + ram attribute measuredValue default = 10; + ram attribute minMeasuredValue default = 5; + ram attribute maxMeasuredValue default = 100; + ram attribute peakMeasuredValue default = 36; + ram attribute peakMeasuredValueWindow default = 3600; + ram attribute averageMeasuredValue default = 20; + ram attribute averageMeasuredValueWindow default = 3600; + ram attribute uncertainty default = 0; + ram attribute measurementUnit default = 0; ram attribute measurementMedium default = 0; - ram attribute levelValue default = 4; + ram attribute levelValue default = 3; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 14; + ram attribute featureMap default = 63; ram attribute clusterRevision default = 1; } 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 e9d11230130810..bbdf3a2c461b57 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 @@ -16,6 +16,12 @@ } ], "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json", @@ -23,12 +29,6 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data with some extensions" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" } ], "endpointTypes": [ @@ -21988,11 +21988,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22004,11 +22004,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "120", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22020,11 +22020,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22036,11 +22036,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "120", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22100,11 +22100,11 @@ "mfgCode": null, "side": "server", "type": "LevelValueEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22184,7 +22184,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "63", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22264,11 +22264,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "10", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22280,11 +22280,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22296,11 +22296,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "300", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22312,11 +22312,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "50", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22328,11 +22328,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "3600", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22344,11 +22344,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "20", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22360,11 +22360,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "3600", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22376,7 +22376,7 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -22392,7 +22392,7 @@ "mfgCode": null, "side": "server", "type": "MeasurementUnitEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -22508,7 +22508,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "14", + "defaultValue": "63", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22912,11 +22912,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "10", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22928,11 +22928,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22944,11 +22944,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "200", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22960,11 +22960,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "10", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22976,11 +22976,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "7200", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22992,11 +22992,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -23008,11 +23008,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "7200", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -23024,7 +23024,7 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -23040,11 +23040,11 @@ "mfgCode": null, "side": "server", "type": "MeasurementUnitEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -23056,7 +23056,7 @@ "mfgCode": null, "side": "server", "type": "MeasurementMediumEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -23076,7 +23076,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -23156,7 +23156,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "63", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -23564,7 +23564,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24044,11 +24044,11 @@ "mfgCode": null, "side": "server", "type": "LevelValueEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24128,7 +24128,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "49", + "defaultValue": "63", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24208,11 +24208,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "10", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24224,11 +24224,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "5", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24240,11 +24240,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "100", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24256,11 +24256,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "36", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24272,11 +24272,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "3600", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24288,11 +24288,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "20", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24304,11 +24304,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "3600", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24320,7 +24320,7 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -24336,7 +24336,7 @@ "mfgCode": null, "side": "server", "type": "MeasurementUnitEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -24372,7 +24372,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "4", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24452,7 +24452,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "14", + "defaultValue": "63", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp b/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp index a806a22c2757e2..17fa5d007b8493 100644 --- a/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp @@ -8,30 +8,31 @@ using namespace chip::app::Clusters::ModeSelect; using chip::Protocols::InteractionModel::Status; using ModeOptionStructType = Structs::ModeOptionStruct::Type; -using ModeTagType = Structs::ModeTagStruct::Type; +using SemanticTag = Structs::SemanticTagStruct::Type; template using List = app::DataModel::List; using storage_value_type = const ModeOptionStructType; namespace { -Structs::ModeOptionStruct::Type buildModeOptionStruct(const char * label, uint8_t mode, const List & modeTags) +Structs::ModeOptionStruct::Type buildModeOptionStruct(const char * label, uint8_t mode, + const List & semanticTags) { Structs::ModeOptionStruct::Type option; - option.label = CharSpan::fromCharString(label); - option.mode = mode; - option.modeTags = modeTags; + option.label = CharSpan::fromCharString(label); + option.mode = mode; + option.semanticTags = semanticTags; return option; } } // namespace -ModeTagType modeTagsBlack[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; -ModeTagType modeTagsCappucino[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; -ModeTagType modeTagsEspresso[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; +constexpr SemanticTag semanticTagsBlack[] = { { .value = 0 } }; +constexpr SemanticTag semanticTagsCappucino[] = { { .value = 0 } }; +constexpr SemanticTag semanticTagsEspresso[] = { { .value = 0 } }; // TODO: Configure your options for each endpoint storage_value_type StaticSupportedModesManager::coffeeOptions[] = { - buildModeOptionStruct("Black", 0, List(modeTagsBlack)), - buildModeOptionStruct("Cappuccino", 4, List(modeTagsCappucino)), - buildModeOptionStruct("Espresso", 7, List(modeTagsEspresso)) + buildModeOptionStruct("Black", 0, List(semanticTagsBlack)), + buildModeOptionStruct("Cappuccino", 4, List(semanticTagsCappucino)), + buildModeOptionStruct("Espresso", 7, List(semanticTagsEspresso)) }; const StaticSupportedModesManager::EndpointSpanPair StaticSupportedModesManager::supportedOptionsByEndpoints[EMBER_AF_MODE_SELECT_CLUSTER_SERVER_ENDPOINT_COUNT] = { 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 ac09d5456eb636..38e86b0cb5f2cc 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 @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { @@ -2037,40 +2047,19 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/QrCodeInfo.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/QrCodeInfo.kt index c9b2367ee998ba..8715ac7f071160 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/QrCodeInfo.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/QrCodeInfo.kt @@ -1,7 +1,7 @@ package com.google.chip.chiptool.setuppayloadscanner import android.os.Parcelable -import chip.onboardingpayload.OptionalQRCodeInfo.OptionalQRCodeInfoType +import chip.onboardingpayload.OptionalQRCodeInfoType import kotlinx.parcelize.Parcelize @Parcelize diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 6531edb1e75503..599392b9eb050a 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index a458da9d021e37..4fe62d78026e38 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index ebc9e4e5486f58..e20b2a20749066 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 72da64cff277aa..a1cdce02596163 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index c8bbadd07fab6d..44262827d12e56 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 7280968fb259fc..8857e1811d611f 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index a7d53aaeecd93c..08fcbd0cf16e3a 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 0ad9c02d5cc4c2..eb3add96d7e94f 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 3aab05c6ace501..3ad3bc94e5290f 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 0c50e8602406b8..8fdba87ff344ac 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index dbf22aa9b13b97..abb002c4dbbad2 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 8f11a43bf3ac8e..d541e513c8588d 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 174d400db5ea1c..949a75f397e194 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 7bb540870bd8b6..56dd6a89aade6b 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index caffea35361731..c44972ad3f5a9d 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 1502efbb5aac49..864754f15aa41f 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 9deb03484943b1..33c92330fceb89 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index 391a6975cd2737..eb515a6d1308a3 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 17f82500378cd3..8e5bf49c509652 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index e04574d866f334..0b82d5134ab9c2 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index b0462727f5b4fc..9c544afea2f3d7 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index e4a671aad8c9ad..c5b23ad6e2492a 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chip-tool/commands/clusters/ClusterCommand.h b/examples/chip-tool/commands/clusters/ClusterCommand.h index eb9a7167948bf5..6b68e1b04bfea0 100644 --- a/examples/chip-tool/commands/clusters/ClusterCommand.h +++ b/examples/chip-tool/commands/clusters/ClusterCommand.h @@ -74,7 +74,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub CHIP_ERROR error = status.ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; @@ -83,7 +83,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub if (data != nullptr) { - ReturnOnFailure(RemoteDataModelLogger::LogCommandAsJSON(path, data)); + LogErrorOnFailure(RemoteDataModelLogger::LogCommandAsJSON(path, data)); error = DataModelLogger::LogCommand(path, data); if (CHIP_NO_ERROR != error) @@ -97,7 +97,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub virtual void OnError(const chip::app::CommandSender * client, CHIP_ERROR error) override { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(error)); mError = error; diff --git a/examples/chip-tool/commands/clusters/ReportCommand.h b/examples/chip-tool/commands/clusters/ReportCommand.h index f7e1993e26b70b..e90fb5ddf28f14 100644 --- a/examples/chip-tool/commands/clusters/ReportCommand.h +++ b/examples/chip-tool/commands/clusters/ReportCommand.h @@ -37,7 +37,7 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi CHIP_ERROR error = status.ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; @@ -51,7 +51,7 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi return; } - ReturnOnFailure(RemoteDataModelLogger::LogAttributeAsJSON(path, data)); + LogErrorOnFailure(RemoteDataModelLogger::LogAttributeAsJSON(path, data)); error = DataModelLogger::LogAttribute(path, data); if (CHIP_NO_ERROR != error) @@ -70,7 +70,7 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi CHIP_ERROR error = status->ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(eventHeader, *status)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(eventHeader, *status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; @@ -85,7 +85,7 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi return; } - ReturnOnFailure(RemoteDataModelLogger::LogEventAsJSON(eventHeader, data)); + LogErrorOnFailure(RemoteDataModelLogger::LogEventAsJSON(eventHeader, data)); CHIP_ERROR error = DataModelLogger::LogEvent(eventHeader, data); if (CHIP_NO_ERROR != error) @@ -98,6 +98,8 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi void OnError(CHIP_ERROR error) override { + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(error)); mError = error; } diff --git a/examples/chip-tool/commands/clusters/WriteAttributeCommand.h b/examples/chip-tool/commands/clusters/WriteAttributeCommand.h index c3cea8783dbdd0..46a0b3dc4b37dd 100644 --- a/examples/chip-tool/commands/clusters/WriteAttributeCommand.h +++ b/examples/chip-tool/commands/clusters/WriteAttributeCommand.h @@ -120,7 +120,7 @@ class WriteAttribute : public InteractionModelWriter, public ModelCommand, publi CHIP_ERROR error = status.ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; @@ -129,7 +129,7 @@ class WriteAttribute : public InteractionModelWriter, public ModelCommand, publi void OnError(const chip::app::WriteClient * client, CHIP_ERROR error) override { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(error)); mError = error; diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py index 2b5463412e4f43..f395df13674a7d 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py @@ -376,7 +376,7 @@ def __to_lower_camel_case(self, name): return name[:1].lower() + name[1:] def __format_cluster_name(self, name): - return name.lower().replace(' ', '').replace('/', '').lower() + return name.lower().replace(' ', '').replace('/', '').replace('.', '').lower() def __format_command_name(self, name): if name is None: diff --git a/examples/common/tracing/TraceHandlers.cpp b/examples/common/tracing/TraceHandlers.cpp index ea40e285df3844..373b00cb61982c 100644 --- a/examples/common/tracing/TraceHandlers.cpp +++ b/examples/common/tracing/TraceHandlers.cpp @@ -226,22 +226,6 @@ std::string PayloadHeaderToJson(const PayloadHeader * payloadHeader) return jsonBody; } -std::string PreparedSecureMessageDataToJson(const TracePreparedSecureMessageData * data, const std::string & peerAddressKey) -{ - const System::PacketBuffer * packetBuffer = data->packetBuffer->operator->(); - std::string jsonBody = "{"; - jsonBody += AsFirstJsonKey(peerAddressKey, AsJsonString(data->peerAddress)); - jsonBody += ", "; - jsonBody += AsFirstJsonKey("payload_size", std::to_string(packetBuffer->DataLength())); - jsonBody += ", "; - jsonBody += AsFirstJsonKey("payload_hex", AsJsonHexString(packetBuffer->Start(), packetBuffer->DataLength())); - jsonBody += ", "; - jsonBody += AsFirstJsonKey("buffer_ptr", std::to_string(reinterpret_cast(packetBuffer))); - jsonBody += "}"; - - return jsonBody; -} - void SecureMessageSentHandler(const TraceSecureMessageSentData * eventData) { if (!gTraceOutputs.HasStreamAvailable()) @@ -290,41 +274,9 @@ void SecureMessageReceivedHandler(const TraceSecureMessageReceivedData * eventDa // Note that `eventData->session` is currently ignored. } -void PreparedMessageSentHandler(const TracePreparedSecureMessageData * eventData) -{ - if (!gTraceOutputs.HasStreamAvailable()) - { - return; - } - - gTraceOutputs.StartEvent(std::string{ kTraceMessageEvent } + "." + kTracePreparedMessageSentDataFormat); - gTraceOutputs.AddField("json", PreparedSecureMessageDataToJson(eventData, "destination")); - gTraceOutputs.FinishEvent(); -} - -void PreparedMessageReceivedHandler(const TracePreparedSecureMessageData * eventData) -{ - if (!gTraceOutputs.HasStreamAvailable()) - { - return; - } - - gTraceOutputs.StartEvent(std::string{ kTraceMessageEvent } + "." + kTracePreparedMessageReceivedDataFormat); - gTraceOutputs.AddField("json", PreparedSecureMessageDataToJson(eventData, "source")); - gTraceOutputs.FinishEvent(); -} - void TraceHandler(const char * type, const void * data, size_t size) { - if ((std::string{ type } == kTracePreparedMessageReceivedDataFormat) && (size == sizeof(TracePreparedSecureMessageData))) - { - PreparedMessageReceivedHandler(reinterpret_cast(data)); - } - else if ((std::string{ type } == kTracePreparedMessageSentDataFormat) && (size == sizeof(TracePreparedSecureMessageData))) - { - PreparedMessageSentHandler(reinterpret_cast(data)); - } - else if ((std::string{ type } == kTraceMessageSentDataFormat) && (size == sizeof(TraceSecureMessageSentData))) + if ((std::string{ type } == kTraceMessageSentDataFormat) && (size == sizeof(TraceSecureMessageSentData))) { SecureMessageSentHandler(reinterpret_cast(data)); } 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 18cdf112410294..a243adc44fb2cf 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 @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h index b99c5976588b3b..445758958fd169 100644 --- a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h +++ b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h @@ -422,34 +422,46 @@ class TestCommandBridge : public CHIPCommandBridge, // Used when the minValue is a saved variable, since ConstraintsChecker does // not expect Core Foundation types. - template ::value, int> = 0> + template ::value && std::is_signed::value, int> = 0> bool CheckConstraintMinValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) { return ConstraintsChecker::CheckConstraintMinValue(itemName, current, [expected longLongValue]); } - template ::value, int> = 0> + template ::value && !std::is_signed::value, int> = 0> bool CheckConstraintMinValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) { return ConstraintsChecker::CheckConstraintMinValue(itemName, current, [expected unsignedLongLongValue]); } + template ::value, int> = 0> + bool CheckConstraintMinValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) + { + return ConstraintsChecker::CheckConstraintMinValue(itemName, current, [expected doubleValue]); + } + using ConstraintsChecker::CheckConstraintMaxValue; // Used when the maxValue is a saved variable, since ConstraintsChecker does // not expect Core Foundation types. - template ::value, int> = 0> + template ::value && std::is_signed::value, int> = 0> bool CheckConstraintMaxValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) { return ConstraintsChecker::CheckConstraintMaxValue(itemName, current, [expected longLongValue]); } - template ::value, int> = 0> + template ::value && !std::is_signed::value, int> = 0> bool CheckConstraintMaxValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) { return ConstraintsChecker::CheckConstraintMaxValue(itemName, current, [expected unsignedLongLongValue]); } + template ::value, int> = 0> + bool CheckConstraintMaxValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) + { + return ConstraintsChecker::CheckConstraintMaxValue(itemName, current, [expected doubleValue]); + } + bool CheckConstraintHasValue(const char * _Nonnull itemName, id _Nullable current, bool shouldHaveValue) { if (shouldHaveValue && (current == nil)) { 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 eef00caa037cc2..394f1f21915591 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 @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { 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 d96ec9472c60cc..eaf5d7f4a51eee 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { 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 9cfe2296c4c6e0..618449050a7437 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index e8a2e130590652..533dba220fb674 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 52db5c7fafafb3..3e04d5c0db617f 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 41c986eb8e0584..d234be6ae3cfc3 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/silabs/BUILD.gn b/examples/lighting-app/silabs/BUILD.gn index a9687bb3fe061d..ded0e41c42b70a 100644 --- a/examples/lighting-app/silabs/BUILD.gn +++ b/examples/lighting-app/silabs/BUILD.gn @@ -59,6 +59,7 @@ if (slc_generate) { "${use_wstk_buttons}", "${use_wstk_leds}", "${use_external_flash}", + "${silabs_mcu}", ], "list lines")) } 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 35d143b87c10b5..c872fe09b891f8 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { 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 f57a222dae038f..0855b1e51f8bc2 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/silabs/src/AppTask.cpp b/examples/lighting-app/silabs/src/AppTask.cpp index 43fa014f9aa866..af6bbdf8af38ea 100644 --- a/examples/lighting-app/silabs/src/AppTask.cpp +++ b/examples/lighting-app/silabs/src/AppTask.cpp @@ -40,7 +40,7 @@ #include -#if defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) +#if (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(BRD4325B)) #define LIGHT_LED 1 #else #define LIGHT_LED 0 diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index f65707d1bf81a7..904b86f5dbc8d9 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 1991075fd9bb86..b9a1e853428a3d 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index a701a908691e9f..ec736f3b188f9d 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { 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 23798cde6f2219..cb248c52aac7d5 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 @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** 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/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 60ce28100ca0b7..15deee36e5294c 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 @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { struct DeviceTypeStruct { 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 79eb0c8f93911d..0d342e9d0d83a8 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 @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 43897ccc850a9f..ff894c4b436aac 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { @@ -2646,44 +2656,23 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; - readonly attribute optional nullable enum16 standardNamespace = 1; + readonly attribute nullable enum16 standardNamespace = 1; readonly attribute ModeOptionStruct supportedModes[] = 2; readonly attribute int8u currentMode = 3; attribute optional nullable int8u startUpMode = 4; @@ -2699,60 +2688,25 @@ client cluster ModeSelect = 80 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { - ENUM8 status = 0; - optional CHAR_STRING statusText = 1; - } - - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ + /** On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. */ command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; } /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index a08f06fd56a176..8380ee4e47e109 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { @@ -2605,44 +2615,23 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; - readonly attribute optional nullable enum16 standardNamespace = 1; + readonly attribute nullable enum16 standardNamespace = 1; readonly attribute ModeOptionStruct supportedModes[] = 2; readonly attribute int8u currentMode = 3; attribute optional nullable int8u startUpMode = 4; @@ -2658,60 +2647,25 @@ client cluster ModeSelect = 80 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { - ENUM8 status = 0; - optional CHAR_STRING statusText = 1; - } - - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ + /** On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. */ command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; } /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; diff --git a/examples/placeholder/linux/static-supported-modes-manager.cpp b/examples/placeholder/linux/static-supported-modes-manager.cpp index a806a22c2757e2..17fa5d007b8493 100644 --- a/examples/placeholder/linux/static-supported-modes-manager.cpp +++ b/examples/placeholder/linux/static-supported-modes-manager.cpp @@ -8,30 +8,31 @@ using namespace chip::app::Clusters::ModeSelect; using chip::Protocols::InteractionModel::Status; using ModeOptionStructType = Structs::ModeOptionStruct::Type; -using ModeTagType = Structs::ModeTagStruct::Type; +using SemanticTag = Structs::SemanticTagStruct::Type; template using List = app::DataModel::List; using storage_value_type = const ModeOptionStructType; namespace { -Structs::ModeOptionStruct::Type buildModeOptionStruct(const char * label, uint8_t mode, const List & modeTags) +Structs::ModeOptionStruct::Type buildModeOptionStruct(const char * label, uint8_t mode, + const List & semanticTags) { Structs::ModeOptionStruct::Type option; - option.label = CharSpan::fromCharString(label); - option.mode = mode; - option.modeTags = modeTags; + option.label = CharSpan::fromCharString(label); + option.mode = mode; + option.semanticTags = semanticTags; return option; } } // namespace -ModeTagType modeTagsBlack[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; -ModeTagType modeTagsCappucino[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; -ModeTagType modeTagsEspresso[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; +constexpr SemanticTag semanticTagsBlack[] = { { .value = 0 } }; +constexpr SemanticTag semanticTagsCappucino[] = { { .value = 0 } }; +constexpr SemanticTag semanticTagsEspresso[] = { { .value = 0 } }; // TODO: Configure your options for each endpoint storage_value_type StaticSupportedModesManager::coffeeOptions[] = { - buildModeOptionStruct("Black", 0, List(modeTagsBlack)), - buildModeOptionStruct("Cappuccino", 4, List(modeTagsCappucino)), - buildModeOptionStruct("Espresso", 7, List(modeTagsEspresso)) + buildModeOptionStruct("Black", 0, List(semanticTagsBlack)), + buildModeOptionStruct("Cappuccino", 4, List(semanticTagsCappucino)), + buildModeOptionStruct("Espresso", 7, List(semanticTagsEspresso)) }; const StaticSupportedModesManager::EndpointSpanPair StaticSupportedModesManager::supportedOptionsByEndpoints[EMBER_AF_MODE_SELECT_CLUSTER_SERVER_ENDPOINT_COUNT] = { diff --git a/examples/platform/esp32/mode-support/static-supported-modes-manager.cpp b/examples/platform/esp32/mode-support/static-supported-modes-manager.cpp index c5b744b3616dde..ed85f1068661f8 100644 --- a/examples/platform/esp32/mode-support/static-supported-modes-manager.cpp +++ b/examples/platform/esp32/mode-support/static-supported-modes-manager.cpp @@ -26,7 +26,7 @@ using namespace chip::app::Clusters::ModeSelect; using chip::Protocols::InteractionModel::Status; using ModeOptionStructType = Structs::ModeOptionStruct::Type; -using ModeTagType = Structs::ModeTagStruct::Type; +using SemanticTag = Structs::SemanticTagStruct::Type; template using List = app::DataModel::List; @@ -51,7 +51,7 @@ SupportedModesManager::ModeOptionsProvider StaticSupportedModesManager::getModeO } ModeOptionStructType * modeOptionStructList = nullptr; - ModeTagType * modeTags = nullptr; + SemanticTag * semanticTags = nullptr; char keyBuf[ESP32Config::kMaxConfigKeyNameLength]; uint32_t supportedModeCount = 0; @@ -74,7 +74,7 @@ SupportedModesManager::ModeOptionsProvider StaticSupportedModesManager::getModeO { Structs::ModeOptionStruct::Type option; uint32_t supportedModeMode = 0; - uint32_t modeTagCount = 0; + uint32_t semanticTagCount = 0; size_t outLen = 0; memset(keyBuf, 0, sizeof(char) * ESP32Config::kMaxConfigKeyNameLength); @@ -104,49 +104,50 @@ SupportedModesManager::ModeOptionsProvider StaticSupportedModesManager::getModeO ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); memset(keyBuf, 0, sizeof(char) * ESP32Config::kMaxConfigKeyNameLength); - VerifyOrReturnValue(ESP32Config::KeyAllocator::ModeTagsCount(keyBuf, sizeof(keyBuf), endpointId, index) == CHIP_NO_ERROR, + VerifyOrReturnValue(ESP32Config::KeyAllocator::SemanticTagsCount(keyBuf, sizeof(keyBuf), endpointId, index) == + CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); ESP32Config::Key stCountKey(ESP32Config::kConfigNamespace_ChipFactory, keyBuf); - VerifyOrReturnValue(ESP32Config::ReadConfigValue(stCountKey, modeTagCount) == CHIP_NO_ERROR, + VerifyOrReturnValue(ESP32Config::ReadConfigValue(stCountKey, semanticTagCount) == CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); - modeTags = new ModeTagType[modeTagCount]; - if (modeTags == nullptr) + semanticTags = new SemanticTag[semanticTagCount]; + if (semanticTags == nullptr) { CleanUp(endpointId); return ModeOptionsProvider(nullptr, nullptr); } - for (auto stIndex = 0; stIndex < modeTagCount; stIndex++) + for (auto stIndex = 0; stIndex < semanticTagCount; stIndex++) { - uint32_t modeTagValue = 0; - uint32_t modeTagMfgCode = 0; - ModeTagType tag; + uint32_t semanticTagValue = 0; + uint32_t semanticTagMfgCode = 0; + SemanticTag tag; memset(keyBuf, 0, sizeof(char) * ESP32Config::kMaxConfigKeyNameLength); - VerifyOrReturnValue(ESP32Config::KeyAllocator::ModeTagValue(keyBuf, sizeof(keyBuf), endpointId, index, stIndex) == + VerifyOrReturnValue(ESP32Config::KeyAllocator::SemanticTagValue(keyBuf, sizeof(keyBuf), endpointId, index, stIndex) == CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); ESP32Config::Key stValueKey(ESP32Config::kConfigNamespace_ChipFactory, keyBuf); - VerifyOrReturnValue(ESP32Config::ReadConfigValue(stValueKey, modeTagValue) == CHIP_NO_ERROR, + VerifyOrReturnValue(ESP32Config::ReadConfigValue(stValueKey, semanticTagValue) == CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); memset(keyBuf, 0, sizeof(char) * ESP32Config::kMaxConfigKeyNameLength); - VerifyOrReturnValue(ESP32Config::KeyAllocator::ModeTagMfgCode(keyBuf, sizeof(keyBuf), endpointId, index, stIndex) == + VerifyOrReturnValue(ESP32Config::KeyAllocator::SemanticTagMfgCode(keyBuf, sizeof(keyBuf), endpointId, index, stIndex) == CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); ESP32Config::Key stMfgCodeKey(ESP32Config::kConfigNamespace_ChipFactory, keyBuf); - VerifyOrReturnValue(ESP32Config::ReadConfigValue(stMfgCodeKey, modeTagMfgCode) == CHIP_NO_ERROR, + VerifyOrReturnValue(ESP32Config::ReadConfigValue(stMfgCodeKey, semanticTagMfgCode) == CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); - tag.value = static_cast(modeTagValue); - // tag.mfgCode = static_cast(modeTagMfgCode); - modeTags[stIndex] = tag; + tag.value = static_cast(semanticTagValue); + tag.mfgCode = static_cast(semanticTagMfgCode); + semanticTags[stIndex] = tag; } - option.label = chip::CharSpan::fromCharString(modeLabel); - option.mode = static_cast(supportedModeMode); - option.modeTags = DataModel::List(modeTags, modeTagCount); + option.label = chip::CharSpan::fromCharString(modeLabel); + option.mode = static_cast(supportedModeMode); + option.semanticTags = DataModel::List(semanticTags, semanticTagCount); modeOptionStructList[index] = option; } @@ -193,7 +194,7 @@ void StaticSupportedModesManager::FreeSupportedModes(EndpointId endpointId) cons { auto & modeOption = *it; delete[] modeOption.label.data(); - delete[] modeOption.modeTags.data(); + delete[] modeOption.semanticTags.data(); } delete[] begin; } diff --git a/examples/platform/esp32/mode-support/static-supported-modes-manager.h b/examples/platform/esp32/mode-support/static-supported-modes-manager.h index 9506f158e5d52a..689c9d059f4ab7 100644 --- a/examples/platform/esp32/mode-support/static-supported-modes-manager.h +++ b/examples/platform/esp32/mode-support/static-supported-modes-manager.h @@ -30,7 +30,7 @@ class StaticSupportedModesManager : public chip::app::Clusters::ModeSelect::Supp { private: using ModeOptionStructType = Structs::ModeOptionStruct::Type; - using ModeTag = Structs::ModeTagStruct::Type; + using SemanticTag = Structs::SemanticTagStruct::Type; static ModeOptionsProvider epModeOptionsProviderList[FIXED_ENDPOINT_COUNT]; diff --git a/examples/platform/silabs/matter-platform.slcp b/examples/platform/silabs/matter-platform.slcp index 0eee476075016c..24e7cc54b4bb15 100644 --- a/examples/platform/silabs/matter-platform.slcp +++ b/examples/platform/silabs/matter-platform.slcp @@ -48,11 +48,6 @@ component: - {id: rail_lib_multiprotocol} - {id: bluetooth_feature_system} - {id: bluetooth_feature_scanner} -- instance: [vcom] - id: uartdrv_usart -- instance: [vcom] - id: uartdrv_eusart - config_file: - override: @@ -83,7 +78,7 @@ requires: - condition: [device_series_2] name: uartdrv_eusart - condition: [device_series_2] - name: device_init_dpll + name: device_init_dpll ui_hints: highlight: diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 06e12a5b21d32d..075b8c7cc77237 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { 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 15b6233cc69855..418d7d4b82dd13 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 @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { 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 efe45e7e9a6c70..c1a92de36a1b97 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 @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { 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 1a2aaab3ae031a..df4ac91800248b 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { struct DeviceTypeStruct { diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 304de497411237..11cd0f27954c68 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index c60e578a902dfe..87d84e6abb923f 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { enum OnOffDelayedAllOffEffectVariant : ENUM8 { 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 a2e66c29348bca..92dac22d2f131b 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 @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 409aec2feb4ca6..1b555884166d66 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 69a6cee7f88af0..c026fb36a65a7a 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -23,7 +23,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/concentration-measurement-clu load "../src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml"; @@ -37,19 +37,21 @@ load "../src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/low-power-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/matter-devices.xml"; load "../src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml"; @@ -58,10 +60,10 @@ load "../src/app/zap-templates/zcl/data-model/chip/proxy-discovery-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/proxy-valid-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/pwm-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/scene.xml"; load "../src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml"; diff --git a/scripts/tools/zap/test_generate.py b/scripts/tools/zap/test_generate.py index ff7ea2c20e74c2..d0ada5c22577b4 100755 --- a/scripts/tools/zap/test_generate.py +++ b/scripts/tools/zap/test_generate.py @@ -197,7 +197,9 @@ def process_arguments(): PROGRAM_ARGUMENTS = process_args - unittest.main(argv=unittest_args) + test_results = unittest.main(argv=unittest_args, exit=False) + if test_results.result.failures: + sys.exit(1) if process_args.stamp_file: open(process_args.stamp_file, "wb").close() diff --git a/src/app/tests/suites/TestModeSelectCluster.yaml b/src/app/tests/suites/TestModeSelectCluster.yaml index 17b5a4cb3876a6..3df5462041b374 100644 --- a/src/app/tests/suites/TestModeSelectCluster.yaml +++ b/src/app/tests/suites/TestModeSelectCluster.yaml @@ -33,15 +33,29 @@ tests: response: value: "Coffee" + - label: "Read StandardNamespace" + command: "readAttribute" + attribute: "StandardNamespace" + response: + value: 0 + - label: "Read SupportedModes" command: "readAttribute" attribute: "SupportedModes" response: value: [ - { Label: "Black", Mode: 0, ModeTags: [{ "Value": 0 }] }, - { Label: "Cappuccino", Mode: 4, ModeTags: [{ "Value": 0 }] }, - { Label: "Espresso", Mode: 7, ModeTags: [{ "Value": 0 }] }, + { Label: "Black", Mode: 0, SemanticTags: [{ "Value": 0 }] }, + { + Label: "Cappuccino", + Mode: 4, + SemanticTags: [{ "Value": 0 }], + }, + { + Label: "Espresso", + Mode: 7, + SemanticTags: [{ "Value": 0 }], + }, ] constraints: type: list diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index c361661a9a17cb..67ce7560c7456c 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -8245,3 +8245,1059 @@ PICS: # - label: "Changes air quality significantly" id: AIRQUAL.M.AirQualityChange + + # Carbon Dioxide Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Carbon Dioxide Concentration + Measurement Cluster as a server?" + id: CDOCONC.S + + - label: + "Does the device implement the Carbon Dioxide Concentration + Measurement Cluster as a client?" + id: CDOCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: CDOCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: CDOCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: CDOCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: CDOCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: CDOCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: CDOCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: CDOCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: CDOCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: CDOCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: CDOCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: CDOCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: CDOCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: CDOCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: CDOCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: CDOCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: CDOCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: CDOCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: CDOCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: CDOCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: CDOCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: CDOCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: CDOCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: CDOCONC.S.Afffd + + # Carbon Monoxide Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Carbon Monoxide Concentration + Measurement Cluster as a server?" + id: CMOCONC.S + + - label: + "Does the device implement the Carbon Monoxide Concentration + Measurement Cluster as a client?" + id: CMOCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: CMOCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: CMOCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: CMOCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: CMOCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: CMOCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: CMOCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: CMOCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: CMOCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: CMOCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: CMOCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: CMOCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: CMOCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: CMOCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: CMOCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: CMOCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: CMOCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: CMOCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: CMOCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: CMOCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: CMOCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: CMOCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: CMOCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: CMOCONC.S.Afffd + + # Carbon Monoxide Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Carbon Monoxide Concentration + Measurement Cluster as a server?" + id: CMOCONC.S + + - label: + "Does the device implement the Carbon Monoxide Concentration + Measurement Cluster as a client?" + id: CMOCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: CMOCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: CMOCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: CMOCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: CMOCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: CMOCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: CMOCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: CMOCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: CMOCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: CMOCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: CMOCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: CMOCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: CMOCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: CMOCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: CMOCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: CMOCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: CMOCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: CMOCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: CMOCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: CMOCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: CMOCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: CMOCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: CMOCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: CMOCONC.S.Afffd + + # Nitrogen Dioxide Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Nitrogen Dioxide Concentration + Measurement Cluster as a server?" + id: NDOCONC.S + + - label: + "Does the device implement the Nitrogen Dioxide Concentration + Measurement Cluster as a client?" + id: NDOCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: NDOCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: NDOCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: NDOCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: NDOCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: NDOCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: NDOCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: NDOCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: NDOCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: NDOCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: NDOCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: NDOCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: NDOCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: NDOCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: NDOCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: NDOCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: NDOCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: NDOCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: NDOCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: NDOCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: NDOCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: NDOCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: NDOCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: NDOCONC.S.Afffd + + # Ozone Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Ozone Concentration Measurement Cluster + as a server?" + id: OZCONC.S + + - label: + "Does the device implement the Ozone Concentration Measurement Cluster + as a client?" + id: OZCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: OZCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: OZCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: OZCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: OZCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: OZCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: OZCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: OZCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: OZCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: OZCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: OZCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: OZCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: OZCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: OZCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: OZCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: OZCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: OZCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: OZCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: OZCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: OZCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: OZCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: OZCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: OZCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: OZCONC.S.Afffd + + # PM2.5 Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the PM2.5 Concentration Measurement Cluster + as a server?" + id: PMICONC.S + + - label: + "Does the device implement the PM2.5 Concentration Measurement Cluster + as a client?" + id: PMICONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: PMICONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: PMICONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: PMICONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: PMICONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: PMICONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: PMICONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: PMICONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: PMICONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: PMICONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: PMICONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: PMICONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: PMICONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: PMICONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: PMICONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: PMICONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: PMICONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: PMICONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: PMICONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: PMICONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: PMICONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: PMICONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: PMICONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: PMICONC.S.Afffd + + # Formaldehyde Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Formaldehyde Concentration Measurement + Cluster as a server?" + id: FLDCONC.S + + - label: + "Does the device implement the Formaldehyde Concentration Measurement + Cluster as a client?" + id: FLDCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: FLDCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: FLDCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: FLDCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: FLDCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: FLDCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: FLDCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: FLDCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: FLDCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: FLDCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: FLDCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: FLDCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: FLDCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: FLDCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: FLDCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: FLDCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: FLDCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: FLDCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: FLDCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: FLDCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: FLDCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: FLDCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: FLDCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: FLDCONC.S.Afffd + + # PM1 Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the PM1 Concentration Measurement Cluster + as a server?" + id: PMHCONC.S + + - label: + "Does the device implement the PM1 Concentration Measurement Cluster + as a client?" + id: PMHCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: PMHCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: PMHCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: PMHCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: PMHCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: PMHCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: PMHCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: PMHCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: PMHCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: PMHCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: PMHCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: PMHCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: PMHCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: PMHCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: PMHCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: PMHCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: PMHCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: PMHCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: PMHCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: PMHCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: PMHCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: PMHCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: PMHCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: PMHCONC.S.Afffd + + # PM10 Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the PM10 Concentration Measurement Cluster + as a server?" + id: PMKCONC.S + + - label: + "Does the device implement the PM10 Concentration Measurement Cluster + as a client?" + id: PMKCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: PMKCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: PMKCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: PMKCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: PMKCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: PMKCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: PMKCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: PMKCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: PMKCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: PMKCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: PMKCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: PMKCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: PMKCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: PMKCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: PMKCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: PMKCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: PMKCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: PMKCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: PMKCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: PMKCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: PMKCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: PMKCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: PMKCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: PMKCONC.S.Afffd + + # Total Volatile Organic Compounds Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Total Volatile Organic Compounds + Concentration Measurement Cluster as a server?" + id: TVOCCONC.S + + - label: + "Does the device implement the Total Volatile Organic Compounds + Concentration Measurement Cluster as a client?" + id: TVOCCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: TVOCCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: TVOCCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: TVOCCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: TVOCCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: TVOCCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: TVOCCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: TVOCCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: TVOCCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: TVOCCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: TVOCCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: TVOCCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: TVOCCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: TVOCCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: TVOCCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: TVOCCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: TVOCCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: TVOCCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: TVOCCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: TVOCCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: TVOCCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: TVOCCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: TVOCCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: TVOCCONC.S.Afffd + + # Radon Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Radon Concentration Measurement Cluster + as a server?" + id: RNCONC.S + + - label: + "Does the device implement the Radon Concentration Measurement Cluster + as a client?" + id: RNCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: RNCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: RNCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: RNCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: RNCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: RNCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: RNCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: RNCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: RNCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: RNCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: RNCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: RNCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: RNCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: RNCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: RNCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: RNCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: RNCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: RNCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: RNCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: RNCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: RNCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: RNCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: RNCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: RNCONC.S.Afffd diff --git a/src/app/tests/suites/certification/Test_TC_CDOCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CDOCONC_1_1.yaml new file mode 100644 index 00000000000000..96322964ee381d --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CDOCONC_1_1.yaml @@ -0,0 +1,326 @@ +# 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: 145.1.1. [TC-CDOCONC-1.1] Global Attributes with DUT as Server + +PICS: + - CDOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Carbon Dioxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: CDOCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given CDOCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given CDOCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given CDOCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given CDOCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given CDOCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given CDOCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given CDOCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given CDOCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given CDOCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given CDOCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given CDOCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given CDOCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && CDOCONC.S.A0007 && CDOCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when CDOCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && !CDOCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && CDOCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + CDOCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && !CDOCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && CDOCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when CDOCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && !CDOCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && CDOCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when CDOCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && !CDOCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && CDOCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + CDOCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && !CDOCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: CDOCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: CDOCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: CDOCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml new file mode 100644 index 00000000000000..8c4e2c94f0f206 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-CDOCONC-2.1] Attributes with server as DUT + +PICS: + - CDOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Carbon Dioxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: CDOCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: CDOCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: CDOCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: CDOCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: CDOCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: CDOCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: CDOCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: CDOCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: CDOCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: CDOCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_CMOCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CMOCONC_1_1.yaml new file mode 100644 index 00000000000000..038e7fea3ae448 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CMOCONC_1_1.yaml @@ -0,0 +1,326 @@ +# 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: 145.1.1. [TC-CMOCONC-1.1] Global Attributes with DUT as Server + +PICS: + - CMOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Carbon Monoxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: CMOCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given CMOCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given CMOCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given CMOCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given CMOCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given CMOCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given CMOCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given CMOCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given CMOCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given CMOCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given CMOCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given CMOCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given CMOCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && CMOCONC.S.A0007 && CMOCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when CMOCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && !CMOCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && CMOCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + CMOCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && !CMOCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && CMOCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when CMOCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && !CMOCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && CMOCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when CMOCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && !CMOCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && CMOCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + CMOCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && !CMOCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: CMOCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: CMOCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: CMOCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml new file mode 100644 index 00000000000000..84c4410dbee398 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-CMOCONC-2.1] Attributes with server as DUT + +PICS: + - CMOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Carbon Monoxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: CMOCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: CMOCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: CMOCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: CMOCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: CMOCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: CMOCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: CMOCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: CMOCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: CMOCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: CMOCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_FLDCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FLDCONC_1_1.yaml new file mode 100644 index 00000000000000..7edd006fcc2b14 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_FLDCONC_1_1.yaml @@ -0,0 +1,326 @@ +# 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: 145.1.1. [TC-FLDCONC-1.1] Global Attributes with DUT as Server + +PICS: + - FLDCONC.S + +config: + nodeId: 0x12344321 + cluster: "Formaldehyde Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: FLDCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given FLDCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given FLDCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given FLDCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given FLDCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given FLDCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given FLDCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given FLDCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given FLDCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given FLDCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given FLDCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given FLDCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given FLDCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && FLDCONC.S.A0007 && FLDCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when FLDCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && !FLDCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && FLDCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + FLDCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && !FLDCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && FLDCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when FLDCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && !FLDCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && FLDCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when FLDCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && !FLDCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && FLDCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + FLDCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && !FLDCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: FLDCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: FLDCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: FLDCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml new file mode 100644 index 00000000000000..88e113b1845488 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-FLDCONC-2.1] Attributes with server as DUT + +PICS: + - FLDCONC.S + +config: + nodeId: 0x12344321 + cluster: "Formaldehyde Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: FLDCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: FLDCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: FLDCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: FLDCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: FLDCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: FLDCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: FLDCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: FLDCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: FLDCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: FLDCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_NDOCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_NDOCONC_1_1.yaml new file mode 100644 index 00000000000000..141e04ca8ab9bf --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NDOCONC_1_1.yaml @@ -0,0 +1,326 @@ +# 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: 145.1.1. [TC-NDOCONC-1.1] Global Attributes with DUT as Server + +PICS: + - NDOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Nitrogen Dioxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: NDOCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given NDOCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given NDOCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given NDOCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given NDOCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given NDOCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given NDOCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given NDOCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given NDOCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given NDOCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given NDOCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given NDOCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given NDOCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && NDOCONC.S.A0007 && NDOCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when NDOCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && !NDOCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && NDOCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + NDOCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && !NDOCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && NDOCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when NDOCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && !NDOCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && NDOCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when NDOCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && !NDOCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && NDOCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + NDOCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && !NDOCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: NDOCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: NDOCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: NDOCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml new file mode 100644 index 00000000000000..2b4efbf5b459aa --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-NDOCONC-2.1] Attributes with server as DUT + +PICS: + - NDOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Nitrogen Dioxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: NDOCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: NDOCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: NDOCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: NDOCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: NDOCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: NDOCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: NDOCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: NDOCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: NDOCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: NDOCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_OZCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OZCONC_1_1.yaml new file mode 100644 index 00000000000000..48699e1875248c --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OZCONC_1_1.yaml @@ -0,0 +1,323 @@ +# 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: 145.1.1. [TC-OZCONC-1.1] Global Attributes with DUT as Server + +PICS: + - OZCONC.S + +config: + nodeId: 0x12344321 + cluster: "Ozone Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: OZCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: "Given OZCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given OZCONC.S.F00(MEA) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: "Given OZCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given OZCONC.S.F01(LEV) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: "Given OZCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given OZCONC.S.F02(MED) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given OZCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given OZCONC.S.F03(CRI) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given OZCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given OZCONC.S.F04(PEA) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given OZCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given OZCONC.S.F05(AVG) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && OZCONC.S.A0007 && OZCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when OZCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && !OZCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && OZCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + OZCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && !OZCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && OZCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when OZCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && !OZCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && OZCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when OZCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && !OZCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && OZCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + OZCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && !OZCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: OZCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: OZCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: OZCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml new file mode 100644 index 00000000000000..a022b6a9475012 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-OZCONC-2.1] Attributes with server as DUT + +PICS: + - OZCONC.S + +config: + nodeId: 0x12344321 + cluster: "Ozone Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: OZCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: OZCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: OZCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: OZCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: OZCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: OZCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: OZCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: OZCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: OZCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: OZCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_PMHCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PMHCONC_1_1.yaml new file mode 100644 index 00000000000000..866f5c2b6fd6ab --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMHCONC_1_1.yaml @@ -0,0 +1,326 @@ +# 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: 145.1.1. [TC-PMHCONC-1.1] Global Attributes with DUT as Server + +PICS: + - PMHCONC.S + +config: + nodeId: 0x12344321 + cluster: "PM1 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: PMHCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given PMHCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given PMHCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given PMHCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given PMHCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given PMHCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given PMHCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given PMHCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given PMHCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given PMHCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given PMHCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given PMHCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given PMHCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && PMHCONC.S.A0007 && PMHCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when PMHCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && !PMHCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && PMHCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + PMHCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && !PMHCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && PMHCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when PMHCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && !PMHCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && PMHCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when PMHCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && !PMHCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && PMHCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + PMHCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && !PMHCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: PMHCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: PMHCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: PMHCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml new file mode 100644 index 00000000000000..5a86bf09654f7a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-PMHCONC-2.1] Attributes with server as DUT + +PICS: + - PMHCONC.S + +config: + nodeId: 0x12344321 + cluster: "PM1 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: PMHCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: PMHCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: PMHCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: PMHCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: PMHCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: PMHCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: PMHCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: PMHCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: PMHCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: PMHCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_PMICONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PMICONC_1_1.yaml new file mode 100644 index 00000000000000..1d9e1c5168ea1e --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMICONC_1_1.yaml @@ -0,0 +1,326 @@ +# 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: 145.1.1. [TC-PMICONC-1.1] Global Attributes with DUT as Server + +PICS: + - PMICONC.S + +config: + nodeId: 0x12344321 + cluster: "PM2.5 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: PMICONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given PMICONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given PMICONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given PMICONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given PMICONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given PMICONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given PMICONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given PMICONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given PMICONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given PMICONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given PMICONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given PMICONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given PMICONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && PMICONC.S.A0007 && PMICONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when PMICONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && !PMICONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && PMICONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + PMICONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && !PMICONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && PMICONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when PMICONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && !PMICONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && PMICONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when PMICONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && !PMICONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && PMICONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + PMICONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && !PMICONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: PMICONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: PMICONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: PMICONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml new file mode 100644 index 00000000000000..34e5856a092bc2 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-PMICONC-2.1] Attributes with server as DUT + +PICS: + - PMICONC.S + +config: + nodeId: 0x12344321 + cluster: "PM2.5 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: PMICONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: PMICONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: PMICONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: PMICONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: PMICONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: PMICONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: PMICONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: PMICONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: PMICONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: PMICONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_PMKCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PMKCONC_1_1.yaml new file mode 100644 index 00000000000000..b0443d6aa1f38b --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMKCONC_1_1.yaml @@ -0,0 +1,326 @@ +# 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: 145.1.1. [TC-PMKCONC-1.1] Global Attributes with DUT as Server + +PICS: + - PMKCONC.S + +config: + nodeId: 0x12344321 + cluster: "PM10 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: PMKCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given PMKCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given PMKCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given PMKCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given PMKCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given PMKCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given PMKCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given PMKCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given PMKCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given PMKCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given PMKCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given PMKCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given PMKCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && PMKCONC.S.A0007 && PMKCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when PMKCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && !PMKCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && PMKCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + PMKCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && !PMKCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && PMKCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when PMKCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && !PMKCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && PMKCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when PMKCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && !PMKCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && PMKCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + PMKCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && !PMKCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: PMKCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: PMKCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: PMKCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml new file mode 100644 index 00000000000000..306df0864ddcfa --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-PMKCONC-2.1] Attributes with server as DUT + +PICS: + - PMKCONC.S + +config: + nodeId: 0x12344321 + cluster: "PM10 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: PMKCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: PMKCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: PMKCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: PMKCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: PMKCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: PMKCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: PMKCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: PMKCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: PMKCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: PMKCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_RNCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RNCONC_1_1.yaml new file mode 100644 index 00000000000000..d6813ae51ba754 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RNCONC_1_1.yaml @@ -0,0 +1,323 @@ +# 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: 145.1.1. [TC-RNCONC-1.1] Global Attributes with DUT as Server + +PICS: + - RNCONC.S + +config: + nodeId: 0x12344321 + cluster: "Radon Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: RNCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: "Given RNCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given RNCONC.S.F00(MEA) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: "Given RNCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given RNCONC.S.F01(LEV) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: "Given RNCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given RNCONC.S.F02(MED) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given RNCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given RNCONC.S.F03(CRI) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given RNCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given RNCONC.S.F04(PEA) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given RNCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given RNCONC.S.F05(AVG) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && RNCONC.S.A0007 && RNCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when RNCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && !RNCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && RNCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + RNCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && !RNCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && RNCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when RNCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && !RNCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && RNCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when RNCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && !RNCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && RNCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + RNCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && !RNCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: RNCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: RNCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: RNCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml new file mode 100644 index 00000000000000..ec39982a78a0e5 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-RNCONC-2.1] Attributes with server as DUT + +PICS: + - RNCONC.S + +config: + nodeId: 0x12344321 + cluster: "Radon Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: RNCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: RNCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: RNCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: RNCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: RNCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: RNCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: RNCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: RNCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: RNCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: RNCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_TVOCCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TVOCCONC_1_1.yaml new file mode 100644 index 00000000000000..e30bc5768c025e --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TVOCCONC_1_1.yaml @@ -0,0 +1,326 @@ +# 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: 145.1.1. [TC-TVOCCONC-1.1] Global Attributes with DUT as Server + +PICS: + - TVOCCONC.S + +config: + nodeId: 0x12344321 + cluster: "Total Volatile Organic Compounds Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: TVOCCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given TVOCCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given TVOCCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given TVOCCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given TVOCCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given TVOCCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given TVOCCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given TVOCCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given TVOCCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given TVOCCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given TVOCCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given TVOCCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given TVOCCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && TVOCCONC.S.A0007 && TVOCCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when TVOCCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && !TVOCCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && TVOCCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + TVOCCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && !TVOCCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && TVOCCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when TVOCCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && !TVOCCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && TVOCCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when TVOCCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && !TVOCCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && TVOCCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + TVOCCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && !TVOCCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: TVOCCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: TVOCCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: TVOCCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml new file mode 100644 index 00000000000000..d249a0ff8e5fe6 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-TVOCCONC-2.1] Attributes with server as DUT + +PICS: + - TVOCCONC.S + +config: + nodeId: 0x12344321 + cluster: "Total Volatile Organic Compounds Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: TVOCCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: TVOCCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: TVOCCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: TVOCCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: TVOCCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: TVOCCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: TVOCCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: TVOCCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: TVOCCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: TVOCCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index c80574b3b2d6fa..bc2daf1bc488b6 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -2242,3 +2242,290 @@ AIRQUAL.S.F03=1 AIRQUAL.S.A0000=1 PICS_USER_PROMPT=0 AIRQUAL.M.AirQualityChange=0 + +# Concentration Measurement +CDOCONC.C=0 +CDOCONC.S=1 +CDOCONC.S.F00=1 +CDOCONC.S.F01=1 +CDOCONC.S.F02=1 +CDOCONC.S.F03=1 +CDOCONC.S.F04=1 +CDOCONC.S.F05=1 +CDOCONC.S.A0000=1 +CDOCONC.S.A0001=1 +CDOCONC.S.A0002=1 +CDOCONC.S.A0003=1 +CDOCONC.S.A0004=1 +CDOCONC.S.A0005=1 +CDOCONC.S.A0006=1 +CDOCONC.S.A0007=1 +CDOCONC.S.A0008=1 +CDOCONC.S.A0009=1 +CDOCONC.S.A000a=1 +CDOCONC.S.Afff8=1 +CDOCONC.S.Afff9=1 +CDOCONC.S.Afffa=1 +CDOCONC.S.Afffb=1 +CDOCONC.S.Afffc=1 +CDOCONC.S.Afffd=1 + +CMOCONC.C=0 +CMOCONC.S=1 +CMOCONC.S.F00=1 +CMOCONC.S.F01=1 +CMOCONC.S.F02=1 +CMOCONC.S.F03=1 +CMOCONC.S.F04=1 +CMOCONC.S.F05=1 +CMOCONC.S.A0000=1 +CMOCONC.S.A0001=1 +CMOCONC.S.A0002=1 +CMOCONC.S.A0003=1 +CMOCONC.S.A0004=1 +CMOCONC.S.A0005=1 +CMOCONC.S.A0006=1 +CMOCONC.S.A0007=1 +CMOCONC.S.A0008=1 +CMOCONC.S.A0009=1 +CMOCONC.S.A000a=1 +CMOCONC.S.Afff8=1 +CMOCONC.S.Afff9=1 +CMOCONC.S.Afffa=1 +CMOCONC.S.Afffb=1 +CMOCONC.S.Afffc=1 +CMOCONC.S.Afffd=1 + +CMOCONC.C=0 +CMOCONC.S=1 +CMOCONC.S.F00=1 +CMOCONC.S.F01=1 +CMOCONC.S.F02=1 +CMOCONC.S.F03=1 +CMOCONC.S.F04=1 +CMOCONC.S.F05=1 +CMOCONC.S.A0000=1 +CMOCONC.S.A0001=1 +CMOCONC.S.A0002=1 +CMOCONC.S.A0003=1 +CMOCONC.S.A0004=1 +CMOCONC.S.A0005=1 +CMOCONC.S.A0006=1 +CMOCONC.S.A0007=1 +CMOCONC.S.A0008=1 +CMOCONC.S.A0009=1 +CMOCONC.S.A000a=1 +CMOCONC.S.Afff8=1 +CMOCONC.S.Afff9=1 +CMOCONC.S.Afffa=1 +CMOCONC.S.Afffb=1 +CMOCONC.S.Afffc=1 +CMOCONC.S.Afffd=1 + +NDOCONC.C=0 +NDOCONC.S=1 +NDOCONC.S.F00=1 +NDOCONC.S.F01=1 +NDOCONC.S.F02=1 +NDOCONC.S.F03=1 +NDOCONC.S.F04=1 +NDOCONC.S.F05=1 +NDOCONC.S.A0000=1 +NDOCONC.S.A0001=1 +NDOCONC.S.A0002=1 +NDOCONC.S.A0003=1 +NDOCONC.S.A0004=1 +NDOCONC.S.A0005=1 +NDOCONC.S.A0006=1 +NDOCONC.S.A0007=1 +NDOCONC.S.A0008=1 +NDOCONC.S.A0009=1 +NDOCONC.S.A000a=1 +NDOCONC.S.Afff8=1 +NDOCONC.S.Afff9=1 +NDOCONC.S.Afffa=1 +NDOCONC.S.Afffb=1 +NDOCONC.S.Afffc=1 +NDOCONC.S.Afffd=1 + +OZCONC.C=0 +OZCONC.S=1 +OZCONC.S.F00=1 +OZCONC.S.F01=1 +OZCONC.S.F02=1 +OZCONC.S.F03=1 +OZCONC.S.F04=1 +OZCONC.S.F05=1 +OZCONC.S.A0000=1 +OZCONC.S.A0001=1 +OZCONC.S.A0002=1 +OZCONC.S.A0003=1 +OZCONC.S.A0004=1 +OZCONC.S.A0005=1 +OZCONC.S.A0006=1 +OZCONC.S.A0007=1 +OZCONC.S.A0008=1 +OZCONC.S.A0009=1 +OZCONC.S.A000a=1 +OZCONC.S.Afff8=1 +OZCONC.S.Afff9=1 +OZCONC.S.Afffa=1 +OZCONC.S.Afffb=1 +OZCONC.S.Afffc=1 +OZCONC.S.Afffd=1 + +PMICONC.C=0 +PMICONC.S=1 +PMICONC.S.F00=1 +PMICONC.S.F01=1 +PMICONC.S.F02=1 +PMICONC.S.F03=1 +PMICONC.S.F04=1 +PMICONC.S.F05=1 +PMICONC.S.A0000=1 +PMICONC.S.A0001=1 +PMICONC.S.A0002=1 +PMICONC.S.A0003=1 +PMICONC.S.A0004=1 +PMICONC.S.A0005=1 +PMICONC.S.A0006=1 +PMICONC.S.A0007=1 +PMICONC.S.A0008=1 +PMICONC.S.A0009=1 +PMICONC.S.A000a=1 +PMICONC.S.Afff8=1 +PMICONC.S.Afff9=1 +PMICONC.S.Afffa=1 +PMICONC.S.Afffb=1 +PMICONC.S.Afffc=1 +PMICONC.S.Afffd=1 + +FLDCONC.C=0 +FLDCONC.S=1 +FLDCONC.S.F00=1 +FLDCONC.S.F01=1 +FLDCONC.S.F02=1 +FLDCONC.S.F03=1 +FLDCONC.S.F04=1 +FLDCONC.S.F05=1 +FLDCONC.S.A0000=1 +FLDCONC.S.A0001=1 +FLDCONC.S.A0002=1 +FLDCONC.S.A0003=1 +FLDCONC.S.A0004=1 +FLDCONC.S.A0005=1 +FLDCONC.S.A0006=1 +FLDCONC.S.A0007=1 +FLDCONC.S.A0008=1 +FLDCONC.S.A0009=1 +FLDCONC.S.A000a=1 +FLDCONC.S.Afff8=1 +FLDCONC.S.Afff9=1 +FLDCONC.S.Afffa=1 +FLDCONC.S.Afffb=1 +FLDCONC.S.Afffc=1 +FLDCONC.S.Afffd=1 + +PMHCONC.C=0 +PMHCONC.S=1 +PMHCONC.S.F00=1 +PMHCONC.S.F01=1 +PMHCONC.S.F02=1 +PMHCONC.S.F03=1 +PMHCONC.S.F04=1 +PMHCONC.S.F05=1 +PMHCONC.S.A0000=1 +PMHCONC.S.A0001=1 +PMHCONC.S.A0002=1 +PMHCONC.S.A0003=1 +PMHCONC.S.A0004=1 +PMHCONC.S.A0005=1 +PMHCONC.S.A0006=1 +PMHCONC.S.A0007=1 +PMHCONC.S.A0008=1 +PMHCONC.S.A0009=1 +PMHCONC.S.A000a=1 +PMHCONC.S.Afff8=1 +PMHCONC.S.Afff9=1 +PMHCONC.S.Afffa=1 +PMHCONC.S.Afffb=1 +PMHCONC.S.Afffc=1 +PMHCONC.S.Afffd=1 + +PMKCONC.C=0 +PMKCONC.S=1 +PMKCONC.S.F00=1 +PMKCONC.S.F01=1 +PMKCONC.S.F02=1 +PMKCONC.S.F03=1 +PMKCONC.S.F04=1 +PMKCONC.S.F05=1 +PMKCONC.S.A0000=1 +PMKCONC.S.A0001=1 +PMKCONC.S.A0002=1 +PMKCONC.S.A0003=1 +PMKCONC.S.A0004=1 +PMKCONC.S.A0005=1 +PMKCONC.S.A0006=1 +PMKCONC.S.A0007=1 +PMKCONC.S.A0008=1 +PMKCONC.S.A0009=1 +PMKCONC.S.A000a=1 +PMKCONC.S.Afff8=1 +PMKCONC.S.Afff9=1 +PMKCONC.S.Afffa=1 +PMKCONC.S.Afffb=1 +PMKCONC.S.Afffc=1 +PMKCONC.S.Afffd=1 + +TVOCCONC.C=0 +TVOCCONC.S=1 +TVOCCONC.S.F00=1 +TVOCCONC.S.F01=1 +TVOCCONC.S.F02=1 +TVOCCONC.S.F03=1 +TVOCCONC.S.F04=1 +TVOCCONC.S.F05=1 +TVOCCONC.S.A0000=1 +TVOCCONC.S.A0001=1 +TVOCCONC.S.A0002=1 +TVOCCONC.S.A0003=1 +TVOCCONC.S.A0004=1 +TVOCCONC.S.A0005=1 +TVOCCONC.S.A0006=1 +TVOCCONC.S.A0007=1 +TVOCCONC.S.A0008=1 +TVOCCONC.S.A0009=1 +TVOCCONC.S.A000a=1 +TVOCCONC.S.Afff8=1 +TVOCCONC.S.Afff9=1 +TVOCCONC.S.Afffa=1 +TVOCCONC.S.Afffb=1 +TVOCCONC.S.Afffc=1 +TVOCCONC.S.Afffd=1 + +RNCONC.C=0 +RNCONC.S=1 +RNCONC.S.F00=1 +RNCONC.S.F01=1 +RNCONC.S.F02=1 +RNCONC.S.F03=1 +RNCONC.S.F04=1 +RNCONC.S.F05=1 +RNCONC.S.A0000=1 +RNCONC.S.A0001=1 +RNCONC.S.A0002=1 +RNCONC.S.A0003=1 +RNCONC.S.A0004=1 +RNCONC.S.A0005=1 +RNCONC.S.A0006=1 +RNCONC.S.A0007=1 +RNCONC.S.A0008=1 +RNCONC.S.A0009=1 +RNCONC.S.A000a=1 +RNCONC.S.Afff8=1 +RNCONC.S.Afff9=1 +RNCONC.S.Afffa=1 +RNCONC.S.Afffb=1 +RNCONC.S.Afffc=1 +RNCONC.S.Afffd=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 80a913df8b3765..156d22d600efe8 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -301,6 +301,28 @@ "Test_TC_ZEOFREMON_2_1" ], "AirQuality": ["Test_TC_AIRQUAL_1_1", "Test_TC_AIRQUAL_2_1"], + "ConcentrationMeasurement": [ + "Test_TC_CDOCONC_1_1", + "Test_TC_CDOCONC_2_1", + "Test_TC_CMOCONC_1_1", + "Test_TC_CMOCONC_2_1", + "Test_TC_FLDCONC_1_1", + "Test_TC_FLDCONC_2_1", + "Test_TC_NDOCONC_1_1", + "Test_TC_NDOCONC_2_1", + "Test_TC_OZCONC_1_1", + "Test_TC_OZCONC_2_1", + "Test_TC_PMHCONC_1_1", + "Test_TC_PMHCONC_2_1", + "Test_TC_PMICONC_1_1", + "Test_TC_PMICONC_2_1", + "Test_TC_PMKCONC_1_1", + "Test_TC_PMKCONC_2_1", + "Test_TC_RNCONC_1_1", + "Test_TC_RNCONC_2_1", + "Test_TC_TVOCCONC_1_1", + "Test_TC_TVOCCONC_2_1" + ], "collection": [ "AccessControl", "AccessControlEnforcement", @@ -310,6 +332,7 @@ "Actions", "Binding", "ColorControl", + "ConcentrationMeasurement", "DeviceManagement", "Descriptor", "DiagnosticsLogs", diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 849921d488c814..9364d830c45340 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -21,7 +21,7 @@ - + @@ -38,17 +38,19 @@ - + + + @@ -57,10 +59,10 @@ - + - - + + diff --git a/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml new file mode 100644 index 00000000000000..49e4d4c86ff105 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + General + Dishwasher Mode + 0x0059 + DISHWASHER_MODE_CLUSTER + true + true + Attributes and commands for selecting a mode from a list of supported options. + + + SupportedModes + CurrentMode + StartUpMode + OnMode + + + + + This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. + + + + + + + This command is sent by the device on receipt of the ChangeToModeWithStatus command. + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml deleted file mode 100644 index 5814edebd43452..00000000000000 --- a/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - General - Dishwasher Mode Select - 0x0059 - DISHWASHER_MODE_SELECT_CLUSTER - true - true - This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for dishwasher devices. - - - Description - SupportedModes - CurrentMode - StartUpMode - OnMode - - - - - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml new file mode 100644 index 00000000000000..3bea0e59d015ef --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + General + Laundry Washer Mode + 0x0051 + LAUNDRY_WASHER_MODE_CLUSTER + true + true + Attributes and commands for selecting a mode from a list of supported options. + + + SupportedModes + CurrentMode + StartUpMode + OnMode + + + + + This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. + + + + + + + This command is sent by the device on receipt of the ChangeToModeWithStatus command. + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml deleted file mode 100644 index 52cc7039d5c621..00000000000000 --- a/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - General - Laundry Washer Mode Select - 0x0051 - LAUNDRY_WASHER_MODE_SELECT_CLUSTER - true - true - This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for laundry washer devices. - - - Description - SupportedModes - CurrentMode - StartUpMode - OnMode - - - - - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml new file mode 100644 index 00000000000000..f0bb878ce09b7a --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml index 3df49aa9cdff84..7bf4c972972635 100644 --- a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml @@ -17,50 +17,17 @@ limitations under the License. - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - + + + @@ -71,52 +38,26 @@ limitations under the License. true true Attributes and commands for selecting a mode from a list of supported options. - - Description - - StandardNamespace - SupportedModes - CurrentMode - StartUpMode - OnMode - - + Description + StandardNamespace + SupportedModes + CurrentMode + StartUpMode + OnMode + + - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. + On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. - - + - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml index de156b7a726041..e454bbee517ae3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml @@ -35,15 +35,17 @@ limitations under the License. - - + + + - - - + + + + @@ -59,10 +61,10 @@ limitations under the License. PhaseList CurrentPhase - CountdownTime + CountdownTime OperationalStateList OperationalState - OperationalError + OperationalError Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. @@ -92,7 +94,7 @@ limitations under the License. OperationCompletion - + diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml new file mode 100644 index 00000000000000..94c10eb297a5d3 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Robots + RVC Operational State + 0x0061 + OPERATIONAL_STATE_RVC_CLUSTER + true + true + This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. + + + + PhaseList + CurrentPhase + CountdownTime + OperationalStateList + OperationalState + OperationalError + + + Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. + + + + Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. + + + + Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. + + + + Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). + + + + This command SHALL be generated in response to any of the Start, Stop, Pause, or Resume commands. + + + + + OperationalError + + + + + OperationCompletion + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml new file mode 100644 index 00000000000000..aafc4f36af53f4 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + General + Refrigerator And Temperature Controlled Cabinet Mode + 0x0052 + REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER + true + true + Attributes and commands for selecting a mode from a list of supported options. + + + SupportedModes + CurrentMode + StartUpMode + OnMode + + + + + This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. + + + + + + + This command is sent by the device on receipt of the ChangeToModeWithStatus command. + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml deleted file mode 100644 index 965dae53507ec4..00000000000000 --- a/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - General - Refrigerator And Temperature Controlled Cabinet Mode Select - 0x0052 - REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER - true - true - This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for refrigerator and temperature controlled cabinet devices. - - - Description - SupportedModes - CurrentMode - StartUpMode - OnMode - - - - - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml new file mode 100644 index 00000000000000..9ae08bb6cb6a3a --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + General + RVC Clean Mode + 0x0055 + RVC_CLEAN_MODE_CLUSTER + true + true + Attributes and commands for selecting a mode from a list of supported options. + + + SupportedModes + CurrentMode + StartUpMode + OnMode + + + + + This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. + + + + + + + This command is sent by the device on receipt of the ChangeToModeWithStatus command. + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml deleted file mode 100644 index 9dcdc5e89dc569..00000000000000 --- a/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - General - RVC Clean Mode Select - 0x0055 - RVC_CLEAN_MODE_SELECT_CLUSTER - true - true - This cluster is an alias of the Mode Select cluster which also defines a namespace for the - cleaning type of the Robotic Vacuum Cleaner devices. - - - Description - SupportedModes - CurrentMode - StartUpMode - OnMode - - - - - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml new file mode 100644 index 00000000000000..ae5cc2163cc786 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + General + RVC Run Mode + 0x0054 + RVC_RUN_MODE_CLUSTER + true + true + Attributes and commands for selecting a mode from a list of supported options. + + + SupportedModes + CurrentMode + StartUpMode + OnMode + + + + + This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. + + + + + + + This command is sent by the device on receipt of the ChangeToModeWithStatus command. + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml deleted file mode 100644 index 6e1483d0be074b..00000000000000 --- a/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - General - RVC Run Mode Select - 0x0054 - RVC_RUN_MODE_SELECT_CLUSTER - true - true - This cluster is an alias of the Mode Select cluster which also defines a namespace for the running modes of the Robotic Vacuum Cleaner devices. - - - Description - SupportedModes - CurrentMode - StartUpMode - OnMode - - - - - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - - - - - 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 24be37cd01d7d1..07eca6ae3db3d3 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -35,7 +35,7 @@ "content-launch-cluster.xml", "descriptor-cluster.xml", "diagnostic-logs-cluster.xml", - "dishwasher-mode-select-cluster.xml", + "dishwasher-mode-cluster.xml", "door-lock-cluster.xml", "electrical-measurement-cluster.xml", "ethernet-network-diagnostics-cluster.xml", @@ -53,12 +53,13 @@ "illuminance-measurement-cluster.xml", "input-output-value-clusters.xml", "keypad-input-cluster.xml", - "laundry-washer-mode-select-cluster.xml", + "laundry-washer-mode-cluster.xml", "level-control-cluster.xml", "localization-configuration-cluster.xml", "low-power-cluster.xml", "media-input-cluster.xml", "media-playback-cluster.xml", + "mode-base-cluster.xml", "mode-select-cluster.xml", "mode-select-extensions.xml", "network-commissioning-cluster.xml", @@ -67,6 +68,7 @@ "onoff-switch-configuration-cluster.xml", "operational-credentials-cluster.xml", "operational-state-cluster.xml", + "operational-state-rvc-cluster.xml", "pressure-measurement-cluster.xml", "power-source-cluster.xml", "power-source-configuration-cluster.xml", @@ -75,12 +77,12 @@ "proxy-valid-cluster.xml", "pump-configuration-and-control-cluster.xml", "pwm-cluster.xml", - "refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml", + "refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml", "refrigerator-alarm.xml", "relative-humidity-measurement-cluster.xml", "replacable-monitoring-cluster.xml", - "rvc-clean-mode-select-cluster.xml ", - "rvc-run-mode-select-cluster.xml", + "rvc-clean-mode-cluster.xml ", + "rvc-run-mode-cluster.xml", "resource-monitoring-cluster.xml", "scene.xml", "smoke-co-alarm-cluster.xml", @@ -300,7 +302,8 @@ "LocalTime" ], "Temperature Control": ["SupportedTemperatureLevels"], - "Operational State": ["OperationalState", "OperationalError"] + "Operational State": ["OperationalState", "OperationalError"], + "RVC Operational State": ["OperationalState", "OperationalError"] }, "defaultReportingPolicy": "mandatory", "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 220ce3a3c9574f..24cc5cb2c4a6d1 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -34,7 +34,7 @@ "content-launch-cluster.xml", "descriptor-cluster.xml", "diagnostic-logs-cluster.xml", - "dishwasher-mode-select-cluster.xml", + "dishwasher-mode-cluster.xml", "door-lock-cluster.xml", "electrical-measurement-cluster.xml", "ethernet-network-diagnostics-cluster.xml", @@ -52,12 +52,13 @@ "illuminance-measurement-cluster.xml", "input-output-value-clusters.xml", "keypad-input-cluster.xml", - "laundry-washer-mode-select-cluster.xml", + "laundry-washer-mode-cluster.xml", "level-control-cluster.xml", "localization-configuration-cluster.xml", "low-power-cluster.xml", "media-input-cluster.xml", "media-playback-cluster.xml", + "mode-base-cluster.xml", "mode-select-cluster.xml", "network-commissioning-cluster.xml", "occupancy-sensing-cluster.xml", @@ -65,6 +66,7 @@ "onoff-switch-configuration-cluster.xml", "operational-credentials-cluster.xml", "operational-state-cluster.xml", + "operational-state-rvc-cluster.xml", "pressure-measurement-cluster.xml", "power-source-cluster.xml", "power-source-configuration-cluster.xml", @@ -73,11 +75,11 @@ "proxy-valid-cluster.xml", "pump-configuration-and-control-cluster.xml", "pwm-cluster.xml", - "refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml", + "refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml", "refrigerator-alarm.xml", "relative-humidity-measurement-cluster.xml", - "rvc-clean-mode-select-cluster.xml ", - "rvc-run-mode-select-cluster.xml", + "rvc-clean-mode-cluster.xml ", + "rvc-run-mode-cluster.xml", "replacable-monitoring-cluster.xml", "resource-monitoring-cluster.xml", "scene.xml", @@ -298,7 +300,8 @@ "LocalTime" ], "Temperature Control": ["SupportedTemperatureLevels"], - "Operational State": ["OperationalState", "OperationalError"] + "Operational State": ["OperationalState", "OperationalError"], + "RVC Operational State": ["OperationalState", "OperationalError"] }, "defaultReportingPolicy": "mandatory", "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index ae3c9ff51732e2..7925bbf5ee5fd9 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -36,7 +36,7 @@ "DESCRIPTOR_CLUSTER": [], "DEVICE_TEMP_CLUSTER": [], "DIAGNOSTIC_LOGS_CLUSTER": [], - "DISHWASHER_MODE_SELECT_CLUSTER": [], + "DISHWASHER_MODE_CLUSTER": [], "DISSOLVED_OXYGEN_CONCENTRATION_MEASUREMENT_CLUSTER": [], "DOOR_LOCK_CLUSTER": [], "ELECTRICAL_MEASUREMENT_CLUSTER": [], @@ -67,7 +67,7 @@ "INK_CARTRIDGE_MONITORING_CLUSTER": [], "IONIZING_FILTER_MONITORING_CLUSTER": [], "KEYPAD_INPUT_CLUSTER": [], - "LAUNDRY_WASHER_MODE_SELECT_CLUSTER": [], + "LAUNDRY_WASHER_MODE_CLUSTER": [], "LEAD_CONCENTRATION_MEASUREMENT_CLUSTER": [], "LEVEL_CONTROL_CLUSTER": [], "LOCALIZATION_CONFIGURATION_CLUSTER": [], @@ -84,6 +84,7 @@ "ON_OFF_SWITCH_CONFIGURATION_CLUSTER": [], "OPERATIONAL_CREDENTIALS_CLUSTER": [], "OPERATIONAL_STATE_CLUSTER": [], + "OPERATIONAL_STATE_RVC_CLUSTER": [], "OTA_BOOTLOAD_CLUSTER": [], "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER": [], "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER": [], @@ -106,12 +107,12 @@ "pump-configuration-and-control-client" ], "PWM_CLUSTER": [], - "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER": [], + "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER": [], "RADON_CONCENTRATION_MEASUREMENT_CLUSTER": [], "REFRIGERATOR_ALARM": [], "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [], - "RVC_CLEAN_MODE_SELECT_CLUSTER": [], - "RVC_RUN_MODE_SELECT_CLUSTER": [], + "RVC_CLEAN_MODE_CLUSTER": [], + "RVC_RUN_MODE_CLUSTER": [], "SCENES_CLUSTER": [], "SMOKE_CO_ALARM_CLUSTER": [], "SODIUM_CONCENTRATION_MEASUREMENT_CLUSTER": [], @@ -186,7 +187,7 @@ "DESCRIPTOR_CLUSTER": ["descriptor"], "DEVICE_TEMP_CLUSTER": [], "DIAGNOSTIC_LOGS_CLUSTER": ["diagnostic-logs-server"], - "DISHWASHER_MODE_SELECT_CLUSTER": ["mode-select-server"], + "DISHWASHER_MODE_CLUSTER": ["mode-select-server"], "DISSOLVED_OXYGEN_CONCENTRATION_MEASUREMENT_CLUSTER": [], "DOOR_LOCK_CLUSTER": ["door-lock-server"], "ELECTRICAL_MEASUREMENT_CLUSTER": [], @@ -219,7 +220,7 @@ "INK_CARTRIDGE_MONITORING_CLUSTER": [], "IONIZING_FILTER_MONITORING_CLUSTER": [], "KEYPAD_INPUT_CLUSTER": ["keypad-input-server"], - "LAUNDRY_WASHER_MODE_SELECT_CLUSTER": ["mode-select-server"], + "LAUNDRY_WASHER_MODE_CLUSTER": ["mode-select-server"], "LEAD_CONCENTRATION_MEASUREMENT_CLUSTER": [], "LEVEL_CONTROL_CLUSTER": ["level-control"], "LOCALIZATION_CONFIGURATION_CLUSTER": [ @@ -263,13 +264,13 @@ "PWM_CLUSTER": [], "RADON_CONCENTRATION_MEASUREMENT_CLUSTER": [], "REFRIGERATOR_ALARM_CLUSTER": ["refrigerator-alarm-server"], - "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER": [ + "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER": [ "mode-select-server" ], "REFRIGERATOR_ALARM_CLUSTER": ["refrigerator-alarm-server"], "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [], - "RVC_CLEAN_MODE_SELECT_CLUSTER": ["mode-select-server"], - "RVC_RUN_MODE_SELECT_CLUSTER": ["mode-select-server"], + "RVC_CLEAN_MODE_CLUSTER": ["mode-select-server"], + "RVC_RUN_MODE_CLUSTER": ["mode-select-server"], "SCENES_CLUSTER": ["scenes-server"], "SMOKE_CO_ALARM_CLUSTER": ["smoke-co-alarm-server"], "SODIUM_CONCENTRATION_MEASUREMENT_CLUSTER": [], diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index 88eee715a7f08f..22f59e0292cb80 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -108,8 +108,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/DescriptorClient-ReadImpl.cpp", "jni/DiagnosticLogsClient-InvokeSubscribeImpl.cpp", "jni/DiagnosticLogsClient-ReadImpl.cpp", - "jni/DishwasherModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/DishwasherModeSelectClient-ReadImpl.cpp", + "jni/DishwasherModeClient-InvokeSubscribeImpl.cpp", + "jni/DishwasherModeClient-ReadImpl.cpp", "jni/DissolvedOxygenConcentrationMeasurementClient-InvokeSubscribeImpl.cpp", "jni/DissolvedOxygenConcentrationMeasurementClient-ReadImpl.cpp", "jni/DoorLockClient-InvokeSubscribeImpl.cpp", @@ -168,8 +168,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/IonizingFilterMonitoringClient-ReadImpl.cpp", "jni/KeypadInputClient-InvokeSubscribeImpl.cpp", "jni/KeypadInputClient-ReadImpl.cpp", - "jni/LaundryWasherModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/LaundryWasherModeSelectClient-ReadImpl.cpp", + "jni/LaundryWasherModeClient-InvokeSubscribeImpl.cpp", + "jni/LaundryWasherModeClient-ReadImpl.cpp", "jni/LeadConcentrationMeasurementClient-InvokeSubscribeImpl.cpp", "jni/LeadConcentrationMeasurementClient-ReadImpl.cpp", "jni/LevelControlClient-InvokeSubscribeImpl.cpp", @@ -238,14 +238,16 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/RadonConcentrationMeasurementClient-ReadImpl.cpp", "jni/RefrigeratorAlarmClient-InvokeSubscribeImpl.cpp", "jni/RefrigeratorAlarmClient-ReadImpl.cpp", - "jni/RefrigeratorAndTemperatureControlledCabinetModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/RefrigeratorAndTemperatureControlledCabinetModeSelectClient-ReadImpl.cpp", + "jni/RefrigeratorAndTemperatureControlledCabinetModeClient-InvokeSubscribeImpl.cpp", + "jni/RefrigeratorAndTemperatureControlledCabinetModeClient-ReadImpl.cpp", "jni/RelativeHumidityMeasurementClient-InvokeSubscribeImpl.cpp", "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", - "jni/RvcCleanModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/RvcCleanModeSelectClient-ReadImpl.cpp", - "jni/RvcRunModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/RvcRunModeSelectClient-ReadImpl.cpp", + "jni/RvcOperationalStateClient-InvokeSubscribeImpl.cpp", + "jni/RvcOperationalStateClient-ReadImpl.cpp", + "jni/RvcCleanModeClient-InvokeSubscribeImpl.cpp", + "jni/RvcCleanModeClient-ReadImpl.cpp", + "jni/RvcRunModeClient-InvokeSubscribeImpl.cpp", + "jni/RvcRunModeClient-ReadImpl.cpp", "jni/ScenesClient-InvokeSubscribeImpl.cpp", "jni/ScenesClient-ReadImpl.cpp", "jni/SmokeCoAlarmClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 8515fe3b3d9d41..a160909ea05ff4 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -18,11 +17,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { @@ -2752,44 +2762,23 @@ client cluster IcdManagement = 70 { /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; - readonly attribute optional nullable enum16 standardNamespace = 1; + readonly attribute nullable enum16 standardNamespace = 1; readonly attribute ModeOptionStruct supportedModes[] = 2; readonly attribute int8u currentMode = 3; attribute optional nullable int8u startUpMode = 4; @@ -2805,27 +2794,12 @@ client cluster ModeSelect = 80 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { - ENUM8 status = 0; - optional CHAR_STRING statusText = 1; - } - - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ + /** On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. */ command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; } -/** This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for laundry washer devices. */ -client cluster LaundryWasherModeSelect = 81 { +/** Attributes and commands for selecting a mode from a list of supported options. */ +client cluster LaundryWasherMode = 81 { enum ModeTag : ENUM16 { kNormal = 16384; kDelicate = 16385; @@ -2835,13 +2809,11 @@ client cluster LaundryWasherModeSelect = 81 { bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -2850,11 +2822,10 @@ client cluster LaundryWasherModeSelect = 81 { ModeTagStruct modeTags[] = 2; } - readonly attribute char_string<64> description = 0; - readonly attribute ModeOptionStruct supportedModes[] = 2; - readonly attribute int8u currentMode = 3; - attribute optional nullable int8u startUpMode = 4; - attribute optional nullable int8u onMode = 5; + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2866,27 +2837,18 @@ client cluster LaundryWasherModeSelect = 81 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { + response struct ChangeToModeResponse = 1 { ENUM8 status = 0; optional CHAR_STRING statusText = 1; } - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ - command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. + /** This command is used to change device modes. On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } -/** This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for refrigerator and temperature controlled cabinet devices. */ -client cluster RefrigeratorAndTemperatureControlledCabinetModeSelect = 82 { +/** Attributes and commands for selecting a mode from a list of supported options. */ +client cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 { enum ModeTag : ENUM16 { kRapidCool = 16384; kRapidFreeze = 16385; @@ -2894,13 +2856,11 @@ client cluster RefrigeratorAndTemperatureControlledCabinetModeSelect = 82 { bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -2909,11 +2869,10 @@ client cluster RefrigeratorAndTemperatureControlledCabinetModeSelect = 82 { ModeTagStruct modeTags[] = 2; } - readonly attribute char_string<64> description = 0; - readonly attribute ModeOptionStruct supportedModes[] = 2; - readonly attribute int8u currentMode = 3; - attribute optional nullable int8u startUpMode = 4; - attribute optional nullable int8u onMode = 5; + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2925,22 +2884,14 @@ client cluster RefrigeratorAndTemperatureControlledCabinetModeSelect = 82 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { + response struct ChangeToModeResponse = 1 { ENUM8 status = 0; optional CHAR_STRING statusText = 1; } - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ - command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. + /** This command is used to change device modes. On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } /** This cluster supports remotely monitoring and controling the different typs of functionality available to a washing device, such as a washing machine. */ @@ -2962,8 +2913,8 @@ client cluster WasherControls = 83 { readonly attribute int16u clusterRevision = 65533; } -/** This cluster is an alias of the Mode Select cluster which also defines a namespace for the running modes of the Robotic Vacuum Cleaner devices. */ -client cluster RvcRunModeSelect = 84 { +/** Attributes and commands for selecting a mode from a list of supported options. */ +client cluster RvcRunMode = 84 { enum ModeTag : ENUM16 { kIdle = 16384; kCleaning = 16385; @@ -2982,13 +2933,11 @@ client cluster RvcRunModeSelect = 84 { bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -2997,11 +2946,10 @@ client cluster RvcRunModeSelect = 84 { ModeTagStruct modeTags[] = 2; } - readonly attribute char_string<64> description = 0; - readonly attribute ModeOptionStruct supportedModes[] = 2; - readonly attribute int8u currentMode = 3; - attribute optional nullable int8u startUpMode = 4; - attribute optional nullable int8u onMode = 5; + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3013,27 +2961,18 @@ client cluster RvcRunModeSelect = 84 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { + response struct ChangeToModeResponse = 1 { ENUM8 status = 0; optional CHAR_STRING statusText = 1; } - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ - command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. + /** This command is used to change device modes. On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } -/** This cluster is an alias of the Mode Select cluster which also defines a namespace for the - cleaning type of the Robotic Vacuum Cleaner devices. */ -client cluster RvcCleanModeSelect = 85 { +/** Attributes and commands for selecting a mode from a list of supported options. */ +client cluster RvcCleanMode = 85 { enum ModeTag : ENUM16 { kDeepClean = 16384; kVacuum = 16385; @@ -3046,13 +2985,11 @@ client cluster RvcCleanModeSelect = 85 { bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -3061,11 +2998,10 @@ client cluster RvcCleanModeSelect = 85 { ModeTagStruct modeTags[] = 2; } - readonly attribute char_string<64> description = 0; - readonly attribute ModeOptionStruct supportedModes[] = 2; - readonly attribute int8u currentMode = 3; - attribute optional nullable int8u startUpMode = 4; - attribute optional nullable int8u onMode = 5; + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3077,22 +3013,14 @@ client cluster RvcCleanModeSelect = 85 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { + response struct ChangeToModeResponse = 1 { ENUM8 status = 0; optional CHAR_STRING statusText = 1; } - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ - command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. + /** This command is used to change device modes. On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } /** Attributes and commands for configuring the temperature control, and reporting temperature. */ @@ -3148,9 +3076,8 @@ client cluster RefrigeratorAlarm = 87 { readonly attribute int16u clusterRevision = 65533; } -/** This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for dishwasher devices. */ -client cluster DishwasherModeSelect = 89 { +/** Attributes and commands for selecting a mode from a list of supported options. */ +client cluster DishwasherMode = 89 { enum ModeTag : ENUM16 { kNormal = 16384; kHeavy = 16385; @@ -3159,13 +3086,11 @@ client cluster DishwasherModeSelect = 89 { bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -3174,11 +3099,10 @@ client cluster DishwasherModeSelect = 89 { ModeTagStruct modeTags[] = 2; } - readonly attribute char_string<64> description = 0; - readonly attribute ModeOptionStruct supportedModes[] = 2; - readonly attribute int8u currentMode = 3; - attribute optional nullable int8u startUpMode = 4; - attribute optional nullable int8u onMode = 5; + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3190,22 +3114,14 @@ client cluster DishwasherModeSelect = 89 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { + response struct ChangeToModeResponse = 1 { ENUM8 status = 0; optional CHAR_STRING statusText = 1; } - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ - command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. + /** This command is used to change device modes. On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } /** Attributes for reporting air quality classification */ @@ -3357,14 +3273,81 @@ client cluster OperationalState = 96 { } struct ErrorStateStruct { - ErrorStateEnum errorStateID = 0; - nullable char_string<64> errorStateLabel = 1; + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; + } + + struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; + } + + critical event OperationalError = 0 { + ErrorStateStruct errorState = 0; + } + + info event OperationCompletion = 1 { + ENUM8 completionErrorCode = 0; + optional nullable elapsed_s totalOperationalTime = 1; + optional nullable elapsed_s pausedTime = 2; + } + + readonly attribute nullable CHAR_STRING phaseList[] = 0; + readonly attribute nullable int8u currentPhase = 1; + readonly attribute optional nullable elapsed_s countdownTime = 2; + readonly attribute OperationalStateStruct operationalStateList[] = 3; + readonly attribute OperationalStateStruct operationalState = 4; + readonly attribute ErrorStateStruct operationalError = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + response struct OperationalCommandResponse = 4 { + ErrorStateStruct commandResponseState = 0; + } + + /** Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */ + command Pause(): OperationalCommandResponse = 0; + /** Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. */ + command Stop(): OperationalCommandResponse = 1; + /** Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. */ + command Start(): OperationalCommandResponse = 2; + /** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */ + command Resume(): OperationalCommandResponse = 3; +} + +/** This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ +client cluster RvcOperationalState = 97 { + enum ErrorStateEnum : ENUM8 { + kFailedToFindChargingDock = 64; + kStuck = 65; + kDustBinMissing = 66; + kDustBinFull = 67; + kWaterTankEmpty = 68; + kWaterTankMissing = 69; + kWaterTankLidOpen = 70; + kMopCleaningPadMissing = 71; + } + + enum OperationalStateEnum : ENUM8 { + kSeekingCharger = 64; + kCharging = 65; + kDocked = 66; + } + + struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; optional char_string<64> errorStateDetails = 2; } struct OperationalStateStruct { - OperationalStateEnum operationalStateID = 0; - char_string<64> operationalStateLabel = 1; + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; } critical event OperationalError = 0 { @@ -3372,7 +3355,7 @@ client cluster OperationalState = 96 { } info event OperationCompletion = 1 { - ErrorStateEnum completionErrorCode = 0; + ENUM8 completionErrorCode = 0; optional nullable elapsed_s totalOperationalTime = 1; optional nullable elapsed_s pausedTime = 2; } diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index c393c9e320bc7f..4f78819037b7ef 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -16,6 +16,12 @@ } ], "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + }, { "pathRelativity": "relativeToZap", "path": "../../app/zap-templates/zcl/zcl.json", @@ -23,12 +29,6 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" } ], "endpointTypes": [ @@ -10466,14 +10466,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -10487,7 +10479,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10503,7 +10495,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10518,16 +10510,6 @@ "define": "MODE_SELECT_CLUSTER", "side": "server", "enabled": 0, - "commands": [ - { - "name": "ChangeToModeResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], "attributes": [ { "name": "Description", @@ -10552,7 +10534,7 @@ "side": "server", "type": "enum16", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10568,10 +10550,10 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10599,7 +10581,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -10615,11 +10597,11 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10632,7 +10614,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10648,7 +10630,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10664,7 +10646,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10680,7 +10662,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10724,10 +10706,10 @@ ] }, { - "name": "Laundry Washer Mode Select", + "name": "Laundry Washer Mode", "code": 81, "mfgCode": null, - "define": "LAUNDRY_WASHER_MODE_SELECT_CLUSTER", + "define": "LAUNDRY_WASHER_MODE_CLUSTER", "side": "client", "enabled": 1, "commands": [ @@ -10738,14 +10720,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -10759,7 +10733,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10775,7 +10749,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10784,16 +10758,16 @@ ] }, { - "name": "Laundry Washer Mode Select", + "name": "Laundry Washer Mode", "code": 81, "mfgCode": null, - "define": "LAUNDRY_WASHER_MODE_SELECT_CLUSTER", + "define": "LAUNDRY_WASHER_MODE_CLUSTER", "side": "server", "enabled": 0, "commands": [ { "name": "ChangeToModeResponse", - "code": 2, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -10819,12 +10793,12 @@ }, { "name": "SupportedModes", - "code": 2, + "code": 1, "mfgCode": null, "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10835,7 +10809,7 @@ }, { "name": "CurrentMode", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "type": "int8u", @@ -10851,7 +10825,7 @@ }, { "name": "StartUpMode", - "code": 4, + "code": 3, "mfgCode": null, "side": "server", "type": "int8u", @@ -10867,7 +10841,7 @@ }, { "name": "OnMode", - "code": 5, + "code": 4, "mfgCode": null, "side": "server", "type": "int8u", @@ -10888,7 +10862,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10904,7 +10878,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10920,7 +10894,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10936,7 +10910,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10971,7 +10945,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10980,10 +10954,10 @@ ] }, { - "name": "Refrigerator And Temperature Controlled Cabinet Mode Select", + "name": "Refrigerator And Temperature Controlled Cabinet Mode", "code": 82, "mfgCode": null, - "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER", + "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER", "side": "client", "enabled": 1, "commands": [ @@ -10994,14 +10968,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -11015,7 +10981,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11031,7 +10997,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11040,16 +11006,16 @@ ] }, { - "name": "Refrigerator And Temperature Controlled Cabinet Mode Select", + "name": "Refrigerator And Temperature Controlled Cabinet Mode", "code": 82, "mfgCode": null, - "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER", + "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER", "side": "server", "enabled": 0, "commands": [ { "name": "ChangeToModeResponse", - "code": 2, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -11075,12 +11041,12 @@ }, { "name": "SupportedModes", - "code": 2, + "code": 1, "mfgCode": null, "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11091,7 +11057,7 @@ }, { "name": "CurrentMode", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "type": "int8u", @@ -11107,7 +11073,7 @@ }, { "name": "StartUpMode", - "code": 4, + "code": 3, "mfgCode": null, "side": "server", "type": "int8u", @@ -11123,7 +11089,7 @@ }, { "name": "OnMode", - "code": 5, + "code": 4, "mfgCode": null, "side": "server", "type": "int8u", @@ -11144,7 +11110,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11160,7 +11126,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11176,7 +11142,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11192,7 +11158,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11227,7 +11193,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11292,7 +11258,7 @@ "side": "server", "type": "array", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11356,7 +11322,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11372,7 +11338,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11388,7 +11354,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11404,7 +11370,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11448,10 +11414,10 @@ ] }, { - "name": "RVC Run Mode Select", + "name": "RVC Run Mode", "code": 84, "mfgCode": null, - "define": "RVC_RUN_MODE_SELECT_CLUSTER", + "define": "RVC_RUN_MODE_CLUSTER", "side": "client", "enabled": 1, "commands": [ @@ -11462,14 +11428,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -11483,7 +11441,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11499,7 +11457,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11508,16 +11466,16 @@ ] }, { - "name": "RVC Run Mode Select", + "name": "RVC Run Mode", "code": 84, "mfgCode": null, - "define": "RVC_RUN_MODE_SELECT_CLUSTER", + "define": "RVC_RUN_MODE_CLUSTER", "side": "server", "enabled": 0, "commands": [ { "name": "ChangeToModeResponse", - "code": 2, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -11543,12 +11501,12 @@ }, { "name": "SupportedModes", - "code": 2, + "code": 1, "mfgCode": null, "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11559,7 +11517,7 @@ }, { "name": "CurrentMode", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "type": "int8u", @@ -11575,7 +11533,7 @@ }, { "name": "StartUpMode", - "code": 4, + "code": 3, "mfgCode": null, "side": "server", "type": "int8u", @@ -11591,7 +11549,7 @@ }, { "name": "OnMode", - "code": 5, + "code": 4, "mfgCode": null, "side": "server", "type": "int8u", @@ -11612,7 +11570,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11628,7 +11586,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11644,7 +11602,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11660,7 +11618,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11695,7 +11653,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11704,10 +11662,10 @@ ] }, { - "name": "RVC Clean Mode Select", + "name": "RVC Clean Mode", "code": 85, "mfgCode": null, - "define": "RVC_CLEAN_MODE_SELECT_CLUSTER", + "define": "RVC_CLEAN_MODE_CLUSTER", "side": "client", "enabled": 1, "commands": [ @@ -11718,14 +11676,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -11739,7 +11689,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11755,7 +11705,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11764,16 +11714,16 @@ ] }, { - "name": "RVC Clean Mode Select", + "name": "RVC Clean Mode", "code": 85, "mfgCode": null, - "define": "RVC_CLEAN_MODE_SELECT_CLUSTER", + "define": "RVC_CLEAN_MODE_CLUSTER", "side": "server", "enabled": 0, "commands": [ { "name": "ChangeToModeResponse", - "code": 2, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -11799,12 +11749,12 @@ }, { "name": "SupportedModes", - "code": 2, + "code": 1, "mfgCode": null, "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11815,7 +11765,7 @@ }, { "name": "CurrentMode", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "type": "int8u", @@ -11831,7 +11781,7 @@ }, { "name": "StartUpMode", - "code": 4, + "code": 3, "mfgCode": null, "side": "server", "type": "int8u", @@ -11847,7 +11797,7 @@ }, { "name": "OnMode", - "code": 5, + "code": 4, "mfgCode": null, "side": "server", "type": "int8u", @@ -11868,7 +11818,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11884,7 +11834,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11900,7 +11850,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11916,7 +11866,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11951,7 +11901,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11966,16 +11916,6 @@ "define": "REFRIGERATOR_ALARM", "side": "client", "enabled": 1, - "commands": [ - { - "name": "Reset", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 - } - ], "attributes": [ { "name": "FeatureMap", @@ -12035,22 +11975,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "Latch", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "AlarmMap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "State", "code": 2, @@ -12166,10 +12090,10 @@ ] }, { - "name": "Dishwasher Mode Select", + "name": "Dishwasher Mode", "code": 89, "mfgCode": null, - "define": "DISHWASHER_MODE_SELECT_CLUSTER", + "define": "DISHWASHER_MODE_CLUSTER", "side": "client", "enabled": 1, "commands": [ @@ -12180,14 +12104,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -12201,7 +12117,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12217,7 +12133,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12226,16 +12142,16 @@ ] }, { - "name": "Dishwasher Mode Select", + "name": "Dishwasher Mode", "code": 89, "mfgCode": null, - "define": "DISHWASHER_MODE_SELECT_CLUSTER", + "define": "DISHWASHER_MODE_CLUSTER", "side": "server", "enabled": 0, "commands": [ { "name": "ChangeToModeResponse", - "code": 2, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -12261,12 +12177,12 @@ }, { "name": "SupportedModes", - "code": 2, + "code": 1, "mfgCode": null, "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12277,7 +12193,7 @@ }, { "name": "CurrentMode", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "type": "int8u", @@ -12293,7 +12209,7 @@ }, { "name": "StartUpMode", - "code": 4, + "code": 3, "mfgCode": null, "side": "server", "type": "int8u", @@ -12309,7 +12225,7 @@ }, { "name": "OnMode", - "code": 5, + "code": 4, "mfgCode": null, "side": "server", "type": "int8u", @@ -12330,7 +12246,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12346,7 +12262,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12362,7 +12278,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12378,7 +12294,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12413,7 +12329,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13179,6 +13095,310 @@ } ] }, + { + "name": "RVC Operational State", + "code": 97, + "mfgCode": null, + "define": "OPERATIONAL_STATE_RVC_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Pause", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Stop", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Start", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Operational State", + "code": 97, + "mfgCode": null, + "define": "OPERATIONAL_STATE_RVC_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "OperationalCommandResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "PhaseList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPhase", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CountdownTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalStateList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalState", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "OperationalStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalError", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "ErrorStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "OperationalError", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "OperationCompletion", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, { "name": "HEPA Filter Monitoring", "code": 113, diff --git a/src/controller/java/AndroidCallbacks.cpp b/src/controller/java/AndroidCallbacks.cpp index a84bd92f65fdea..e236aef95fc41a 100644 --- a/src/controller/java/AndroidCallbacks.cpp +++ b/src/controller/java/AndroidCallbacks.cpp @@ -367,7 +367,10 @@ void ReportCallback::OnEventData(const app::EventHeader & aEventHeader, TLV::TLV jobject value = DecodeEventValue(aEventHeader.mPath, readerForJavaObject, &err); // If we don't know this event, just skip it. - VerifyOrReturn(err != CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB); + if (err == CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB) + { + err = CHIP_NO_ERROR; + } VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(nullptr, eventPathObj, err)); VerifyOrReturn(!env->ExceptionCheck(), env->ExceptionDescribe(), ReportError(nullptr, eventPathObj, CHIP_JNI_ERROR_EXCEPTION_THROWN)); diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 054f59db9ed36c..6b462d85fd85be 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -272,6 +272,7 @@ kotlin_library("onboarding_payload") { "src/chip/onboardingpayload/OnboardingPayload.kt", "src/chip/onboardingpayload/OnboardingPayloadParser.kt", "src/chip/onboardingpayload/OptionalQRCodeInfo.kt", + "src/chip/onboardingpayload/VendorId.kt", "src/chip/onboardingpayload/Verhoeff.kt", "src/chip/onboardingpayload/Verhoeff10.kt", ] diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index f95bd3e9867c45..3cd260b9e1aaf9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -154,20 +154,20 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == ModeSelect.ID) { return new ModeSelect(); } - if (clusterId == LaundryWasherModeSelect.ID) { - return new LaundryWasherModeSelect(); + if (clusterId == LaundryWasherMode.ID) { + return new LaundryWasherMode(); } - if (clusterId == RefrigeratorAndTemperatureControlledCabinetModeSelect.ID) { - return new RefrigeratorAndTemperatureControlledCabinetModeSelect(); + if (clusterId == RefrigeratorAndTemperatureControlledCabinetMode.ID) { + return new RefrigeratorAndTemperatureControlledCabinetMode(); } if (clusterId == WasherControls.ID) { return new WasherControls(); } - if (clusterId == RvcRunModeSelect.ID) { - return new RvcRunModeSelect(); + if (clusterId == RvcRunMode.ID) { + return new RvcRunMode(); } - if (clusterId == RvcCleanModeSelect.ID) { - return new RvcCleanModeSelect(); + if (clusterId == RvcCleanMode.ID) { + return new RvcCleanMode(); } if (clusterId == TemperatureControl.ID) { return new TemperatureControl(); @@ -175,8 +175,8 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == RefrigeratorAlarm.ID) { return new RefrigeratorAlarm(); } - if (clusterId == DishwasherModeSelect.ID) { - return new DishwasherModeSelect(); + if (clusterId == DishwasherMode.ID) { + return new DishwasherMode(); } if (clusterId == AirQuality.ID) { return new AirQuality(); @@ -187,6 +187,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == OperationalState.ID) { return new OperationalState(); } + if (clusterId == RvcOperationalState.ID) { + return new RvcOperationalState(); + } if (clusterId == HepaFilterMonitoring.ID) { return new HepaFilterMonitoring(); } @@ -6250,8 +6253,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -6286,23 +6288,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -6333,18 +6318,17 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class LaundryWasherModeSelect implements BaseCluster { + public static class LaundryWasherMode implements BaseCluster { public static final long ID = 81L; public long getID() { return ID; } public enum Attribute { - Description(0L), - SupportedModes(2L), - CurrentMode(3L), - StartUpMode(4L), - OnMode(5L), + SupportedModes(0L), + CurrentMode(1L), + StartUpMode(2L), + OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -6391,8 +6375,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -6427,23 +6410,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -6474,18 +6440,17 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class RefrigeratorAndTemperatureControlledCabinetModeSelect implements BaseCluster { + public static class RefrigeratorAndTemperatureControlledCabinetMode implements BaseCluster { public static final long ID = 82L; public long getID() { return ID; } public enum Attribute { - Description(0L), - SupportedModes(2L), - CurrentMode(3L), - StartUpMode(4L), - OnMode(5L), + SupportedModes(0L), + CurrentMode(1L), + StartUpMode(2L), + OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -6532,8 +6497,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -6568,23 +6532,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -6719,18 +6666,17 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class RvcRunModeSelect implements BaseCluster { + public static class RvcRunMode implements BaseCluster { public static final long ID = 84L; public long getID() { return ID; } public enum Attribute { - Description(0L), - SupportedModes(2L), - CurrentMode(3L), - StartUpMode(4L), - OnMode(5L), + SupportedModes(0L), + CurrentMode(1L), + StartUpMode(2L), + OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -6777,8 +6723,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -6813,23 +6758,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -6860,18 +6788,17 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class RvcCleanModeSelect implements BaseCluster { + public static class RvcCleanMode implements BaseCluster { public static final long ID = 85L; public long getID() { return ID; } public enum Attribute { - Description(0L), - SupportedModes(2L), - CurrentMode(3L), - StartUpMode(4L), - OnMode(5L), + SupportedModes(0L), + CurrentMode(1L), + StartUpMode(2L), + OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -6918,8 +6845,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -6954,23 +6880,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -7228,18 +7137,17 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class DishwasherModeSelect implements BaseCluster { + public static class DishwasherMode implements BaseCluster { public static final long ID = 89L; public long getID() { return ID; } public enum Attribute { - Description(0L), - SupportedModes(2L), - CurrentMode(3L), - StartUpMode(4L), - OnMode(5L), + SupportedModes(0L), + CurrentMode(1L), + StartUpMode(2L), + OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -7286,8 +7194,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -7322,23 +7229,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -7706,6 +7596,118 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class RvcOperationalState implements BaseCluster { + public static final long ID = 97L; + public long getID() { + return ID; + } + + public enum Attribute { + PhaseList(0L), + CurrentPhase(1L), + CountdownTime(2L), + OperationalStateList(3L), + OperationalState(4L), + OperationalError(5L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event { + OperationalError(0L), + OperationCompletion(1L),; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + Pause(0L), + Stop(1L), + Start(2L), + Resume(3L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class HepaFilterMonitoring implements BaseCluster { public static final long ID = 113L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 40a742a4b047ad..3faa2661db449f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -6056,253 +6056,231 @@ private static Map readModeSelectInteractionInfo() { return result; } - private static Map readLaundryWasherModeSelectInteractionInfo() { - Map result = new LinkedHashMap<>();Map readLaundryWasherModeSelectDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectDescriptionAttributeInteractionInfo = new InteractionInfo( + private static Map readLaundryWasherModeInteractionInfo() { + Map result = new LinkedHashMap<>();Map readLaundryWasherModeSupportedModesCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeSupportedModesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readDescriptionAttribute( - (ChipClusters.CharStringAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readLaundryWasherModeSelectDescriptionCommandParams - ); - result.put("readDescriptionAttribute", readLaundryWasherModeSelectDescriptionAttributeInteractionInfo); - Map readLaundryWasherModeSelectSupportedModesCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectSupportedModesAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readSupportedModesAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.SupportedModesAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readSupportedModesAttribute( + (ChipClusters.LaundryWasherModeCluster.SupportedModesAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterSupportedModesAttributeCallback(), - readLaundryWasherModeSelectSupportedModesCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterSupportedModesAttributeCallback(), + readLaundryWasherModeSupportedModesCommandParams ); - result.put("readSupportedModesAttribute", readLaundryWasherModeSelectSupportedModesAttributeInteractionInfo); - Map readLaundryWasherModeSelectCurrentModeCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectCurrentModeAttributeInteractionInfo = new InteractionInfo( + result.put("readSupportedModesAttribute", readLaundryWasherModeSupportedModesAttributeInteractionInfo); + Map readLaundryWasherModeCurrentModeCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeCurrentModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readCurrentModeAttribute( + ((ChipClusters.LaundryWasherModeCluster) cluster).readCurrentModeAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readLaundryWasherModeSelectCurrentModeCommandParams + readLaundryWasherModeCurrentModeCommandParams ); - result.put("readCurrentModeAttribute", readLaundryWasherModeSelectCurrentModeAttributeInteractionInfo); - Map readLaundryWasherModeSelectStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentModeAttribute", readLaundryWasherModeCurrentModeAttributeInteractionInfo); + Map readLaundryWasherModeStartUpModeCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readStartUpModeAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.StartUpModeAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readStartUpModeAttribute( + (ChipClusters.LaundryWasherModeCluster.StartUpModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterStartUpModeAttributeCallback(), - readLaundryWasherModeSelectStartUpModeCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterStartUpModeAttributeCallback(), + readLaundryWasherModeStartUpModeCommandParams ); - result.put("readStartUpModeAttribute", readLaundryWasherModeSelectStartUpModeAttributeInteractionInfo); - Map readLaundryWasherModeSelectOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + result.put("readStartUpModeAttribute", readLaundryWasherModeStartUpModeAttributeInteractionInfo); + Map readLaundryWasherModeOnModeCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readOnModeAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.OnModeAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readOnModeAttribute( + (ChipClusters.LaundryWasherModeCluster.OnModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterOnModeAttributeCallback(), - readLaundryWasherModeSelectOnModeCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterOnModeAttributeCallback(), + readLaundryWasherModeOnModeCommandParams ); - result.put("readOnModeAttribute", readLaundryWasherModeSelectOnModeAttributeInteractionInfo); - Map readLaundryWasherModeSelectGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOnModeAttribute", readLaundryWasherModeOnModeAttributeInteractionInfo); + Map readLaundryWasherModeGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.LaundryWasherModeCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterGeneratedCommandListAttributeCallback(), - readLaundryWasherModeSelectGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterGeneratedCommandListAttributeCallback(), + readLaundryWasherModeGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readLaundryWasherModeSelectGeneratedCommandListAttributeInteractionInfo); - Map readLaundryWasherModeSelectAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readLaundryWasherModeGeneratedCommandListAttributeInteractionInfo); + Map readLaundryWasherModeAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.LaundryWasherModeCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterAcceptedCommandListAttributeCallback(), - readLaundryWasherModeSelectAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterAcceptedCommandListAttributeCallback(), + readLaundryWasherModeAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readLaundryWasherModeSelectAcceptedCommandListAttributeInteractionInfo); - Map readLaundryWasherModeSelectEventListCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readLaundryWasherModeAcceptedCommandListAttributeInteractionInfo); + Map readLaundryWasherModeEventListCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readEventListAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.EventListAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readEventListAttribute( + (ChipClusters.LaundryWasherModeCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterEventListAttributeCallback(), - readLaundryWasherModeSelectEventListCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterEventListAttributeCallback(), + readLaundryWasherModeEventListCommandParams ); - result.put("readEventListAttribute", readLaundryWasherModeSelectEventListAttributeInteractionInfo); - Map readLaundryWasherModeSelectAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readLaundryWasherModeEventListAttributeInteractionInfo); + Map readLaundryWasherModeAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readAttributeListAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.AttributeListAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readAttributeListAttribute( + (ChipClusters.LaundryWasherModeCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterAttributeListAttributeCallback(), - readLaundryWasherModeSelectAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterAttributeListAttributeCallback(), + readLaundryWasherModeAttributeListCommandParams ); - result.put("readAttributeListAttribute", readLaundryWasherModeSelectAttributeListAttributeInteractionInfo); - Map readLaundryWasherModeSelectFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readLaundryWasherModeAttributeListAttributeInteractionInfo); + Map readLaundryWasherModeFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.LaundryWasherModeCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readLaundryWasherModeSelectFeatureMapCommandParams + readLaundryWasherModeFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readLaundryWasherModeSelectFeatureMapAttributeInteractionInfo); - Map readLaundryWasherModeSelectClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readLaundryWasherModeFeatureMapAttributeInteractionInfo); + Map readLaundryWasherModeClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.LaundryWasherModeCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readLaundryWasherModeSelectClusterRevisionCommandParams + readLaundryWasherModeClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readLaundryWasherModeSelectClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readLaundryWasherModeClusterRevisionAttributeInteractionInfo); return result; } - private static Map readRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo() { - Map result = new LinkedHashMap<>();Map readRefrigeratorAndTemperatureControlledCabinetModeSelectDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectDescriptionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readDescriptionAttribute( - (ChipClusters.CharStringAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectDescriptionCommandParams - ); - result.put("readDescriptionAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectDescriptionAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeInteractionInfo = new InteractionInfo( + private static Map readRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo() { + Map result = new LinkedHashMap<>();Map readRefrigeratorAndTemperatureControlledCabinetModeSupportedModesCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readSupportedModesAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.SupportedModesAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readSupportedModesAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.SupportedModesAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterSupportedModesAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterSupportedModesAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeSupportedModesCommandParams ); - result.put("readSupportedModesAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectCurrentModeCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectCurrentModeAttributeInteractionInfo = new InteractionInfo( + result.put("readSupportedModesAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeCurrentModeCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeCurrentModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readCurrentModeAttribute( + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readCurrentModeAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectCurrentModeCommandParams + readRefrigeratorAndTemperatureControlledCabinetModeCurrentModeCommandParams ); - result.put("readCurrentModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectCurrentModeAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeCurrentModeAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeStartUpModeCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readStartUpModeAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.StartUpModeAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readStartUpModeAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.StartUpModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterStartUpModeAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterStartUpModeAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeStartUpModeCommandParams ); - result.put("readStartUpModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + result.put("readStartUpModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeOnModeCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readOnModeAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.OnModeAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readOnModeAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.OnModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterOnModeAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterOnModeAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeOnModeCommandParams ); - result.put("readOnModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOnModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterGeneratedCommandListAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterGeneratedCommandListAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterAcceptedCommandListAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterAcceptedCommandListAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectEventListCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeEventListCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readEventListAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.EventListAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readEventListAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterEventListAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectEventListCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterEventListAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeEventListCommandParams ); - result.put("readEventListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readAttributeListAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.AttributeListAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readAttributeListAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterAttributeListAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterAttributeListAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeAttributeListCommandParams ); - result.put("readAttributeListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectFeatureMapCommandParams + readRefrigeratorAndTemperatureControlledCabinetModeFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectFeatureMapAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readRefrigeratorAndTemperatureControlledCabinetModeFeatureMapAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectClusterRevisionCommandParams + readRefrigeratorAndTemperatureControlledCabinetModeClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readRefrigeratorAndTemperatureControlledCabinetModeClusterRevisionAttributeInteractionInfo); return result; } @@ -6420,253 +6398,231 @@ private static Map readWasherControlsInteractionInfo() return result; } - private static Map readRvcRunModeSelectInteractionInfo() { - Map result = new LinkedHashMap<>();Map readRvcRunModeSelectDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectDescriptionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readDescriptionAttribute( - (ChipClusters.CharStringAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readRvcRunModeSelectDescriptionCommandParams - ); - result.put("readDescriptionAttribute", readRvcRunModeSelectDescriptionAttributeInteractionInfo); - Map readRvcRunModeSelectSupportedModesCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectSupportedModesAttributeInteractionInfo = new InteractionInfo( + private static Map readRvcRunModeInteractionInfo() { + Map result = new LinkedHashMap<>();Map readRvcRunModeSupportedModesCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeSupportedModesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readSupportedModesAttribute( - (ChipClusters.RvcRunModeSelectCluster.SupportedModesAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readSupportedModesAttribute( + (ChipClusters.RvcRunModeCluster.SupportedModesAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterSupportedModesAttributeCallback(), - readRvcRunModeSelectSupportedModesCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterSupportedModesAttributeCallback(), + readRvcRunModeSupportedModesCommandParams ); - result.put("readSupportedModesAttribute", readRvcRunModeSelectSupportedModesAttributeInteractionInfo); - Map readRvcRunModeSelectCurrentModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectCurrentModeAttributeInteractionInfo = new InteractionInfo( + result.put("readSupportedModesAttribute", readRvcRunModeSupportedModesAttributeInteractionInfo); + Map readRvcRunModeCurrentModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeCurrentModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readCurrentModeAttribute( + ((ChipClusters.RvcRunModeCluster) cluster).readCurrentModeAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRvcRunModeSelectCurrentModeCommandParams + readRvcRunModeCurrentModeCommandParams ); - result.put("readCurrentModeAttribute", readRvcRunModeSelectCurrentModeAttributeInteractionInfo); - Map readRvcRunModeSelectStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentModeAttribute", readRvcRunModeCurrentModeAttributeInteractionInfo); + Map readRvcRunModeStartUpModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readStartUpModeAttribute( - (ChipClusters.RvcRunModeSelectCluster.StartUpModeAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readStartUpModeAttribute( + (ChipClusters.RvcRunModeCluster.StartUpModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterStartUpModeAttributeCallback(), - readRvcRunModeSelectStartUpModeCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterStartUpModeAttributeCallback(), + readRvcRunModeStartUpModeCommandParams ); - result.put("readStartUpModeAttribute", readRvcRunModeSelectStartUpModeAttributeInteractionInfo); - Map readRvcRunModeSelectOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + result.put("readStartUpModeAttribute", readRvcRunModeStartUpModeAttributeInteractionInfo); + Map readRvcRunModeOnModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readOnModeAttribute( - (ChipClusters.RvcRunModeSelectCluster.OnModeAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readOnModeAttribute( + (ChipClusters.RvcRunModeCluster.OnModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterOnModeAttributeCallback(), - readRvcRunModeSelectOnModeCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterOnModeAttributeCallback(), + readRvcRunModeOnModeCommandParams ); - result.put("readOnModeAttribute", readRvcRunModeSelectOnModeAttributeInteractionInfo); - Map readRvcRunModeSelectGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOnModeAttribute", readRvcRunModeOnModeAttributeInteractionInfo); + Map readRvcRunModeGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.RvcRunModeSelectCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.RvcRunModeCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterGeneratedCommandListAttributeCallback(), - readRvcRunModeSelectGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterGeneratedCommandListAttributeCallback(), + readRvcRunModeGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readRvcRunModeSelectGeneratedCommandListAttributeInteractionInfo); - Map readRvcRunModeSelectAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readRvcRunModeGeneratedCommandListAttributeInteractionInfo); + Map readRvcRunModeAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.RvcRunModeSelectCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.RvcRunModeCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterAcceptedCommandListAttributeCallback(), - readRvcRunModeSelectAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterAcceptedCommandListAttributeCallback(), + readRvcRunModeAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readRvcRunModeSelectAcceptedCommandListAttributeInteractionInfo); - Map readRvcRunModeSelectEventListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readRvcRunModeAcceptedCommandListAttributeInteractionInfo); + Map readRvcRunModeEventListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readEventListAttribute( - (ChipClusters.RvcRunModeSelectCluster.EventListAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readEventListAttribute( + (ChipClusters.RvcRunModeCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterEventListAttributeCallback(), - readRvcRunModeSelectEventListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterEventListAttributeCallback(), + readRvcRunModeEventListCommandParams ); - result.put("readEventListAttribute", readRvcRunModeSelectEventListAttributeInteractionInfo); - Map readRvcRunModeSelectAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readRvcRunModeEventListAttributeInteractionInfo); + Map readRvcRunModeAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readAttributeListAttribute( - (ChipClusters.RvcRunModeSelectCluster.AttributeListAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readAttributeListAttribute( + (ChipClusters.RvcRunModeCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterAttributeListAttributeCallback(), - readRvcRunModeSelectAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterAttributeListAttributeCallback(), + readRvcRunModeAttributeListCommandParams ); - result.put("readAttributeListAttribute", readRvcRunModeSelectAttributeListAttributeInteractionInfo); - Map readRvcRunModeSelectFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readRvcRunModeAttributeListAttributeInteractionInfo); + Map readRvcRunModeFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.RvcRunModeCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readRvcRunModeSelectFeatureMapCommandParams + readRvcRunModeFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readRvcRunModeSelectFeatureMapAttributeInteractionInfo); - Map readRvcRunModeSelectClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readRvcRunModeFeatureMapAttributeInteractionInfo); + Map readRvcRunModeClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.RvcRunModeCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRvcRunModeSelectClusterRevisionCommandParams + readRvcRunModeClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readRvcRunModeSelectClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readRvcRunModeClusterRevisionAttributeInteractionInfo); return result; } - private static Map readRvcCleanModeSelectInteractionInfo() { - Map result = new LinkedHashMap<>();Map readRvcCleanModeSelectDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectDescriptionAttributeInteractionInfo = new InteractionInfo( + private static Map readRvcCleanModeInteractionInfo() { + Map result = new LinkedHashMap<>();Map readRvcCleanModeSupportedModesCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeSupportedModesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readDescriptionAttribute( - (ChipClusters.CharStringAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readSupportedModesAttribute( + (ChipClusters.RvcCleanModeCluster.SupportedModesAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readRvcCleanModeSelectDescriptionCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterSupportedModesAttributeCallback(), + readRvcCleanModeSupportedModesCommandParams ); - result.put("readDescriptionAttribute", readRvcCleanModeSelectDescriptionAttributeInteractionInfo); - Map readRvcCleanModeSelectSupportedModesCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectSupportedModesAttributeInteractionInfo = new InteractionInfo( + result.put("readSupportedModesAttribute", readRvcCleanModeSupportedModesAttributeInteractionInfo); + Map readRvcCleanModeCurrentModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeCurrentModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readSupportedModesAttribute( - (ChipClusters.RvcCleanModeSelectCluster.SupportedModesAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterSupportedModesAttributeCallback(), - readRvcCleanModeSelectSupportedModesCommandParams - ); - result.put("readSupportedModesAttribute", readRvcCleanModeSelectSupportedModesAttributeInteractionInfo); - Map readRvcCleanModeSelectCurrentModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectCurrentModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readCurrentModeAttribute( + ((ChipClusters.RvcCleanModeCluster) cluster).readCurrentModeAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRvcCleanModeSelectCurrentModeCommandParams + readRvcCleanModeCurrentModeCommandParams ); - result.put("readCurrentModeAttribute", readRvcCleanModeSelectCurrentModeAttributeInteractionInfo); - Map readRvcCleanModeSelectStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentModeAttribute", readRvcCleanModeCurrentModeAttributeInteractionInfo); + Map readRvcCleanModeStartUpModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readStartUpModeAttribute( - (ChipClusters.RvcCleanModeSelectCluster.StartUpModeAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readStartUpModeAttribute( + (ChipClusters.RvcCleanModeCluster.StartUpModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterStartUpModeAttributeCallback(), - readRvcCleanModeSelectStartUpModeCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterStartUpModeAttributeCallback(), + readRvcCleanModeStartUpModeCommandParams ); - result.put("readStartUpModeAttribute", readRvcCleanModeSelectStartUpModeAttributeInteractionInfo); - Map readRvcCleanModeSelectOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + result.put("readStartUpModeAttribute", readRvcCleanModeStartUpModeAttributeInteractionInfo); + Map readRvcCleanModeOnModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readOnModeAttribute( - (ChipClusters.RvcCleanModeSelectCluster.OnModeAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readOnModeAttribute( + (ChipClusters.RvcCleanModeCluster.OnModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterOnModeAttributeCallback(), - readRvcCleanModeSelectOnModeCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterOnModeAttributeCallback(), + readRvcCleanModeOnModeCommandParams ); - result.put("readOnModeAttribute", readRvcCleanModeSelectOnModeAttributeInteractionInfo); - Map readRvcCleanModeSelectGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOnModeAttribute", readRvcCleanModeOnModeAttributeInteractionInfo); + Map readRvcCleanModeGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.RvcCleanModeSelectCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.RvcCleanModeCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterGeneratedCommandListAttributeCallback(), - readRvcCleanModeSelectGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterGeneratedCommandListAttributeCallback(), + readRvcCleanModeGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readRvcCleanModeSelectGeneratedCommandListAttributeInteractionInfo); - Map readRvcCleanModeSelectAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readRvcCleanModeGeneratedCommandListAttributeInteractionInfo); + Map readRvcCleanModeAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.RvcCleanModeSelectCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.RvcCleanModeCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterAcceptedCommandListAttributeCallback(), - readRvcCleanModeSelectAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterAcceptedCommandListAttributeCallback(), + readRvcCleanModeAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readRvcCleanModeSelectAcceptedCommandListAttributeInteractionInfo); - Map readRvcCleanModeSelectEventListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readRvcCleanModeAcceptedCommandListAttributeInteractionInfo); + Map readRvcCleanModeEventListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readEventListAttribute( - (ChipClusters.RvcCleanModeSelectCluster.EventListAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readEventListAttribute( + (ChipClusters.RvcCleanModeCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterEventListAttributeCallback(), - readRvcCleanModeSelectEventListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterEventListAttributeCallback(), + readRvcCleanModeEventListCommandParams ); - result.put("readEventListAttribute", readRvcCleanModeSelectEventListAttributeInteractionInfo); - Map readRvcCleanModeSelectAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readRvcCleanModeEventListAttributeInteractionInfo); + Map readRvcCleanModeAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readAttributeListAttribute( - (ChipClusters.RvcCleanModeSelectCluster.AttributeListAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readAttributeListAttribute( + (ChipClusters.RvcCleanModeCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterAttributeListAttributeCallback(), - readRvcCleanModeSelectAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterAttributeListAttributeCallback(), + readRvcCleanModeAttributeListCommandParams ); - result.put("readAttributeListAttribute", readRvcCleanModeSelectAttributeListAttributeInteractionInfo); - Map readRvcCleanModeSelectFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readRvcCleanModeAttributeListAttributeInteractionInfo); + Map readRvcCleanModeFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.RvcCleanModeCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readRvcCleanModeSelectFeatureMapCommandParams + readRvcCleanModeFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readRvcCleanModeSelectFeatureMapAttributeInteractionInfo); - Map readRvcCleanModeSelectClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readRvcCleanModeFeatureMapAttributeInteractionInfo); + Map readRvcCleanModeClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.RvcCleanModeCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRvcCleanModeSelectClusterRevisionCommandParams + readRvcCleanModeClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readRvcCleanModeSelectClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readRvcCleanModeClusterRevisionAttributeInteractionInfo); return result; } @@ -6898,128 +6854,117 @@ private static Map readRefrigeratorAlarmInteractionInfo return result; } - private static Map readDishwasherModeSelectInteractionInfo() { - Map result = new LinkedHashMap<>();Map readDishwasherModeSelectDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectDescriptionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readDescriptionAttribute( - (ChipClusters.CharStringAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readDishwasherModeSelectDescriptionCommandParams - ); - result.put("readDescriptionAttribute", readDishwasherModeSelectDescriptionAttributeInteractionInfo); - Map readDishwasherModeSelectSupportedModesCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectSupportedModesAttributeInteractionInfo = new InteractionInfo( + private static Map readDishwasherModeInteractionInfo() { + Map result = new LinkedHashMap<>();Map readDishwasherModeSupportedModesCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeSupportedModesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readSupportedModesAttribute( - (ChipClusters.DishwasherModeSelectCluster.SupportedModesAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readSupportedModesAttribute( + (ChipClusters.DishwasherModeCluster.SupportedModesAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterSupportedModesAttributeCallback(), - readDishwasherModeSelectSupportedModesCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterSupportedModesAttributeCallback(), + readDishwasherModeSupportedModesCommandParams ); - result.put("readSupportedModesAttribute", readDishwasherModeSelectSupportedModesAttributeInteractionInfo); - Map readDishwasherModeSelectCurrentModeCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectCurrentModeAttributeInteractionInfo = new InteractionInfo( + result.put("readSupportedModesAttribute", readDishwasherModeSupportedModesAttributeInteractionInfo); + Map readDishwasherModeCurrentModeCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeCurrentModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readCurrentModeAttribute( + ((ChipClusters.DishwasherModeCluster) cluster).readCurrentModeAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readDishwasherModeSelectCurrentModeCommandParams + readDishwasherModeCurrentModeCommandParams ); - result.put("readCurrentModeAttribute", readDishwasherModeSelectCurrentModeAttributeInteractionInfo); - Map readDishwasherModeSelectStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentModeAttribute", readDishwasherModeCurrentModeAttributeInteractionInfo); + Map readDishwasherModeStartUpModeCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readStartUpModeAttribute( - (ChipClusters.DishwasherModeSelectCluster.StartUpModeAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readStartUpModeAttribute( + (ChipClusters.DishwasherModeCluster.StartUpModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterStartUpModeAttributeCallback(), - readDishwasherModeSelectStartUpModeCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterStartUpModeAttributeCallback(), + readDishwasherModeStartUpModeCommandParams ); - result.put("readStartUpModeAttribute", readDishwasherModeSelectStartUpModeAttributeInteractionInfo); - Map readDishwasherModeSelectOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + result.put("readStartUpModeAttribute", readDishwasherModeStartUpModeAttributeInteractionInfo); + Map readDishwasherModeOnModeCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readOnModeAttribute( - (ChipClusters.DishwasherModeSelectCluster.OnModeAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readOnModeAttribute( + (ChipClusters.DishwasherModeCluster.OnModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterOnModeAttributeCallback(), - readDishwasherModeSelectOnModeCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterOnModeAttributeCallback(), + readDishwasherModeOnModeCommandParams ); - result.put("readOnModeAttribute", readDishwasherModeSelectOnModeAttributeInteractionInfo); - Map readDishwasherModeSelectGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOnModeAttribute", readDishwasherModeOnModeAttributeInteractionInfo); + Map readDishwasherModeGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.DishwasherModeSelectCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.DishwasherModeCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterGeneratedCommandListAttributeCallback(), - readDishwasherModeSelectGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterGeneratedCommandListAttributeCallback(), + readDishwasherModeGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readDishwasherModeSelectGeneratedCommandListAttributeInteractionInfo); - Map readDishwasherModeSelectAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readDishwasherModeGeneratedCommandListAttributeInteractionInfo); + Map readDishwasherModeAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.DishwasherModeSelectCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.DishwasherModeCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterAcceptedCommandListAttributeCallback(), - readDishwasherModeSelectAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterAcceptedCommandListAttributeCallback(), + readDishwasherModeAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readDishwasherModeSelectAcceptedCommandListAttributeInteractionInfo); - Map readDishwasherModeSelectEventListCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readDishwasherModeAcceptedCommandListAttributeInteractionInfo); + Map readDishwasherModeEventListCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readEventListAttribute( - (ChipClusters.DishwasherModeSelectCluster.EventListAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readEventListAttribute( + (ChipClusters.DishwasherModeCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterEventListAttributeCallback(), - readDishwasherModeSelectEventListCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterEventListAttributeCallback(), + readDishwasherModeEventListCommandParams ); - result.put("readEventListAttribute", readDishwasherModeSelectEventListAttributeInteractionInfo); - Map readDishwasherModeSelectAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readDishwasherModeEventListAttributeInteractionInfo); + Map readDishwasherModeAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readAttributeListAttribute( - (ChipClusters.DishwasherModeSelectCluster.AttributeListAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readAttributeListAttribute( + (ChipClusters.DishwasherModeCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterAttributeListAttributeCallback(), - readDishwasherModeSelectAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterAttributeListAttributeCallback(), + readDishwasherModeAttributeListCommandParams ); - result.put("readAttributeListAttribute", readDishwasherModeSelectAttributeListAttributeInteractionInfo); - Map readDishwasherModeSelectFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readDishwasherModeAttributeListAttributeInteractionInfo); + Map readDishwasherModeFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.DishwasherModeCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readDishwasherModeSelectFeatureMapCommandParams + readDishwasherModeFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readDishwasherModeSelectFeatureMapAttributeInteractionInfo); - Map readDishwasherModeSelectClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readDishwasherModeFeatureMapAttributeInteractionInfo); + Map readDishwasherModeClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.DishwasherModeCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readDishwasherModeSelectClusterRevisionCommandParams + readDishwasherModeClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readDishwasherModeSelectClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readDishwasherModeClusterRevisionAttributeInteractionInfo); return result; } @@ -7420,6 +7365,120 @@ private static Map readOperationalStateInteractionInfo( return result; } + private static Map readRvcOperationalStateInteractionInfo() { + Map result = new LinkedHashMap<>();Map readRvcOperationalStatePhaseListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStatePhaseListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RvcOperationalStateCluster) cluster).readPhaseListAttribute( + (ChipClusters.RvcOperationalStateCluster.PhaseListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterPhaseListAttributeCallback(), + readRvcOperationalStatePhaseListCommandParams + ); + result.put("readPhaseListAttribute", readRvcOperationalStatePhaseListAttributeInteractionInfo); + Map readRvcOperationalStateCurrentPhaseCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateCurrentPhaseAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RvcOperationalStateCluster) cluster).readCurrentPhaseAttribute( + (ChipClusters.RvcOperationalStateCluster.CurrentPhaseAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterCurrentPhaseAttributeCallback(), + readRvcOperationalStateCurrentPhaseCommandParams + ); + result.put("readCurrentPhaseAttribute", readRvcOperationalStateCurrentPhaseAttributeInteractionInfo); + Map readRvcOperationalStateCountdownTimeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateCountdownTimeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RvcOperationalStateCluster) cluster).readCountdownTimeAttribute( + (ChipClusters.RvcOperationalStateCluster.CountdownTimeAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterCountdownTimeAttributeCallback(), + readRvcOperationalStateCountdownTimeCommandParams + ); + result.put("readCountdownTimeAttribute", readRvcOperationalStateCountdownTimeAttributeInteractionInfo); + Map readRvcOperationalStateOperationalStateListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateOperationalStateListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RvcOperationalStateCluster) cluster).readOperationalStateListAttribute( + (ChipClusters.RvcOperationalStateCluster.OperationalStateListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterOperationalStateListAttributeCallback(), + readRvcOperationalStateOperationalStateListCommandParams + ); + result.put("readOperationalStateListAttribute", readRvcOperationalStateOperationalStateListAttributeInteractionInfo); + Map readRvcOperationalStateGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RvcOperationalStateCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.RvcOperationalStateCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterGeneratedCommandListAttributeCallback(), + readRvcOperationalStateGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readRvcOperationalStateGeneratedCommandListAttributeInteractionInfo); + Map readRvcOperationalStateAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RvcOperationalStateCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.RvcOperationalStateCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterAcceptedCommandListAttributeCallback(), + readRvcOperationalStateAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readRvcOperationalStateAcceptedCommandListAttributeInteractionInfo); + Map readRvcOperationalStateEventListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RvcOperationalStateCluster) cluster).readEventListAttribute( + (ChipClusters.RvcOperationalStateCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterEventListAttributeCallback(), + readRvcOperationalStateEventListCommandParams + ); + result.put("readEventListAttribute", readRvcOperationalStateEventListAttributeInteractionInfo); + Map readRvcOperationalStateAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RvcOperationalStateCluster) cluster).readAttributeListAttribute( + (ChipClusters.RvcOperationalStateCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterAttributeListAttributeCallback(), + readRvcOperationalStateAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readRvcOperationalStateAttributeListAttributeInteractionInfo); + Map readRvcOperationalStateFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RvcOperationalStateCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readRvcOperationalStateFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readRvcOperationalStateFeatureMapAttributeInteractionInfo); + Map readRvcOperationalStateClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RvcOperationalStateCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readRvcOperationalStateClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readRvcOperationalStateClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readHepaFilterMonitoringInteractionInfo() { Map result = new LinkedHashMap<>();Map readHepaFilterMonitoringConditionCommandParams = new LinkedHashMap(); InteractionInfo readHepaFilterMonitoringConditionAttributeInteractionInfo = new InteractionInfo( @@ -23211,17 +23270,18 @@ public Map> getReadAttributeMap() { put("booleanState", readBooleanStateInteractionInfo()); put("icdManagement", readIcdManagementInteractionInfo()); put("modeSelect", readModeSelectInteractionInfo()); - put("laundryWasherModeSelect", readLaundryWasherModeSelectInteractionInfo()); - put("refrigeratorAndTemperatureControlledCabinetModeSelect", readRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo()); + put("laundryWasherMode", readLaundryWasherModeInteractionInfo()); + put("refrigeratorAndTemperatureControlledCabinetMode", readRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo()); put("washerControls", readWasherControlsInteractionInfo()); - put("rvcRunModeSelect", readRvcRunModeSelectInteractionInfo()); - put("rvcCleanModeSelect", readRvcCleanModeSelectInteractionInfo()); + put("rvcRunMode", readRvcRunModeInteractionInfo()); + put("rvcCleanMode", readRvcCleanModeInteractionInfo()); put("temperatureControl", readTemperatureControlInteractionInfo()); put("refrigeratorAlarm", readRefrigeratorAlarmInteractionInfo()); - put("dishwasherModeSelect", readDishwasherModeSelectInteractionInfo()); + put("dishwasherMode", readDishwasherModeInteractionInfo()); put("airQuality", readAirQualityInteractionInfo()); put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo()); put("operationalState", readOperationalStateInteractionInfo()); + put("rvcOperationalState", readRvcOperationalStateInteractionInfo()); put("hepaFilterMonitoring", readHepaFilterMonitoringInteractionInfo()); put("activatedCarbonFilterMonitoring", readActivatedCarbonFilterMonitoringInteractionInfo()); put("ceramicFilterMonitoring", readCeramicFilterMonitoringInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 3028e3525125f5..a3e32eb5a39671 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -770,98 +770,98 @@ public Map> getWriteAttributeMap() { ); writeModeSelectInteractionInfo.put("writeOnModeAttribute", writeModeSelectOnModeAttributeInteractionInfo); writeAttributeMap.put("modeSelect", writeModeSelectInteractionInfo); - Map writeLaundryWasherModeSelectInteractionInfo = new LinkedHashMap<>(); - Map writeLaundryWasherModeSelectStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo laundryWasherModeSelectstartUpModeCommandParameterInfo = + Map writeLaundryWasherModeInteractionInfo = new LinkedHashMap<>(); + Map writeLaundryWasherModeStartUpModeCommandParams = new LinkedHashMap(); + CommandParameterInfo laundryWasherModestartUpModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeLaundryWasherModeSelectStartUpModeCommandParams.put( + writeLaundryWasherModeStartUpModeCommandParams.put( "value", - laundryWasherModeSelectstartUpModeCommandParameterInfo + laundryWasherModestartUpModeCommandParameterInfo ); - InteractionInfo writeLaundryWasherModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeLaundryWasherModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).writeStartUpModeAttribute( + ((ChipClusters.LaundryWasherModeCluster) cluster).writeStartUpModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeLaundryWasherModeSelectStartUpModeCommandParams + writeLaundryWasherModeStartUpModeCommandParams ); - writeLaundryWasherModeSelectInteractionInfo.put("writeStartUpModeAttribute", writeLaundryWasherModeSelectStartUpModeAttributeInteractionInfo); - Map writeLaundryWasherModeSelectOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo laundryWasherModeSelectonModeCommandParameterInfo = + writeLaundryWasherModeInteractionInfo.put("writeStartUpModeAttribute", writeLaundryWasherModeStartUpModeAttributeInteractionInfo); + Map writeLaundryWasherModeOnModeCommandParams = new LinkedHashMap(); + CommandParameterInfo laundryWasherModeonModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeLaundryWasherModeSelectOnModeCommandParams.put( + writeLaundryWasherModeOnModeCommandParams.put( "value", - laundryWasherModeSelectonModeCommandParameterInfo + laundryWasherModeonModeCommandParameterInfo ); - InteractionInfo writeLaundryWasherModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeLaundryWasherModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).writeOnModeAttribute( + ((ChipClusters.LaundryWasherModeCluster) cluster).writeOnModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeLaundryWasherModeSelectOnModeCommandParams + writeLaundryWasherModeOnModeCommandParams ); - writeLaundryWasherModeSelectInteractionInfo.put("writeOnModeAttribute", writeLaundryWasherModeSelectOnModeAttributeInteractionInfo); - writeAttributeMap.put("laundryWasherModeSelect", writeLaundryWasherModeSelectInteractionInfo); - Map writeRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo = new LinkedHashMap<>(); - Map writeRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModeSelectstartUpModeCommandParameterInfo = + writeLaundryWasherModeInteractionInfo.put("writeOnModeAttribute", writeLaundryWasherModeOnModeAttributeInteractionInfo); + writeAttributeMap.put("laundryWasherMode", writeLaundryWasherModeInteractionInfo); + Map writeRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo = new LinkedHashMap<>(); + Map writeRefrigeratorAndTemperatureControlledCabinetModeStartUpModeCommandParams = new LinkedHashMap(); + CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModestartUpModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeCommandParams.put( + writeRefrigeratorAndTemperatureControlledCabinetModeStartUpModeCommandParams.put( "value", - refrigeratorAndTemperatureControlledCabinetModeSelectstartUpModeCommandParameterInfo + refrigeratorAndTemperatureControlledCabinetModestartUpModeCommandParameterInfo ); - InteractionInfo writeRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).writeStartUpModeAttribute( + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).writeStartUpModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeCommandParams + writeRefrigeratorAndTemperatureControlledCabinetModeStartUpModeCommandParams ); - writeRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo.put("writeStartUpModeAttribute", writeRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeInteractionInfo); - Map writeRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModeSelectonModeCommandParameterInfo = + writeRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo.put("writeStartUpModeAttribute", writeRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeInteractionInfo); + Map writeRefrigeratorAndTemperatureControlledCabinetModeOnModeCommandParams = new LinkedHashMap(); + CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModeonModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeCommandParams.put( + writeRefrigeratorAndTemperatureControlledCabinetModeOnModeCommandParams.put( "value", - refrigeratorAndTemperatureControlledCabinetModeSelectonModeCommandParameterInfo + refrigeratorAndTemperatureControlledCabinetModeonModeCommandParameterInfo ); - InteractionInfo writeRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).writeOnModeAttribute( + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).writeOnModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeCommandParams + writeRefrigeratorAndTemperatureControlledCabinetModeOnModeCommandParams ); - writeRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo.put("writeOnModeAttribute", writeRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeInteractionInfo); - writeAttributeMap.put("refrigeratorAndTemperatureControlledCabinetModeSelect", writeRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo); + writeRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo.put("writeOnModeAttribute", writeRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeInteractionInfo); + writeAttributeMap.put("refrigeratorAndTemperatureControlledCabinetMode", writeRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo); Map writeWasherControlsInteractionInfo = new LinkedHashMap<>(); Map writeWasherControlsSpinSpeedCurrentCommandParams = new LinkedHashMap(); CommandParameterInfo washerControlsspinSpeedCurrentCommandParameterInfo = @@ -908,148 +908,148 @@ public Map> getWriteAttributeMap() { ); writeWasherControlsInteractionInfo.put("writeNumberOfRinsesAttribute", writeWasherControlsNumberOfRinsesAttributeInteractionInfo); writeAttributeMap.put("washerControls", writeWasherControlsInteractionInfo); - Map writeRvcRunModeSelectInteractionInfo = new LinkedHashMap<>(); - Map writeRvcRunModeSelectStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcRunModeSelectstartUpModeCommandParameterInfo = + Map writeRvcRunModeInteractionInfo = new LinkedHashMap<>(); + Map writeRvcRunModeStartUpModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcRunModestartUpModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRvcRunModeSelectStartUpModeCommandParams.put( + writeRvcRunModeStartUpModeCommandParams.put( "value", - rvcRunModeSelectstartUpModeCommandParameterInfo + rvcRunModestartUpModeCommandParameterInfo ); - InteractionInfo writeRvcRunModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRvcRunModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).writeStartUpModeAttribute( + ((ChipClusters.RvcRunModeCluster) cluster).writeStartUpModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRvcRunModeSelectStartUpModeCommandParams + writeRvcRunModeStartUpModeCommandParams ); - writeRvcRunModeSelectInteractionInfo.put("writeStartUpModeAttribute", writeRvcRunModeSelectStartUpModeAttributeInteractionInfo); - Map writeRvcRunModeSelectOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcRunModeSelectonModeCommandParameterInfo = + writeRvcRunModeInteractionInfo.put("writeStartUpModeAttribute", writeRvcRunModeStartUpModeAttributeInteractionInfo); + Map writeRvcRunModeOnModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcRunModeonModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRvcRunModeSelectOnModeCommandParams.put( + writeRvcRunModeOnModeCommandParams.put( "value", - rvcRunModeSelectonModeCommandParameterInfo + rvcRunModeonModeCommandParameterInfo ); - InteractionInfo writeRvcRunModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRvcRunModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).writeOnModeAttribute( + ((ChipClusters.RvcRunModeCluster) cluster).writeOnModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRvcRunModeSelectOnModeCommandParams + writeRvcRunModeOnModeCommandParams ); - writeRvcRunModeSelectInteractionInfo.put("writeOnModeAttribute", writeRvcRunModeSelectOnModeAttributeInteractionInfo); - writeAttributeMap.put("rvcRunModeSelect", writeRvcRunModeSelectInteractionInfo); - Map writeRvcCleanModeSelectInteractionInfo = new LinkedHashMap<>(); - Map writeRvcCleanModeSelectStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcCleanModeSelectstartUpModeCommandParameterInfo = + writeRvcRunModeInteractionInfo.put("writeOnModeAttribute", writeRvcRunModeOnModeAttributeInteractionInfo); + writeAttributeMap.put("rvcRunMode", writeRvcRunModeInteractionInfo); + Map writeRvcCleanModeInteractionInfo = new LinkedHashMap<>(); + Map writeRvcCleanModeStartUpModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcCleanModestartUpModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRvcCleanModeSelectStartUpModeCommandParams.put( + writeRvcCleanModeStartUpModeCommandParams.put( "value", - rvcCleanModeSelectstartUpModeCommandParameterInfo + rvcCleanModestartUpModeCommandParameterInfo ); - InteractionInfo writeRvcCleanModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRvcCleanModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).writeStartUpModeAttribute( + ((ChipClusters.RvcCleanModeCluster) cluster).writeStartUpModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRvcCleanModeSelectStartUpModeCommandParams + writeRvcCleanModeStartUpModeCommandParams ); - writeRvcCleanModeSelectInteractionInfo.put("writeStartUpModeAttribute", writeRvcCleanModeSelectStartUpModeAttributeInteractionInfo); - Map writeRvcCleanModeSelectOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcCleanModeSelectonModeCommandParameterInfo = + writeRvcCleanModeInteractionInfo.put("writeStartUpModeAttribute", writeRvcCleanModeStartUpModeAttributeInteractionInfo); + Map writeRvcCleanModeOnModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcCleanModeonModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRvcCleanModeSelectOnModeCommandParams.put( + writeRvcCleanModeOnModeCommandParams.put( "value", - rvcCleanModeSelectonModeCommandParameterInfo + rvcCleanModeonModeCommandParameterInfo ); - InteractionInfo writeRvcCleanModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRvcCleanModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).writeOnModeAttribute( + ((ChipClusters.RvcCleanModeCluster) cluster).writeOnModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRvcCleanModeSelectOnModeCommandParams + writeRvcCleanModeOnModeCommandParams ); - writeRvcCleanModeSelectInteractionInfo.put("writeOnModeAttribute", writeRvcCleanModeSelectOnModeAttributeInteractionInfo); - writeAttributeMap.put("rvcCleanModeSelect", writeRvcCleanModeSelectInteractionInfo); + writeRvcCleanModeInteractionInfo.put("writeOnModeAttribute", writeRvcCleanModeOnModeAttributeInteractionInfo); + writeAttributeMap.put("rvcCleanMode", writeRvcCleanModeInteractionInfo); Map writeTemperatureControlInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("temperatureControl", writeTemperatureControlInteractionInfo); Map writeRefrigeratorAlarmInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("refrigeratorAlarm", writeRefrigeratorAlarmInteractionInfo); - Map writeDishwasherModeSelectInteractionInfo = new LinkedHashMap<>(); - Map writeDishwasherModeSelectStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo dishwasherModeSelectstartUpModeCommandParameterInfo = + Map writeDishwasherModeInteractionInfo = new LinkedHashMap<>(); + Map writeDishwasherModeStartUpModeCommandParams = new LinkedHashMap(); + CommandParameterInfo dishwasherModestartUpModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeDishwasherModeSelectStartUpModeCommandParams.put( + writeDishwasherModeStartUpModeCommandParams.put( "value", - dishwasherModeSelectstartUpModeCommandParameterInfo + dishwasherModestartUpModeCommandParameterInfo ); - InteractionInfo writeDishwasherModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeDishwasherModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).writeStartUpModeAttribute( + ((ChipClusters.DishwasherModeCluster) cluster).writeStartUpModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeDishwasherModeSelectStartUpModeCommandParams + writeDishwasherModeStartUpModeCommandParams ); - writeDishwasherModeSelectInteractionInfo.put("writeStartUpModeAttribute", writeDishwasherModeSelectStartUpModeAttributeInteractionInfo); - Map writeDishwasherModeSelectOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo dishwasherModeSelectonModeCommandParameterInfo = + writeDishwasherModeInteractionInfo.put("writeStartUpModeAttribute", writeDishwasherModeStartUpModeAttributeInteractionInfo); + Map writeDishwasherModeOnModeCommandParams = new LinkedHashMap(); + CommandParameterInfo dishwasherModeonModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeDishwasherModeSelectOnModeCommandParams.put( + writeDishwasherModeOnModeCommandParams.put( "value", - dishwasherModeSelectonModeCommandParameterInfo + dishwasherModeonModeCommandParameterInfo ); - InteractionInfo writeDishwasherModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeDishwasherModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).writeOnModeAttribute( + ((ChipClusters.DishwasherModeCluster) cluster).writeOnModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeDishwasherModeSelectOnModeCommandParams + writeDishwasherModeOnModeCommandParams ); - writeDishwasherModeSelectInteractionInfo.put("writeOnModeAttribute", writeDishwasherModeSelectOnModeAttributeInteractionInfo); - writeAttributeMap.put("dishwasherModeSelect", writeDishwasherModeSelectInteractionInfo); + writeDishwasherModeInteractionInfo.put("writeOnModeAttribute", writeDishwasherModeOnModeAttributeInteractionInfo); + writeAttributeMap.put("dishwasherMode", writeDishwasherModeInteractionInfo); Map writeAirQualityInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("airQuality", writeAirQualityInteractionInfo); Map writeSmokeCoAlarmInteractionInfo = new LinkedHashMap<>(); @@ -1078,6 +1078,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("smokeCoAlarm", writeSmokeCoAlarmInteractionInfo); Map writeOperationalStateInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("operationalState", writeOperationalStateInteractionInfo); + Map writeRvcOperationalStateInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("rvcOperationalState", writeRvcOperationalStateInteractionInfo); Map writeHepaFilterMonitoringInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("hepaFilterMonitoring", writeHepaFilterMonitoringInteractionInfo); Map writeActivatedCarbonFilterMonitoringInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt b/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt index a8432a36d474aa..23b9b2fa35b3b0 100644 --- a/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt +++ b/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt @@ -64,6 +64,20 @@ const val kCommissioningTimeoutTag = 0x04 const val kSetupPINCodeMaximumValue = 99999998 const val kSetupPINCodeUndefinedValue = 0 +const val kTotalPayloadDataSizeInBits: Int = + kVersionFieldLengthInBits + + kVendorIDFieldLengthInBits + + kProductIDFieldLengthInBits + + kCommissioningFlowFieldLengthInBits + + kRendezvousInfoFieldLengthInBits + + kPayloadDiscriminatorFieldLengthInBits + + kSetupPINCodeFieldLengthInBits + + kPaddingFieldLengthInBits + +const val kTotalPayloadDataSizeInBytes: Int = kTotalPayloadDataSizeInBits / 8 + +const val kQRCodePrefix = "MT:" + /** Class to hold the data from the scanned QR code or Manual Pairing Code. */ class OnboardingPayload( /** Version info of the OnboardingPayload: version SHALL be 0 */ @@ -102,711 +116,6 @@ class OnboardingPayload( ) { var optionalQRCodeInfo: HashMap - // code="0x0000" is defined as "Matter Standard" in the official CSA alliance manufacturer ID database - // and is treated as invalid in Matter SDK. - enum class VendorId(val value: Int) { - UNSPECIFIED(0x0000), - PANASONIC(0x0001), - SONY(0x0002), - SAMSUNG(0x0003), - PHILIPS(0x0004), - FREESCALE_RF(0x0005), - OKI_SEMICONDUCTORS(0x0006), - TEXAS_INSTRUMENTS(0x0007), - CIRRONET(0x1000), - CHIPCON(0x1001), - EMBER(0x1002), - NTS(0x1003), - FREESCALE(0x1004), - IP_COM(0x1005), - SAN_JUAN_SOFTWARE(0x1006), - TUV(0x1007), - INTEGRATION(0x1008), - BM_SPA(0x1009), - AWAREPOINT(0x100A), - SIGNIFY_NETHERLANDS(0x100B), - LUXOFT(0x100C), - KORWIN(0x100D), - ONE_RF_TECHNOLOGY(0x100E), - SOFTWARE_TECHNOLOGIES_GROUP(0x100F), - TELEGESIS(0x1010), - VISONIC(0x1011), - INSTA(0x1012), - ATALUM(0x1013), - ATMEL(0x1014), - DEVELCO(0x1015), - HONEYWELL(0x1016), - RADIOPULSE(0x1017), - RENESAS(0x1018), - XANADU_WIRELESS(0x1019), - NEC_ENGINEERING(0x101A), - YAMATAKE_CORPORATION(0x101B), - TENDRIL_NETWORKS(0x101C), - ASSA_ABLOY(0x101D), - MAXSTREAM(0x101E), - NEUROCOM(0x101F), - INSTITUTE_FOR_INFORMATION_INDUSTRY(0x1020), - LEGRAND_GROUP(0x1021), - ICONTROL(0x1022), - RAYMARINE(0x1023), - LS_RESEARCH(0x1024), - ONITY_INC(0x1025), - MONO_PRODUCTS(0x1026), - RF_TECHNOLOGIES(0x1027), - ITRON(0x1028), - TRITECH(0x1029), - EMBEDIT_AS(0x102A), - S3C(0x102B), - SIEMENS(0x102C), - MINDTECH(0x102D), - LG_ELECTRONICS(0x102E), - MITSUBISHI_ELECTRIC_CORP(0x102F), - JOHNSON_CONTROLS(0x1030), - SECURE_METERS_UK_LTD(0x1031), - KNICK(0x1032), - VICONICS(0x1033), - FLEXIPANEL(0x1034), - PIASIM_CORPORATION_PTE_LTD(0x1035), - TRANE(0x1036), - NXP_SEMICONDUCTORS(0x1037), - LIVING_INDEPENDENTLY_GROUP(0x1038), - ALERTME_COM(0x1039), - DAINTREE(0x103A), - AIJI_SYSTEM(0x103B), - TELECOM_ITALIA(0x103C), - MIKROKRETS_AS(0x103D), - OKI_SEMICONDUCTOR(0x103E), - NEWPORT_ELECTONICS(0x103F), - CONTROL_4(0x1040), - STMICROELECTRONICS(0x1041), - AD_SOL_NISSIN_CORP(0x1042), - DCSI(0x1043), - FRANCE_TELECOM(0x1044), - MUNET(0x1045), - AUTANI_CORPORATION(0x1046), - COLORADO_VNET(0x1047), - AEROCOMM_INC(0x1048), - SILICON_LABORATORIES(0x1049), - INNCOM_INTERNATIONAL_INC(0x104A), - COOPER_POWER_SYSTEMS(0x104B), - SYNAPSE(0x104C), - FISHER_PIERCE_SUNRISE(0x104D), - CENTRALITE_SYSTEMS_INC(0x104E), - CRANE_WIRELESS_MONITORING_SOLUTIONS(0x104F), - MOBILARM_LIMITED(0x1050), - IMONITOR_RESEARCH_LTD(0x1051), - BARTECH(0x1052), - MESHNETICS(0x1053), - LS_INDUSTRIAL_SYSTEMS(0x1054), - CASON_ENGINEERING(0x1055), - WIRELESS_GLUE_NETWORKS(0x1056), - ELSTER(0x1057), - SMS_TECNOLOGIA_ELETRONICA(0x1058), - ONSET_COMPUTER_CORPORATION(0x1059), - RIGA_DEVELOPMENT(0x105A), - ENERGATE(0x105B), - CONMED_LINVATEC(0x105C), - POWERMAND(0x105D), - SCHNEIDER_ELECTRIC(0x105E), - EATON_CORPORATION(0x105F), - TELULAR_CORPORATION(0x1060), - DELPHI_MEDICAL_SYSTEMS(0x1061), - EPISENSOR_LIMITED(0x1062), - LANDIS_GYR(0x1063), - KABA_GROUP(0x1064), - SHURE_INCORPORATED(0x1065), - COMVERGE_INC(0x1066), - DBS_LODGING_TECHNOLOGIES(0x1067), - ENERGY_AWARE_TECHNOLOGY(0x1068), - HIDALGO_LIMITED(0x1069), - AIR2APP(0x106A), - AMX(0x106B), - EDMI_PTY_LTD(0x106C), - CYAN_LTD(0x106D), - SYSTEM_SPA(0x106E), - TELIT(0x106F), - KAGA_ELECTRONICS(0x1070), - ASTREL_GROUP(0x1071), - CERTICOM(0x1072), - GRIDPOINT(0x1073), - PROFILE_SYSTEMS(0x1074), - COMPACTA_INTERNATIONAL(0x1075), - FREESTYLE_TECHNOLOGY(0x1076), - ALEKTRONA(0x1077), - COMPUTIME(0x1078), - REMOTE_TECHNOLOGIES_INC(0x1079), - WAVECOM_SA(0x107A), - ENERGY_OPTIMIZERS(0x107B), - GE(0x107C), - JETLUN(0x107D), - CIPHER_SYSTEMS(0x107E), - CORPORATE_SYSTEMS_ENGINEERING(0x107F), - ECOBEE(0x1080), - SMK(0x1081), - MESHWORKS_WIRELESS(0x1082), - ELLIPS_BV(0x1083), - SECURE_ELECTRANS(0x1084), - CEDO(0x1085), - TOSHIBA(0x1086), - DIGI_INTERNATIONAL(0x1087), - UBILogix(0x1088), - ECHELON(0x1089), - GREEN_ENERGY_OPTIONS(0x1090), - SILVER_SPRING_NETWORKS(0x1091), - BLACK_AND_DECKER(0x1092), - AZTECH_ASSOCIATES_INC(0x1093), - A_AND_D_CO_LTD(0x1094), - RAINFOREST_AUTOMATION(0x1095), - CARRIER_ELECTRONICS(0x1096), - SYCHIP_MURATA(0x1097), - OPENPEAK(0x1098), - PASSIVE_SYSTEMS(0x1099), - MMB_RESEARCH(0x109A), - LEVITON_MANUFACTURING_COMPANY(0x109B), - KOREA_ELECTRIC_POWER_DATA_NETWORK_CO(0x109C), - COMCAST(0x109D), - NEC_ELECTRONICS(0x109E), - NETVOX(0x109F), - U_CONTROL(0x10A0), - EMBEDIA_TECHNOLOGIES_CORP(0x10A1), - SENSUS(0x10A2), - SUNRISE_TECHNOLOGIES(0x10A3), - MEMTECH_CORP(0x10A4), - FREEBOX(0x10A5), - M2_LABS_LTD(0x10A6), - BRITISH_GAS(0x10A7), - SENTEC_LTD(0x10A8), - NAVETAS(0x10A9), - LIGHTSPEED_TECHNOLOGIES(0x10AA), - OKI_ELECTRIC_INDUSTRY_CO(0x10AB), - S_I_SISTEMAS_INTELIGENTES_ELETRONICOS(0x10AC), - DOMETIC(0x10AD), - ALPS(0x10AE), - ENERGYHUB(0x10AF), - KAMSTRUP(0x10B0), - ECHOSTAR(0x10B1), - ENERNOC(0x10B2), - ELTAV(0x10B3), - BELKIN(0x10B4), - XSTREAMHD_WIRELESS_VENTURES(0x10B5), - SATURN_SOUTH_PTY_LTD(0x10B6), - GREENTRAPOLINE_A_S(0x10B7), - SMARTSYNCH_INC(0x10B8), - NYCE_CONTROL_INC(0x10B9), - ICM_CONTROLS_CORP(0x10BA), - MILLENNIUM_ELECTRONICS_PTY_LTD(0x10BB), - MOTOROLA_INC(0x10BC), - EMERSON_WHITE_RODGERS(0x10BD), - RADIO_THERMOSTAT_COMPANY_OF_AMERICA(0x10BE), - OMRON_CORPORATION(0x10BF), - GIINII_GLOBAL_LIMITED(0x10C0), - FUJITSU_GENERAL_LIMITED(0x10C1), - PEEL_TECHNOLOGIES_INC(0x10C2), - ACCENT_SPA(0x10C3), - BYTESNAP_DESIGN_LTD(0x10C4), - NEC_TOKIN_CORPORATION(0x10C5), - G4S_JUSTICE_SERVICES(0x10C6), - TRILLIANT_NETWORKS_INC(0x10C7), - ELECTROLUX_ITALIA_SPA(0x10C8), - ONZO_LTD(0x10C9), - ENTEK_SYSTEMS(0x10CA), - MAINSTREAM_ENGINEERING(0x10CC), - INDESIT_COMPANY(0x10CD), - THINKECO_INC(0x10CE), - D2C_INC(0x10CF), - QORVO(0x10D0), - INTERCEL(0x10D1), - MITSUMI_ELECTRIC_CO_LTD(0x10D3), - MITSUMI_ELECTRIC_CO_LTD_2(0x10D4), - ZENTRUM_MIKROELEKTRONIK_DRESDEN_AG(0x10D5), - NEST_LABS_INC(0x10D6), - EXEGIN_TECHNOLOGIES_LTD(0x10D7), - TAKAHATA_PRECISION_CO(0x10D9), - SUMITOMO_ELECTRIC_NETWORKS_INC(0x10DA), - GE_ENERGY(0x10DB), - GE_APPLIANCES(0x10DC), - RADIOCRAFTS_AS(0x10DD), - CEIVA(0x10DE), - TEC_AND_CO_CO_LTD(0x10DF), - CHAMELEON_TECHNOLOGY_UK_LTD(0x10E0), - RUWIDO_AUSTRIA_GMBH(0x10E2), - HUAWEI_TECHNOLOGIES_CO(0x10E3), - HUAWEI_TECHNOLOGIES_CO_2(0x10E4), - GREENWAVE_REALITY(0x10E5), - BGLOBAL_METERING_LTD(0x10E6), - MINDTECK(0x10E7), - INGERSOLL_RAND(0x10E8), - DIUS_COMPUTING_PTY_LTD(0x10E9), - EMBEDDED_AUTOMATION_INC(0x10EA), - ABB(0x10EB), - GENUS_POWER_INFRASTRUCTURES_LIMITED(0x10ED), - UNIVERSAL_ELECTRONICS_INC(0x10EE), - UNIVERSAL_ELECTRONICS_INC_2(0x10EF), - METRUM_TECHNOLOGIES_LLC(0x10F0), - CISCO(0x10F1), - UBISYS_TECHNOLOGIES_GMBH(0x10F2), - CONSERT(0x10F3), - CRESTRON_ELECTRONICS(0x10F4), - ENPHASE_ENERGY(0x10F5), - INVENSYS_CONTROLS(0x10F6), - MUELLER_SYSTEMS_LLC(0x10F7), - AAC_TECHNOLOGIES_HOLDING(0x10F8), - U_NEXT_CO(0x10F9), - STEELCASE_INC(0x10FA), - TELEMATICS_WIRELESS(0x10FB), - SAMIL_POWER_CO(0x10FC), - PACE_PLC(0x10FD), - OSBORNE_COINAGE_CO(0x10FE), - POWERWATCH(0x10FF), - CANDELED_GMBH(0x1100), - FLEXGRID_SRL(0x1101), - HUMAX(0x1102), - UNIVERSAL_DEVICES(0x1103), - ADVANCED_ENERGY(0x1104), - BEGA_GANTENBRINK_LEUCHTEN(0x1105), - BRUNEL_UNIVERSITY(0x1106), - PANASONIC_RD_CENTER_SINGAPORE(0x1107), - ESYSTEMS_RESEARCH(0x1108), - PANAMAX(0x1109), - SMARTTHINGS_INC(0x110A), - EM_LITE_LTD(0x110B), - OSRAM_SYLVANIA(0x110C), - SAVE_ENERGY_LTD(0x110D), - PLANET_INNOVATION_PRODUCTS_PTY_LTD(0x110E), - AMBIENT_DEVICES_INC(0x110F), - PROFALUX(0x1110), - BILLION_ELECTRIC_COMPANY(0x1111), - EMBERTEC_PTY_LTD(0x1112), - IT_WATCHDOGS(0x1113), - RELOC(0x1114), - INTEL_CORPORATION(0x1115), - TREND_ELECTRONICS_LIMITED(0x1116), - MOXA(0x1117), - QEES(0x1118), - SAYME_WIRELESS_SENSOR_NETWORKS(0x1119), - PENTAIR_AQUATIC_SYSTEMS(0x111A), - ORBIT_IRRIGATION(0x111B), - CALIFORNIA_EASTERN_LABORATORIES(0x111C), - IDT_TECHNOLOGY_LIMITED(0x111E), - PIXELA_CORPORATION(0x111F), - TIVO_INC(0x1120), - FIDURE_CORP(0x1121), - MARVELL_SEMICONDUCTOR_INC(0x1122), - WASION_GROUP_LIMITED(0x1123), - JASCO_PRODUCTS_COMPANY(0x1124), - SHENZHEN_KAIFA_TECHNOLOGY(0x1125), - NETCOMM_WIRELESS_LIMITED(0x1126), - DEFINE_INSTRUMENTS_LIMITED(0x1127), - IN_HOME_DISPLAYS_LTD(0x1128), - MIELE_AND_CIE_KG(0x1129), - TELEVES_SA(0x112A), - LABELEC(0x112B), - CHINA_ELECTRONICS_STANDARDIZATION_INSTITUTE(0x112C), - VECTORFORM_LLC(0x112D), - BUSCH_JAEGER_ELEKTRO(0x112E), - REDPINE_SIGNALS_INC(0x112F), - BRIDGES_ELECTRONIC_TECHNOLOGY_PTY_LTD(0x1130), - SERCOMM(0x1131), - WSH_GMBH_WIRSINDHELLER(0x1132), - BOSCH_SECURITY_SYSTEMS_INC(0x1133), - EZEX_CORPORATION(0x1134), - DRESDEN_ELEKTRONIK_INGENIEURTECHNIK_GMBH(0x1135), - MEAZON_SA(0x1136), - CROW_ELECTRONIC_ENGINEERING_LTD(0x1137), - HARVARD_ENGINEERING_PLC(0x1138), - ANDSON_BEIJING_TECHNOLOGY(0x1139), - ADHOCO_AG(0x113A), - WAXMAN_CONSUMER_PRODUCTS_GROUP_INC(0x113B), - OWON_TECHNOLOGY_INC(0x113C), - HITRON_TECHNOLOGIES_INC(0x113D), - SCEMTEC_HARD_UND_SOFTWARE(0x113E), - WEBEE_LLC(0x113F), - GRID2HOME_INC(0x1140), - TELINK_MICRO(0x1141), - JASMINE_SYSTEMS_INC(0x1142), - BIDGELY(0x1143), - LUTRON(0x1144), - IJENKO(0x1145), - STARFIELD_ELECTRONIC_LTD(0x1146), - TCP_INC(0x1147), - ROGERS_COMMUNICATIONS_PARTNERSHIP(0x1148), - CREE_INC(0x1149), - ROBERT_BOSCH_LLC(0x114A), - IBIS_NETWORKS_INC(0x114B), - QUIRKY_INC(0x114C), - EFERGY_TECHNOLOGIES_LIMITED(0x114D), - SMARTLABS_INC(0x114E), - EVERSPRING_INDUSTRY_CO_LTD(0x114F), - SWANN_COMMUNICATIONS_PTL_LTD(0x1150), - SONETER(0x1151), - SAMSUNG_SDS(0x1152), - UNIBAND_ELECTRONIC_CORPORATION(0x1153), - ACCTON_TECHNOLOGY_CORPORATION(0x1154), - BOSCH_THERMOTECHNIK_GMBH(0x1155), - WINCOR_NIXDORF_INC(0x1156), - OHSUNG_ELECTRONICS(0x1157), - ZEN_WITHIN_INC(0x1158), - TECH4HOME_LDA(0x1159), - NANOLEAF(0x115A), - KEEN_HOME_INC(0x115B), - POLY_CONTROL_APS(0x115C), - EASTFIELD_LIGHTING_CO_LTD_SHENZHEN(0x115D), - IP_DATATEL_INC(0x115E), - LUMI_UNITED_TECHOLOGY_LTD_SHENZHEN(0x115F), - SENGLED_CO_LTD(0x1160), - REMOTE_SOLUTION_CO_LTD(0x1161), - ABB_GENWAY_XIAMEN_ELECTRICAL_EQUIPMENT_CO(0x1162), - ZHEJIANG_REXENSE_TECH(0x1163), - FOREE_TECHNOLOGY(0x1164), - OPEN_ACCESS_TECHNOLOGY_INTL(0x1165), - INNR_LIGHTING_BV(0x1166), - TECHWORLD_INDUSTRIES(0x1167), - LEEDARSON_LIGHTING_CO_LTD(0x1168), - ARZEL_ZONING(0x1169), - HOLLEY_TECHNOLOGY(0x116A), - BELDON_TECHNOLOGIES(0x116B), - FLEXTRONICS(0x116C), - SHENZHEN_MEIAN(0x116D), - LOWES(0x116E), - SIGMA_CONNECTIVITY(0x116F), - WULIAN(0x1171), - PLUGWISE_BV(0x1172), - TITAN_PRODUCTS(0x1173), - ECOSPECTRAL(0x1174), - D_LINK(0x1175), - TECHNICOLOR_HOME_USA(0x1176), - OPPLE_LIGHTING(0x1177), - WISTRON_NEWEB_CORP(0x1178), - QMOTION_SHADES(0x1179), - INSTA_GMBH(0x117A), - SHANGHAI_VANCOUNT(0x117B), - IKEA_OF_SWEDEN(0x117C), - RT_RK(0x117D), - SHENZHEN_FEIBIT(0x117E), - EUCONTROLS(0x117F), - TELKONET(0x1180), - THERMAL_SOLUTION_RESOURCES(0x1181), - POMCUBE(0x1182), - EI_ELECTRONICS(0x1183), - OPTOGA(0x1184), - STELPRO(0x1185), - LYNXUS_TECHNOLOGIES_CORP(0x1186), - SEMICONDUCTOR_COMPONENTS(0x1187), - TP_LINK(0x1188), - LEDVANCE_GMBH(0x1189), - NORTEK(0x118A), - IREVO_ASSA_ABBLOY_KOREA(0x118B), - MIDEA(0x118C), - ZF_FRIEDRICHSHAFEN(0x118D), - CHECKIT(0x118E), - ACLARA(0x118F), - NOKIA(0x1190), - GOLDCARD_HIGH_TECH_CO(0x1191), - GEORGE_WILSON_INDUSTRIES_LTD(0x1192), - EASY_SAVER_CO_INC(0x1193), - ZTE_CORPORATION(0x1194), - ARRIS(0x1195), - RELIANCE_BIG_TV(0x1196), - INSIGHT_ENERGY_VENTURES_POWERLEY(0x1197), - THOMAS_RESEARCH_PRODUCTS(0x1198), - LI_SENG_TECHNOLOGY(0x1199), - SYSTEM_LEVEL_SOLUTIONS_INC(0x119A), - MATRIX_LABS(0x119B), - SINOPE_TECHNOLOGIES(0x119C), - JIUZHOU_GREEBLE(0x119D), - GUANGZHOU_LANVEE_TECH_CO_LTD(0x119E), - VENSTAR(0x119F), - SLV(0x1200), - HALO_SMART_LABS(0x1201), - SCOUT_SECURITY_INC(0x1202), - ALIBABA_CHINA_INC(0x1203), - RESOLUTION_PRODUCTS_INC(0x1204), - SMARTLOK_INC(0x1205), - LUX_PRODUCTS_CORP(0x1206), - VIMAR_SPA(0x1207), - UNIVERSAL_LIGHTING_TECHNOLOGIES(0x1208), - ROBERT_BOSCH_GMBH(0x1209), - ACCENTURE(0x120A), - HEIMAN_TECHNOLOGY_CO(0x120B), - SHENZHEN_HOMA_TECHNOLOGY_CO(0x120C), - VISION_ELECTRONICS_TECHNOLOGY(0x120D), - LENOVO(0x120E), - PRESCIENSE_RD(0x120F), - SHENZHEN_SEASTAR_INTELLIGENCE_CO(0x1210), - SENSATIVE_AB(0x1211), - SOLAREDGE(0x1212), - ZIPATO(0x1213), - CHINA_FIRE_SECURITY_SENSING_MANUFACTURING(0x1214), - QUBY_BV(0x1215), - HANGZHOU_ROOMBANKER_TECHNOLOGY_CO(0x1216), - AMAZON_LAB126(0x1217), - PAULMANN_LICHT_GMBH(0x1218), - SHENZHEN_ORVIBO_ELECTRONICS_CO_LTD(0x1219), - TCI_TELECOMMUNICATIONS(0x121A), - MUELLER_LICHT_INTERNATIONAL_INC(0x121B), - AURORA_LIMITED(0x121C), - SMARTDCC(0x121D), - SHANGHAI_UMEINFO_CO_LTD(0x121E), - CARBONTRACK(0x121F), - SOMFY(0x1220), - VIESSMANN_ELEKTRONIK_GMBH(0x1221), - HILDEBRAND_TECHNOLOGY_LTD(0x1222), - ONKYO_TECHNOLOGY_CORPORATION(0x1223), - SHENZHEN_SUNRICHER_TECHNOLOGY_LTD(0x1224), - XIU_XIU_TECHNOLOGY_CO_LTD(0x1225), - ZUMTOBEL_GROUP(0x1226), - SHENZHEN_KAADAS_INTELLIGENT_TECHNOLOGY_CO_LTD(0x1227), - SHANGHAI_XIAOYAN_TECHNOLOGY_CO_LTD(0x1228), - CYPRESS_SEMICONDUCTOR(0x1229), - XAL_GMBH(0x122A), - INERGY_SYSTEMS_LLC(0x122B), - ALFRED_KARCHER_GMBH_CO_KG(0x122C), - ADUROLIGHT_MANUFACTURING(0x122D), - GROUPE_MULLER(0x122E), - V_MARK_ENTERPRISES_INC(0x122F), - LEAD_ENERGY_AG(0x1230), - ULTIMATE_IOT_HENAN_TECHNOLOGY_LTD(0x1231), - AXXESS_INDUSTRIES_INC(0x1232), - THIRD_REALITY_INC(0x1233), - DSR_CORPORATION(0x1234), - GUANGZHOU_VENSI_INTELLIGENT_TECHNOLOGY(0x1235), - SCHLAGE_LOCK_ALLEGION(0x1236), - NET2GRID(0x1237), - AIRAM_ELECTRIC_OY_AB(0x1238), - IMMAX_WPB_CZ(0x1239), - ZIV_AUTOMATION(0x123A), - HANGZHOU_IMAGICTECHNOLOGY(0x123B), - XIAMEN_LEELEN_TECHNOLOGY(0x123C), - OVERKIZ_SAS(0x123D), - FLONIDAN_A_S(0x123E), - HDL_AUTOMATION(0x123F), - ARDOMUS_NETWORKS_CORPORATION(0x1240), - SAMJIN_CO_LTD(0x1241), - FIREANGEL_SAFETY_TECHNOLOGY(0x1242), - INDRA_SISTEMAS_SA(0x1243), - SHENZHEN_JBT_SMART_LIGHTING(0x1244), - GE_LIGHTING_CURRENT(0x1245), - DANFOSS_A_S(0x1246), - NIVISS_PHP_SP_Z_O_O_SP_K(0x1247), - SHENZHEN_FENGLIYUAN_ENERGY_CONSERVATING_TECHNOLOGY(0x1248), - NEXELEC(0x1249), - SICHUAN_BEHOME_PROMINENT_TECHNOLOGY(0x124A), - FUJIAN_STAR_NET_COMMUNICATION(0x124B), - TOSHIBA_VISUAL_SOLUTIONS_CORPORATION(0x124C), - LATCHABLE_INC(0x124D), - L_S_DEUTSCHLAND_GMBH(0x124E), - GLEDOPTO_CO_LTD(0x124F), - THE_HOME_DEPOT(0x1250), - NEONLITE_DISTRIBUTION_LIMITED(0x1251), - ARLO_TECHNOLOGIES_INC(0x1252), - XINGLUO_TECHNOLOGY_CO_LTD(0x1253), - SIMON_ELECTRIC_CHINA_CO_LTD(0x1254), - HANGZHOU_GREATSTAR_INDUSTRIAL_CO_LTD(0x1255), - SEQUENTRIC_ENERGY_SYSTEMS_LLC(0x1256), - SOLUM_CO_LTD(0x1257), - EAGLERISE_ELECTRIC_ELECTRONIC_CHINA_CO_LTD(0x1258), - FANTEM_TECHNOLOGIES_SHENZHEN_CO_LTD(0x1259), - YUNDING_NETWORK_TECHNOLOGY_BEIJING_CO_LTD(0x125A), - ATLANTIC_GROUP(0x125B), - XIAMEN_INTRETECH_INC(0x125C), - TUYA_GLOBAL_INC(0x125D), - DNAKE_XIAMEN_INTELLIGENT_TECHNOLOGY(0x125E), - NIKO_NV(0x125F), - EMPORIA_ENERGY(0x1260), - SIKOM_AS(0x1261), - AXIS_LABS_INC(0x1262), - CURRENT_PRODUCTS_CORPORATION(0x1263), - METERSIT_SRL(0x1264), - HORNBACH_BAUMARKT_AG(0x1265), - DICEWORLD_S_R_L_A_SOCIO_UNICO(0x1266), - ARC_TECHNOLOGY_CO_LTD(0x1267), - HANGZHOU_KONKE_INFORMATION_TECHNOLOGY(0x1268), - SALTO_SYSTEMS_SL(0x1269), - SHENZHEN_SHYUGJ_TECHNOLOGY(0x126A), - BRAYDEN_AUTOMATION_CORPORATION(0x126B), - ENVIRONEXUS_PTY_LTD(0x126C), - ELTRA_NV_SA(0x126D), - XIAOMI_COMMUNICATIONS_CO_LTD(0x126E), - SHANGHAI_SHUNCOM_ELECTRONIC_TECHNOLOGY(0x126F), - VOLTALIS_SA(0x1270), - FEELUX_CO_LTD(0x1271), - SMARTPLUS_INC(0x1272), - HALEMEIER_GMBH(0x1273), - TRUST_INTERNATIONAL_BV(0x1274), - DUKE_ENERGY_BUSINESS_SERVICES_LLC(0x1275), - CALIX_INC(0x1276), - ADEO(0x1277), - CONNECTED_RESPONSE_LIMITED(0x1278), - STROYENERGOKOM_LTD(0x1279), - LUMITECH_LIGHTING_SOLUTION_GMBH(0x127A), - VERDANT_ENVIRONMENTAL_TECHNOLOGIES(0x127B), - ALFRED_INTERNATIONAL_INC(0x127C), - ANSI_LED_LIGHTING_CO_LTD(0x127D), - MINDTREE_LIMITED(0x127E), - NORDIC_SEMICONDUCTOR_ASA(0x127F), - SITERWELL_ELECTRONICS_CO_LIMITED(0x1280), - BRILONER_LEUCHTEN_GMBH(0x1281), - SHENZHEN_SEI_TECHNOLOGY_CO_LTD(0x1282), - COPPER_LABS_INC(0x1283), - DELTA_DORE(0x1284), - HAGER_GROUP(0x1285), - SHENZHEN_COOLKIT_TECHNOLOGY_CO_LTD(0x1286), - HANGZHOU_SKY_LIGHTING_CO_LTD(0x1287), - E_ON_SE(0x1288), - LIDL_STIFTUNG_CO_KG(0x1289), - SICHUAN_CHANGHONG_NETWORK_TECHNOLOGIES(0x128A), - NODON(0x128B), - JIANGXI_INNOTECH_TECHNOLOGY_CO_LTD(0x128C), - MERCATOR_PTY_LTD(0x128D), - BEIJING_RUYING_TECH_LIMITED(0x128E), - EGLO_LEUCHTEN_GMBH(0x128F), - PIETRO_FIORENTINI_SPA(0x1290), - ZEHNDER_GROUP_VAUX_ANDIGNY(0x1291), - BRK_BRANDS_INC(0x1292), - ASKEY_COMPUTER_CORP(0x1293), - PASSIVEBOLT_INC(0x1294), - AVM_AUDIOVISUELLES_MARKETING_UND_COMPUTERSYSTEME_BERLIN(0x1295), - NINGBO_SUNTECH_LIGHTING_TECHNOLOGY_CO_LTD(0x1296), - SOCIETE_EN_COMMANDITE_STELLO(0x1297), - VIVINT_SMART_HOME(0x1298), - NAMRON_AS(0x1299), - RADEMACHER_GERATE_ELEKTRONIK_GMBH(0x129A), - OMO_SYSTEMS_LTD(0x129B), - SIGLIS_AG(0x129C), - IMHOTEP_CREATION(0x129D), - ICASA(0x129E), - LEVEL_HOME_INC(0x129F), - TIS_CONTROL_LIMITED(0x1300), - RADISYS_INDIA_PVT_LTD(0x1301), - VEEA_INC(0x1302), - FELL_TECHNOLOGY_AS(0x1303), - SOWILO_DESIGN_SERVICES_LTD(0x1304), - LEXI_DEVICES_INC(0x1305), - LIFI_LABS_INC_DBA_LIFX(0x1306), - GRUNDFOS_HOLDING_AS(0x1307), - SOURCING_AND_CREATION(0x1308), - KRAKEN_TECHNOLOGIES_LTD(0x1309), - EVE_SYSTEMS(0x130A), - LITE_ON_TECHNOLOGY_CORPORATION(0x130B), - FOCALCREST_LIMITED(0x130C), - BOUFFALO_LAB_NANJING_CO_LTD(0x130D), - WYZE_LABS_INC(0x130E), - Z_WAVE_EUROPE_GMBH(0x130F), - AEOTEC_LIMITED(0x1310), - NGSTB_COMPANY_LIMITED(0x1311), - QINGDAO_YEELINK_INFORMATION_TECHNOLOGY_CO_LTD(0x1312), - E_SMART_HOME_AUTOMATION_SYSTEMS_LIMITED(0x1313), - FIBAR_GROUP_SA(0x1314), - PROLITECH_GMBH(0x1315), - PANKORE_INTEGRATED_CIRCUIT_TECHNOLOGY_CO_LTD(0x1316), - LOGITECH(0x1317), - PIARO_INC(0x1318), - MITSUBISHI_ELECTRIC_US_INC(0x1319), - RESIDEO_TECHNOLOGIES_INC(0x131A), - ESPRESSIF_SYSTEMS_SHANGHAI_CO_LTD(0x131B), - HELLA_SONNEN_UND_WETTERSCHUTZTECHNIK_GMBH(0x131C), - GEBERIT_INTERNATIONAL_AG(0x131D), - CAME_SPA(0x131E), - GUANGZHOU_ELITE_EDUCATION_AND_TECHNOLOGY_CO_LTD(0x131F), - PHYPLUS_MICROELECTRONICS_LIMITED(0x1320), - SHENZHEN_SONOFF_TECHNOLOGIES_CO_LTD(0x1321), - SAFE4_SECURITY_GROUP(0x1322), - SHANGHAI_MXCHIP_INFORMATION_TECHNOLOGY_CO_LTD(0x1323), - HDC_I_CONTROLS(0x1324), - ZUMA_ARRAY_LIMITED(0x1325), - DECELECT(0x1326), - MILL_INTERNATIONAL_AS(0x1327), - HOMEWIZARD_BV(0x1328), - SHENZHEN_TOPBAND_CO(0x1329), - PRESSAC_COMMUNICATIONS_LTD(0x132A), - ORIGIN_WIRELESS_INC(0x132B), - CONNECTE_AS(0x132C), - YOKIS(0x132D), - XIAMEN_YANKON_ENERGETIC_LIGHTING_CO(0x132E), - YANDEX_LLC(0x132F), - CRITICAL_SOFTWARE_SA(0x1330), - NORTEK_CONTROL(0x1331), - BRIGHTAI(0x1332), - BECKER_ANTRIEBE_GMBH(0x1333), - SHENZHEN_TCL_NEW_TECHNOLOGY_COMPANY_LIMITED(0x1334), - DEXATEK_TECHNOLOGY_LTD(0x1335), - ELELABS_INTERNATIONAL_LIMITED(0x1336), - DATEK_WIRELESS_AS(0x1337), - ALDES(0x1338), - SAVANT_COMPANY(0x1339), - ARISTON_THERMO_GROUP(0x133A), - WAREMA_RENKHOFF_SE(0x133B), - VTECH_HOLDINGS_LIMITED(0x133C), - FUTUREHOME_AS(0x133D), - COGNITIVE_SYSTEMS_CORP(0x133E), - ASR_MICROELECTRONICS_SHENZHEN_CO(0x133F), - AIRIOS(0x1340), - GUANGDONG_OPPO_MOBILE_TELECOMMUNICATIONS_CORP(0x1341), - BEKEN_CORPORATION(0x1342), - CORSAIR(0x1343), - ELTAKO_GMBH(0x1344), - CHENGDU_MEROSS_TECHNOLOGY_CO(0x1345), - RAFAEL_MICROELECTRONICS_INC(0x1346), - AUG_WINKHUAS_GMBH_AND_CO_KG(0x1347), - QINGDAO_HAIER_TECHNOLOGY_CO(0x1348), - APPLE_INC(0x1349), - ROLLEASE_ACME(0x134A), - NABU_CASA_INC(0x134B), - SIMON_HOLDING(0x134C), - KD_NAVIEN(0x134D), - TADO_GMBH(0x134E), - MEDIOLA_CONNECTED_LIVING_AG(0x134F), - POLYNHOME(0x1350), - HOORII_TECHNOLOGY_CO(0x1351), - KIMIN_ELECTRONICS_CO(0x1353), - ZYAX_AB(0x1354), - BARACODA_SA(0x1355), - LENNOX_INTERNATIONAL_INC(0x1356), - TELEDACTICS_INCORPORATED(0x1357), - TOP_VICTORY_INVESTMENTS_LIMITED(0x1358), - GOQUAL_INC(0x1359), - SIEGENIA_AUBI_KG(0x135A), - VIRTUAL_CONNECTED_CONTROLLING_SYSTEM_SINGAPORE_PTE_LTD(0x135B), - GIGASET_COMMUNICATIONS_GMBH(0x135C), - NUKI_HOME_SOLUTIONS_GMBH(0x135D), - DEVICEBOOK_INC(0x135E), - CONSUMER_2_INC_RENTLY(0x135F), - EDISON_LABS_INC_ORRO(0x1360), - INOVELLI(0x1361), - DEVERITEC_GMBH(0x1362), - CHARTER_COMMUNICATIONS(0x1363), - MONOLITHIC_POWER_SYSTEMS_INC(0x1364), - NINGBO_DOOYA_MECHANIC_AND_ELECTRONIC_TECHNOLOGY_CO(0x1365), - SHENZHEN_SDMC_TECHNOLOGY_CO(0x1366), - HP_INC(0x1367), - MUI_LAB_INC(0x1368), - BHTRONICS_SRL(0x1369), - AKUVOX_XIAMEN_NETWORKS_CO(0x136A), - GEWISS_SPA(0x1994), - CLIMAX_TECHNOLOGY_CO(0x2794), - GOOGLE_LLC(0x6006), - CONNECTIVITY_STANDARDS_ALLIANCE_1(0xC5A0), - CONNECTIVITY_STANDARDS_ALLIANCE_2(0xC5A1), - CONNECTIVITY_STANDARDS_ALLIANCE_3(0xC5A2), - CONNECTIVITY_STANDARDS_ALLIANCE_4(0xC5A3), - CONNECTIVITY_STANDARDS_ALLIANCE_5(0xC5A4), - CONNECTIVITY_STANDARDS_ALLIANCE_6(0xC5A5), - CONNECTIVITY_STANDARDS_ALLIANCE_7(0xC5A6), - CONNECTIVITY_STANDARDS_ALLIANCE_8(0xC5A7), - CONNECTIVITY_STANDARDS_ALLIANCE_9(0xC5A8), - CONNECTIVITY_STANDARDS_ALLIANCE_10(0xC5A9), - CONNECTIVITY_STANDARDS_ALLIANCE_11(0xC5AA), - CONNECTIVITY_STANDARDS_ALLIANCE_12(0xC5AB), - CONNECTIVITY_STANDARDS_ALLIANCE_13(0xC5AC), - CONNECTIVITY_STANDARDS_ALLIANCE_14(0xC5AD), - CONNECTIVITY_STANDARDS_ALLIANCE_15(0xC5AE), - CONNECTIVITY_STANDARDS_ALLIANCE_16(0xC5AF), - TESTVENDOR1(0xFFF1), - TESTVENDOR2(0xFFF2), - TESTVENDOR3(0xFFF3), - TESTVENDOR4(0xFFF4), - } - init { optionalQRCodeInfo = HashMap() } diff --git a/src/controller/java/src/chip/onboardingpayload/OptionalQRCodeInfo.kt b/src/controller/java/src/chip/onboardingpayload/OptionalQRCodeInfo.kt index a15753faf80b6c..8f5a02ed631db5 100644 --- a/src/controller/java/src/chip/onboardingpayload/OptionalQRCodeInfo.kt +++ b/src/controller/java/src/chip/onboardingpayload/OptionalQRCodeInfo.kt @@ -17,18 +17,18 @@ package chip.onboardingpayload +enum class OptionalQRCodeInfoType { + TYPE_UNKNOWN, + TYPE_STRING, + TYPE_INT32, + TYPE_INT64, + TYPE_UINT32, + TYPE_UINT64 +} + data class OptionalQRCodeInfo( var tag: Int = 0, var type: OptionalQRCodeInfoType = OptionalQRCodeInfoType.TYPE_UNKNOWN, var data: String? = null, var int32: Int = 0 -) { - enum class OptionalQRCodeInfoType { - TYPE_UNKNOWN, - TYPE_STRING, - TYPE_INT32, - TYPE_INT64, - TYPE_UINT32, - TYPE_UINT64 - } -} +) diff --git a/src/controller/java/src/chip/onboardingpayload/VendorId.kt b/src/controller/java/src/chip/onboardingpayload/VendorId.kt new file mode 100644 index 00000000000000..e191d0c7f75e87 --- /dev/null +++ b/src/controller/java/src/chip/onboardingpayload/VendorId.kt @@ -0,0 +1,726 @@ +/* + * + * 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.onboardingpayload + +/** + * code="0x0000" is defined as "Matter Standard" in the official CSA alliance manufacturer ID database + * and is treated as invalid in Matter SDK. + */ +enum class VendorId(val value: Int) { + UNSPECIFIED(0x0000), + PANASONIC(0x0001), + SONY(0x0002), + SAMSUNG(0x0003), + PHILIPS(0x0004), + FREESCALE_RF(0x0005), + OKI_SEMICONDUCTORS(0x0006), + TEXAS_INSTRUMENTS(0x0007), + CIRRONET(0x1000), + CHIPCON(0x1001), + EMBER(0x1002), + NTS(0x1003), + FREESCALE(0x1004), + IP_COM(0x1005), + SAN_JUAN_SOFTWARE(0x1006), + TUV(0x1007), + INTEGRATION(0x1008), + BM_SPA(0x1009), + AWAREPOINT(0x100A), + SIGNIFY_NETHERLANDS(0x100B), + LUXOFT(0x100C), + KORWIN(0x100D), + ONE_RF_TECHNOLOGY(0x100E), + SOFTWARE_TECHNOLOGIES_GROUP(0x100F), + TELEGESIS(0x1010), + VISONIC(0x1011), + INSTA(0x1012), + ATALUM(0x1013), + ATMEL(0x1014), + DEVELCO(0x1015), + HONEYWELL(0x1016), + RADIOPULSE(0x1017), + RENESAS(0x1018), + XANADU_WIRELESS(0x1019), + NEC_ENGINEERING(0x101A), + YAMATAKE_CORPORATION(0x101B), + TENDRIL_NETWORKS(0x101C), + ASSA_ABLOY(0x101D), + MAXSTREAM(0x101E), + NEUROCOM(0x101F), + INSTITUTE_FOR_INFORMATION_INDUSTRY(0x1020), + LEGRAND_GROUP(0x1021), + ICONTROL(0x1022), + RAYMARINE(0x1023), + LS_RESEARCH(0x1024), + ONITY_INC(0x1025), + MONO_PRODUCTS(0x1026), + RF_TECHNOLOGIES(0x1027), + ITRON(0x1028), + TRITECH(0x1029), + EMBEDIT_AS(0x102A), + S3C(0x102B), + SIEMENS(0x102C), + MINDTECH(0x102D), + LG_ELECTRONICS(0x102E), + MITSUBISHI_ELECTRIC_CORP(0x102F), + JOHNSON_CONTROLS(0x1030), + SECURE_METERS_UK_LTD(0x1031), + KNICK(0x1032), + VICONICS(0x1033), + FLEXIPANEL(0x1034), + PIASIM_CORPORATION_PTE_LTD(0x1035), + TRANE(0x1036), + NXP_SEMICONDUCTORS(0x1037), + LIVING_INDEPENDENTLY_GROUP(0x1038), + ALERTME_COM(0x1039), + DAINTREE(0x103A), + AIJI_SYSTEM(0x103B), + TELECOM_ITALIA(0x103C), + MIKROKRETS_AS(0x103D), + OKI_SEMICONDUCTOR(0x103E), + NEWPORT_ELECTONICS(0x103F), + CONTROL_4(0x1040), + STMICROELECTRONICS(0x1041), + AD_SOL_NISSIN_CORP(0x1042), + DCSI(0x1043), + FRANCE_TELECOM(0x1044), + MUNET(0x1045), + AUTANI_CORPORATION(0x1046), + COLORADO_VNET(0x1047), + AEROCOMM_INC(0x1048), + SILICON_LABORATORIES(0x1049), + INNCOM_INTERNATIONAL_INC(0x104A), + COOPER_POWER_SYSTEMS(0x104B), + SYNAPSE(0x104C), + FISHER_PIERCE_SUNRISE(0x104D), + CENTRALITE_SYSTEMS_INC(0x104E), + CRANE_WIRELESS_MONITORING_SOLUTIONS(0x104F), + MOBILARM_LIMITED(0x1050), + IMONITOR_RESEARCH_LTD(0x1051), + BARTECH(0x1052), + MESHNETICS(0x1053), + LS_INDUSTRIAL_SYSTEMS(0x1054), + CASON_ENGINEERING(0x1055), + WIRELESS_GLUE_NETWORKS(0x1056), + ELSTER(0x1057), + SMS_TECNOLOGIA_ELETRONICA(0x1058), + ONSET_COMPUTER_CORPORATION(0x1059), + RIGA_DEVELOPMENT(0x105A), + ENERGATE(0x105B), + CONMED_LINVATEC(0x105C), + POWERMAND(0x105D), + SCHNEIDER_ELECTRIC(0x105E), + EATON_CORPORATION(0x105F), + TELULAR_CORPORATION(0x1060), + DELPHI_MEDICAL_SYSTEMS(0x1061), + EPISENSOR_LIMITED(0x1062), + LANDIS_GYR(0x1063), + KABA_GROUP(0x1064), + SHURE_INCORPORATED(0x1065), + COMVERGE_INC(0x1066), + DBS_LODGING_TECHNOLOGIES(0x1067), + ENERGY_AWARE_TECHNOLOGY(0x1068), + HIDALGO_LIMITED(0x1069), + AIR2APP(0x106A), + AMX(0x106B), + EDMI_PTY_LTD(0x106C), + CYAN_LTD(0x106D), + SYSTEM_SPA(0x106E), + TELIT(0x106F), + KAGA_ELECTRONICS(0x1070), + ASTREL_GROUP(0x1071), + CERTICOM(0x1072), + GRIDPOINT(0x1073), + PROFILE_SYSTEMS(0x1074), + COMPACTA_INTERNATIONAL(0x1075), + FREESTYLE_TECHNOLOGY(0x1076), + ALEKTRONA(0x1077), + COMPUTIME(0x1078), + REMOTE_TECHNOLOGIES_INC(0x1079), + WAVECOM_SA(0x107A), + ENERGY_OPTIMIZERS(0x107B), + GE(0x107C), + JETLUN(0x107D), + CIPHER_SYSTEMS(0x107E), + CORPORATE_SYSTEMS_ENGINEERING(0x107F), + ECOBEE(0x1080), + SMK(0x1081), + MESHWORKS_WIRELESS(0x1082), + ELLIPS_BV(0x1083), + SECURE_ELECTRANS(0x1084), + CEDO(0x1085), + TOSHIBA(0x1086), + DIGI_INTERNATIONAL(0x1087), + UBILogix(0x1088), + ECHELON(0x1089), + GREEN_ENERGY_OPTIONS(0x1090), + SILVER_SPRING_NETWORKS(0x1091), + BLACK_AND_DECKER(0x1092), + AZTECH_ASSOCIATES_INC(0x1093), + A_AND_D_CO_LTD(0x1094), + RAINFOREST_AUTOMATION(0x1095), + CARRIER_ELECTRONICS(0x1096), + SYCHIP_MURATA(0x1097), + OPENPEAK(0x1098), + PASSIVE_SYSTEMS(0x1099), + MMB_RESEARCH(0x109A), + LEVITON_MANUFACTURING_COMPANY(0x109B), + KOREA_ELECTRIC_POWER_DATA_NETWORK_CO(0x109C), + COMCAST(0x109D), + NEC_ELECTRONICS(0x109E), + NETVOX(0x109F), + U_CONTROL(0x10A0), + EMBEDIA_TECHNOLOGIES_CORP(0x10A1), + SENSUS(0x10A2), + SUNRISE_TECHNOLOGIES(0x10A3), + MEMTECH_CORP(0x10A4), + FREEBOX(0x10A5), + M2_LABS_LTD(0x10A6), + BRITISH_GAS(0x10A7), + SENTEC_LTD(0x10A8), + NAVETAS(0x10A9), + LIGHTSPEED_TECHNOLOGIES(0x10AA), + OKI_ELECTRIC_INDUSTRY_CO(0x10AB), + S_I_SISTEMAS_INTELIGENTES_ELETRONICOS(0x10AC), + DOMETIC(0x10AD), + ALPS(0x10AE), + ENERGYHUB(0x10AF), + KAMSTRUP(0x10B0), + ECHOSTAR(0x10B1), + ENERNOC(0x10B2), + ELTAV(0x10B3), + BELKIN(0x10B4), + XSTREAMHD_WIRELESS_VENTURES(0x10B5), + SATURN_SOUTH_PTY_LTD(0x10B6), + GREENTRAPOLINE_A_S(0x10B7), + SMARTSYNCH_INC(0x10B8), + NYCE_CONTROL_INC(0x10B9), + ICM_CONTROLS_CORP(0x10BA), + MILLENNIUM_ELECTRONICS_PTY_LTD(0x10BB), + MOTOROLA_INC(0x10BC), + EMERSON_WHITE_RODGERS(0x10BD), + RADIO_THERMOSTAT_COMPANY_OF_AMERICA(0x10BE), + OMRON_CORPORATION(0x10BF), + GIINII_GLOBAL_LIMITED(0x10C0), + FUJITSU_GENERAL_LIMITED(0x10C1), + PEEL_TECHNOLOGIES_INC(0x10C2), + ACCENT_SPA(0x10C3), + BYTESNAP_DESIGN_LTD(0x10C4), + NEC_TOKIN_CORPORATION(0x10C5), + G4S_JUSTICE_SERVICES(0x10C6), + TRILLIANT_NETWORKS_INC(0x10C7), + ELECTROLUX_ITALIA_SPA(0x10C8), + ONZO_LTD(0x10C9), + ENTEK_SYSTEMS(0x10CA), + MAINSTREAM_ENGINEERING(0x10CC), + INDESIT_COMPANY(0x10CD), + THINKECO_INC(0x10CE), + D2C_INC(0x10CF), + QORVO(0x10D0), + INTERCEL(0x10D1), + MITSUMI_ELECTRIC_CO_LTD(0x10D3), + MITSUMI_ELECTRIC_CO_LTD_2(0x10D4), + ZENTRUM_MIKROELEKTRONIK_DRESDEN_AG(0x10D5), + NEST_LABS_INC(0x10D6), + EXEGIN_TECHNOLOGIES_LTD(0x10D7), + TAKAHATA_PRECISION_CO(0x10D9), + SUMITOMO_ELECTRIC_NETWORKS_INC(0x10DA), + GE_ENERGY(0x10DB), + GE_APPLIANCES(0x10DC), + RADIOCRAFTS_AS(0x10DD), + CEIVA(0x10DE), + TEC_AND_CO_CO_LTD(0x10DF), + CHAMELEON_TECHNOLOGY_UK_LTD(0x10E0), + RUWIDO_AUSTRIA_GMBH(0x10E2), + HUAWEI_TECHNOLOGIES_CO(0x10E3), + HUAWEI_TECHNOLOGIES_CO_2(0x10E4), + GREENWAVE_REALITY(0x10E5), + BGLOBAL_METERING_LTD(0x10E6), + MINDTECK(0x10E7), + INGERSOLL_RAND(0x10E8), + DIUS_COMPUTING_PTY_LTD(0x10E9), + EMBEDDED_AUTOMATION_INC(0x10EA), + ABB(0x10EB), + GENUS_POWER_INFRASTRUCTURES_LIMITED(0x10ED), + UNIVERSAL_ELECTRONICS_INC(0x10EE), + UNIVERSAL_ELECTRONICS_INC_2(0x10EF), + METRUM_TECHNOLOGIES_LLC(0x10F0), + CISCO(0x10F1), + UBISYS_TECHNOLOGIES_GMBH(0x10F2), + CONSERT(0x10F3), + CRESTRON_ELECTRONICS(0x10F4), + ENPHASE_ENERGY(0x10F5), + INVENSYS_CONTROLS(0x10F6), + MUELLER_SYSTEMS_LLC(0x10F7), + AAC_TECHNOLOGIES_HOLDING(0x10F8), + U_NEXT_CO(0x10F9), + STEELCASE_INC(0x10FA), + TELEMATICS_WIRELESS(0x10FB), + SAMIL_POWER_CO(0x10FC), + PACE_PLC(0x10FD), + OSBORNE_COINAGE_CO(0x10FE), + POWERWATCH(0x10FF), + CANDELED_GMBH(0x1100), + FLEXGRID_SRL(0x1101), + HUMAX(0x1102), + UNIVERSAL_DEVICES(0x1103), + ADVANCED_ENERGY(0x1104), + BEGA_GANTENBRINK_LEUCHTEN(0x1105), + BRUNEL_UNIVERSITY(0x1106), + PANASONIC_RD_CENTER_SINGAPORE(0x1107), + ESYSTEMS_RESEARCH(0x1108), + PANAMAX(0x1109), + SMARTTHINGS_INC(0x110A), + EM_LITE_LTD(0x110B), + OSRAM_SYLVANIA(0x110C), + SAVE_ENERGY_LTD(0x110D), + PLANET_INNOVATION_PRODUCTS_PTY_LTD(0x110E), + AMBIENT_DEVICES_INC(0x110F), + PROFALUX(0x1110), + BILLION_ELECTRIC_COMPANY(0x1111), + EMBERTEC_PTY_LTD(0x1112), + IT_WATCHDOGS(0x1113), + RELOC(0x1114), + INTEL_CORPORATION(0x1115), + TREND_ELECTRONICS_LIMITED(0x1116), + MOXA(0x1117), + QEES(0x1118), + SAYME_WIRELESS_SENSOR_NETWORKS(0x1119), + PENTAIR_AQUATIC_SYSTEMS(0x111A), + ORBIT_IRRIGATION(0x111B), + CALIFORNIA_EASTERN_LABORATORIES(0x111C), + IDT_TECHNOLOGY_LIMITED(0x111E), + PIXELA_CORPORATION(0x111F), + TIVO_INC(0x1120), + FIDURE_CORP(0x1121), + MARVELL_SEMICONDUCTOR_INC(0x1122), + WASION_GROUP_LIMITED(0x1123), + JASCO_PRODUCTS_COMPANY(0x1124), + SHENZHEN_KAIFA_TECHNOLOGY(0x1125), + NETCOMM_WIRELESS_LIMITED(0x1126), + DEFINE_INSTRUMENTS_LIMITED(0x1127), + IN_HOME_DISPLAYS_LTD(0x1128), + MIELE_AND_CIE_KG(0x1129), + TELEVES_SA(0x112A), + LABELEC(0x112B), + CHINA_ELECTRONICS_STANDARDIZATION_INSTITUTE(0x112C), + VECTORFORM_LLC(0x112D), + BUSCH_JAEGER_ELEKTRO(0x112E), + REDPINE_SIGNALS_INC(0x112F), + BRIDGES_ELECTRONIC_TECHNOLOGY_PTY_LTD(0x1130), + SERCOMM(0x1131), + WSH_GMBH_WIRSINDHELLER(0x1132), + BOSCH_SECURITY_SYSTEMS_INC(0x1133), + EZEX_CORPORATION(0x1134), + DRESDEN_ELEKTRONIK_INGENIEURTECHNIK_GMBH(0x1135), + MEAZON_SA(0x1136), + CROW_ELECTRONIC_ENGINEERING_LTD(0x1137), + HARVARD_ENGINEERING_PLC(0x1138), + ANDSON_BEIJING_TECHNOLOGY(0x1139), + ADHOCO_AG(0x113A), + WAXMAN_CONSUMER_PRODUCTS_GROUP_INC(0x113B), + OWON_TECHNOLOGY_INC(0x113C), + HITRON_TECHNOLOGIES_INC(0x113D), + SCEMTEC_HARD_UND_SOFTWARE(0x113E), + WEBEE_LLC(0x113F), + GRID2HOME_INC(0x1140), + TELINK_MICRO(0x1141), + JASMINE_SYSTEMS_INC(0x1142), + BIDGELY(0x1143), + LUTRON(0x1144), + IJENKO(0x1145), + STARFIELD_ELECTRONIC_LTD(0x1146), + TCP_INC(0x1147), + ROGERS_COMMUNICATIONS_PARTNERSHIP(0x1148), + CREE_INC(0x1149), + ROBERT_BOSCH_LLC(0x114A), + IBIS_NETWORKS_INC(0x114B), + QUIRKY_INC(0x114C), + EFERGY_TECHNOLOGIES_LIMITED(0x114D), + SMARTLABS_INC(0x114E), + EVERSPRING_INDUSTRY_CO_LTD(0x114F), + SWANN_COMMUNICATIONS_PTL_LTD(0x1150), + SONETER(0x1151), + SAMSUNG_SDS(0x1152), + UNIBAND_ELECTRONIC_CORPORATION(0x1153), + ACCTON_TECHNOLOGY_CORPORATION(0x1154), + BOSCH_THERMOTECHNIK_GMBH(0x1155), + WINCOR_NIXDORF_INC(0x1156), + OHSUNG_ELECTRONICS(0x1157), + ZEN_WITHIN_INC(0x1158), + TECH4HOME_LDA(0x1159), + NANOLEAF(0x115A), + KEEN_HOME_INC(0x115B), + POLY_CONTROL_APS(0x115C), + EASTFIELD_LIGHTING_CO_LTD_SHENZHEN(0x115D), + IP_DATATEL_INC(0x115E), + LUMI_UNITED_TECHOLOGY_LTD_SHENZHEN(0x115F), + SENGLED_CO_LTD(0x1160), + REMOTE_SOLUTION_CO_LTD(0x1161), + ABB_GENWAY_XIAMEN_ELECTRICAL_EQUIPMENT_CO(0x1162), + ZHEJIANG_REXENSE_TECH(0x1163), + FOREE_TECHNOLOGY(0x1164), + OPEN_ACCESS_TECHNOLOGY_INTL(0x1165), + INNR_LIGHTING_BV(0x1166), + TECHWORLD_INDUSTRIES(0x1167), + LEEDARSON_LIGHTING_CO_LTD(0x1168), + ARZEL_ZONING(0x1169), + HOLLEY_TECHNOLOGY(0x116A), + BELDON_TECHNOLOGIES(0x116B), + FLEXTRONICS(0x116C), + SHENZHEN_MEIAN(0x116D), + LOWES(0x116E), + SIGMA_CONNECTIVITY(0x116F), + WULIAN(0x1171), + PLUGWISE_BV(0x1172), + TITAN_PRODUCTS(0x1173), + ECOSPECTRAL(0x1174), + D_LINK(0x1175), + TECHNICOLOR_HOME_USA(0x1176), + OPPLE_LIGHTING(0x1177), + WISTRON_NEWEB_CORP(0x1178), + QMOTION_SHADES(0x1179), + INSTA_GMBH(0x117A), + SHANGHAI_VANCOUNT(0x117B), + IKEA_OF_SWEDEN(0x117C), + RT_RK(0x117D), + SHENZHEN_FEIBIT(0x117E), + EUCONTROLS(0x117F), + TELKONET(0x1180), + THERMAL_SOLUTION_RESOURCES(0x1181), + POMCUBE(0x1182), + EI_ELECTRONICS(0x1183), + OPTOGA(0x1184), + STELPRO(0x1185), + LYNXUS_TECHNOLOGIES_CORP(0x1186), + SEMICONDUCTOR_COMPONENTS(0x1187), + TP_LINK(0x1188), + LEDVANCE_GMBH(0x1189), + NORTEK(0x118A), + IREVO_ASSA_ABBLOY_KOREA(0x118B), + MIDEA(0x118C), + ZF_FRIEDRICHSHAFEN(0x118D), + CHECKIT(0x118E), + ACLARA(0x118F), + NOKIA(0x1190), + GOLDCARD_HIGH_TECH_CO(0x1191), + GEORGE_WILSON_INDUSTRIES_LTD(0x1192), + EASY_SAVER_CO_INC(0x1193), + ZTE_CORPORATION(0x1194), + ARRIS(0x1195), + RELIANCE_BIG_TV(0x1196), + INSIGHT_ENERGY_VENTURES_POWERLEY(0x1197), + THOMAS_RESEARCH_PRODUCTS(0x1198), + LI_SENG_TECHNOLOGY(0x1199), + SYSTEM_LEVEL_SOLUTIONS_INC(0x119A), + MATRIX_LABS(0x119B), + SINOPE_TECHNOLOGIES(0x119C), + JIUZHOU_GREEBLE(0x119D), + GUANGZHOU_LANVEE_TECH_CO_LTD(0x119E), + VENSTAR(0x119F), + SLV(0x1200), + HALO_SMART_LABS(0x1201), + SCOUT_SECURITY_INC(0x1202), + ALIBABA_CHINA_INC(0x1203), + RESOLUTION_PRODUCTS_INC(0x1204), + SMARTLOK_INC(0x1205), + LUX_PRODUCTS_CORP(0x1206), + VIMAR_SPA(0x1207), + UNIVERSAL_LIGHTING_TECHNOLOGIES(0x1208), + ROBERT_BOSCH_GMBH(0x1209), + ACCENTURE(0x120A), + HEIMAN_TECHNOLOGY_CO(0x120B), + SHENZHEN_HOMA_TECHNOLOGY_CO(0x120C), + VISION_ELECTRONICS_TECHNOLOGY(0x120D), + LENOVO(0x120E), + PRESCIENSE_RD(0x120F), + SHENZHEN_SEASTAR_INTELLIGENCE_CO(0x1210), + SENSATIVE_AB(0x1211), + SOLAREDGE(0x1212), + ZIPATO(0x1213), + CHINA_FIRE_SECURITY_SENSING_MANUFACTURING(0x1214), + QUBY_BV(0x1215), + HANGZHOU_ROOMBANKER_TECHNOLOGY_CO(0x1216), + AMAZON_LAB126(0x1217), + PAULMANN_LICHT_GMBH(0x1218), + SHENZHEN_ORVIBO_ELECTRONICS_CO_LTD(0x1219), + TCI_TELECOMMUNICATIONS(0x121A), + MUELLER_LICHT_INTERNATIONAL_INC(0x121B), + AURORA_LIMITED(0x121C), + SMARTDCC(0x121D), + SHANGHAI_UMEINFO_CO_LTD(0x121E), + CARBONTRACK(0x121F), + SOMFY(0x1220), + VIESSMANN_ELEKTRONIK_GMBH(0x1221), + HILDEBRAND_TECHNOLOGY_LTD(0x1222), + ONKYO_TECHNOLOGY_CORPORATION(0x1223), + SHENZHEN_SUNRICHER_TECHNOLOGY_LTD(0x1224), + XIU_XIU_TECHNOLOGY_CO_LTD(0x1225), + ZUMTOBEL_GROUP(0x1226), + SHENZHEN_KAADAS_INTELLIGENT_TECHNOLOGY_CO_LTD(0x1227), + SHANGHAI_XIAOYAN_TECHNOLOGY_CO_LTD(0x1228), + CYPRESS_SEMICONDUCTOR(0x1229), + XAL_GMBH(0x122A), + INERGY_SYSTEMS_LLC(0x122B), + ALFRED_KARCHER_GMBH_CO_KG(0x122C), + ADUROLIGHT_MANUFACTURING(0x122D), + GROUPE_MULLER(0x122E), + V_MARK_ENTERPRISES_INC(0x122F), + LEAD_ENERGY_AG(0x1230), + ULTIMATE_IOT_HENAN_TECHNOLOGY_LTD(0x1231), + AXXESS_INDUSTRIES_INC(0x1232), + THIRD_REALITY_INC(0x1233), + DSR_CORPORATION(0x1234), + GUANGZHOU_VENSI_INTELLIGENT_TECHNOLOGY(0x1235), + SCHLAGE_LOCK_ALLEGION(0x1236), + NET2GRID(0x1237), + AIRAM_ELECTRIC_OY_AB(0x1238), + IMMAX_WPB_CZ(0x1239), + ZIV_AUTOMATION(0x123A), + HANGZHOU_IMAGICTECHNOLOGY(0x123B), + XIAMEN_LEELEN_TECHNOLOGY(0x123C), + OVERKIZ_SAS(0x123D), + FLONIDAN_A_S(0x123E), + HDL_AUTOMATION(0x123F), + ARDOMUS_NETWORKS_CORPORATION(0x1240), + SAMJIN_CO_LTD(0x1241), + FIREANGEL_SAFETY_TECHNOLOGY(0x1242), + INDRA_SISTEMAS_SA(0x1243), + SHENZHEN_JBT_SMART_LIGHTING(0x1244), + GE_LIGHTING_CURRENT(0x1245), + DANFOSS_A_S(0x1246), + NIVISS_PHP_SP_Z_O_O_SP_K(0x1247), + SHENZHEN_FENGLIYUAN_ENERGY_CONSERVATING_TECHNOLOGY(0x1248), + NEXELEC(0x1249), + SICHUAN_BEHOME_PROMINENT_TECHNOLOGY(0x124A), + FUJIAN_STAR_NET_COMMUNICATION(0x124B), + TOSHIBA_VISUAL_SOLUTIONS_CORPORATION(0x124C), + LATCHABLE_INC(0x124D), + L_S_DEUTSCHLAND_GMBH(0x124E), + GLEDOPTO_CO_LTD(0x124F), + THE_HOME_DEPOT(0x1250), + NEONLITE_DISTRIBUTION_LIMITED(0x1251), + ARLO_TECHNOLOGIES_INC(0x1252), + XINGLUO_TECHNOLOGY_CO_LTD(0x1253), + SIMON_ELECTRIC_CHINA_CO_LTD(0x1254), + HANGZHOU_GREATSTAR_INDUSTRIAL_CO_LTD(0x1255), + SEQUENTRIC_ENERGY_SYSTEMS_LLC(0x1256), + SOLUM_CO_LTD(0x1257), + EAGLERISE_ELECTRIC_ELECTRONIC_CHINA_CO_LTD(0x1258), + FANTEM_TECHNOLOGIES_SHENZHEN_CO_LTD(0x1259), + YUNDING_NETWORK_TECHNOLOGY_BEIJING_CO_LTD(0x125A), + ATLANTIC_GROUP(0x125B), + XIAMEN_INTRETECH_INC(0x125C), + TUYA_GLOBAL_INC(0x125D), + DNAKE_XIAMEN_INTELLIGENT_TECHNOLOGY(0x125E), + NIKO_NV(0x125F), + EMPORIA_ENERGY(0x1260), + SIKOM_AS(0x1261), + AXIS_LABS_INC(0x1262), + CURRENT_PRODUCTS_CORPORATION(0x1263), + METERSIT_SRL(0x1264), + HORNBACH_BAUMARKT_AG(0x1265), + DICEWORLD_S_R_L_A_SOCIO_UNICO(0x1266), + ARC_TECHNOLOGY_CO_LTD(0x1267), + HANGZHOU_KONKE_INFORMATION_TECHNOLOGY(0x1268), + SALTO_SYSTEMS_SL(0x1269), + SHENZHEN_SHYUGJ_TECHNOLOGY(0x126A), + BRAYDEN_AUTOMATION_CORPORATION(0x126B), + ENVIRONEXUS_PTY_LTD(0x126C), + ELTRA_NV_SA(0x126D), + XIAOMI_COMMUNICATIONS_CO_LTD(0x126E), + SHANGHAI_SHUNCOM_ELECTRONIC_TECHNOLOGY(0x126F), + VOLTALIS_SA(0x1270), + FEELUX_CO_LTD(0x1271), + SMARTPLUS_INC(0x1272), + HALEMEIER_GMBH(0x1273), + TRUST_INTERNATIONAL_BV(0x1274), + DUKE_ENERGY_BUSINESS_SERVICES_LLC(0x1275), + CALIX_INC(0x1276), + ADEO(0x1277), + CONNECTED_RESPONSE_LIMITED(0x1278), + STROYENERGOKOM_LTD(0x1279), + LUMITECH_LIGHTING_SOLUTION_GMBH(0x127A), + VERDANT_ENVIRONMENTAL_TECHNOLOGIES(0x127B), + ALFRED_INTERNATIONAL_INC(0x127C), + ANSI_LED_LIGHTING_CO_LTD(0x127D), + MINDTREE_LIMITED(0x127E), + NORDIC_SEMICONDUCTOR_ASA(0x127F), + SITERWELL_ELECTRONICS_CO_LIMITED(0x1280), + BRILONER_LEUCHTEN_GMBH(0x1281), + SHENZHEN_SEI_TECHNOLOGY_CO_LTD(0x1282), + COPPER_LABS_INC(0x1283), + DELTA_DORE(0x1284), + HAGER_GROUP(0x1285), + SHENZHEN_COOLKIT_TECHNOLOGY_CO_LTD(0x1286), + HANGZHOU_SKY_LIGHTING_CO_LTD(0x1287), + E_ON_SE(0x1288), + LIDL_STIFTUNG_CO_KG(0x1289), + SICHUAN_CHANGHONG_NETWORK_TECHNOLOGIES(0x128A), + NODON(0x128B), + JIANGXI_INNOTECH_TECHNOLOGY_CO_LTD(0x128C), + MERCATOR_PTY_LTD(0x128D), + BEIJING_RUYING_TECH_LIMITED(0x128E), + EGLO_LEUCHTEN_GMBH(0x128F), + PIETRO_FIORENTINI_SPA(0x1290), + ZEHNDER_GROUP_VAUX_ANDIGNY(0x1291), + BRK_BRANDS_INC(0x1292), + ASKEY_COMPUTER_CORP(0x1293), + PASSIVEBOLT_INC(0x1294), + AVM_AUDIOVISUELLES_MARKETING_UND_COMPUTERSYSTEME_BERLIN(0x1295), + NINGBO_SUNTECH_LIGHTING_TECHNOLOGY_CO_LTD(0x1296), + SOCIETE_EN_COMMANDITE_STELLO(0x1297), + VIVINT_SMART_HOME(0x1298), + NAMRON_AS(0x1299), + RADEMACHER_GERATE_ELEKTRONIK_GMBH(0x129A), + OMO_SYSTEMS_LTD(0x129B), + SIGLIS_AG(0x129C), + IMHOTEP_CREATION(0x129D), + ICASA(0x129E), + LEVEL_HOME_INC(0x129F), + TIS_CONTROL_LIMITED(0x1300), + RADISYS_INDIA_PVT_LTD(0x1301), + VEEA_INC(0x1302), + FELL_TECHNOLOGY_AS(0x1303), + SOWILO_DESIGN_SERVICES_LTD(0x1304), + LEXI_DEVICES_INC(0x1305), + LIFI_LABS_INC_DBA_LIFX(0x1306), + GRUNDFOS_HOLDING_AS(0x1307), + SOURCING_AND_CREATION(0x1308), + KRAKEN_TECHNOLOGIES_LTD(0x1309), + EVE_SYSTEMS(0x130A), + LITE_ON_TECHNOLOGY_CORPORATION(0x130B), + FOCALCREST_LIMITED(0x130C), + BOUFFALO_LAB_NANJING_CO_LTD(0x130D), + WYZE_LABS_INC(0x130E), + Z_WAVE_EUROPE_GMBH(0x130F), + AEOTEC_LIMITED(0x1310), + NGSTB_COMPANY_LIMITED(0x1311), + QINGDAO_YEELINK_INFORMATION_TECHNOLOGY_CO_LTD(0x1312), + E_SMART_HOME_AUTOMATION_SYSTEMS_LIMITED(0x1313), + FIBAR_GROUP_SA(0x1314), + PROLITECH_GMBH(0x1315), + PANKORE_INTEGRATED_CIRCUIT_TECHNOLOGY_CO_LTD(0x1316), + LOGITECH(0x1317), + PIARO_INC(0x1318), + MITSUBISHI_ELECTRIC_US_INC(0x1319), + RESIDEO_TECHNOLOGIES_INC(0x131A), + ESPRESSIF_SYSTEMS_SHANGHAI_CO_LTD(0x131B), + HELLA_SONNEN_UND_WETTERSCHUTZTECHNIK_GMBH(0x131C), + GEBERIT_INTERNATIONAL_AG(0x131D), + CAME_SPA(0x131E), + GUANGZHOU_ELITE_EDUCATION_AND_TECHNOLOGY_CO_LTD(0x131F), + PHYPLUS_MICROELECTRONICS_LIMITED(0x1320), + SHENZHEN_SONOFF_TECHNOLOGIES_CO_LTD(0x1321), + SAFE4_SECURITY_GROUP(0x1322), + SHANGHAI_MXCHIP_INFORMATION_TECHNOLOGY_CO_LTD(0x1323), + HDC_I_CONTROLS(0x1324), + ZUMA_ARRAY_LIMITED(0x1325), + DECELECT(0x1326), + MILL_INTERNATIONAL_AS(0x1327), + HOMEWIZARD_BV(0x1328), + SHENZHEN_TOPBAND_CO(0x1329), + PRESSAC_COMMUNICATIONS_LTD(0x132A), + ORIGIN_WIRELESS_INC(0x132B), + CONNECTE_AS(0x132C), + YOKIS(0x132D), + XIAMEN_YANKON_ENERGETIC_LIGHTING_CO(0x132E), + YANDEX_LLC(0x132F), + CRITICAL_SOFTWARE_SA(0x1330), + NORTEK_CONTROL(0x1331), + BRIGHTAI(0x1332), + BECKER_ANTRIEBE_GMBH(0x1333), + SHENZHEN_TCL_NEW_TECHNOLOGY_COMPANY_LIMITED(0x1334), + DEXATEK_TECHNOLOGY_LTD(0x1335), + ELELABS_INTERNATIONAL_LIMITED(0x1336), + DATEK_WIRELESS_AS(0x1337), + ALDES(0x1338), + SAVANT_COMPANY(0x1339), + ARISTON_THERMO_GROUP(0x133A), + WAREMA_RENKHOFF_SE(0x133B), + VTECH_HOLDINGS_LIMITED(0x133C), + FUTUREHOME_AS(0x133D), + COGNITIVE_SYSTEMS_CORP(0x133E), + ASR_MICROELECTRONICS_SHENZHEN_CO(0x133F), + AIRIOS(0x1340), + GUANGDONG_OPPO_MOBILE_TELECOMMUNICATIONS_CORP(0x1341), + BEKEN_CORPORATION(0x1342), + CORSAIR(0x1343), + ELTAKO_GMBH(0x1344), + CHENGDU_MEROSS_TECHNOLOGY_CO(0x1345), + RAFAEL_MICROELECTRONICS_INC(0x1346), + AUG_WINKHUAS_GMBH_AND_CO_KG(0x1347), + QINGDAO_HAIER_TECHNOLOGY_CO(0x1348), + APPLE_INC(0x1349), + ROLLEASE_ACME(0x134A), + NABU_CASA_INC(0x134B), + SIMON_HOLDING(0x134C), + KD_NAVIEN(0x134D), + TADO_GMBH(0x134E), + MEDIOLA_CONNECTED_LIVING_AG(0x134F), + POLYNHOME(0x1350), + HOORII_TECHNOLOGY_CO(0x1351), + KIMIN_ELECTRONICS_CO(0x1353), + ZYAX_AB(0x1354), + BARACODA_SA(0x1355), + LENNOX_INTERNATIONAL_INC(0x1356), + TELEDACTICS_INCORPORATED(0x1357), + TOP_VICTORY_INVESTMENTS_LIMITED(0x1358), + GOQUAL_INC(0x1359), + SIEGENIA_AUBI_KG(0x135A), + VIRTUAL_CONNECTED_CONTROLLING_SYSTEM_SINGAPORE_PTE_LTD(0x135B), + GIGASET_COMMUNICATIONS_GMBH(0x135C), + NUKI_HOME_SOLUTIONS_GMBH(0x135D), + DEVICEBOOK_INC(0x135E), + CONSUMER_2_INC_RENTLY(0x135F), + EDISON_LABS_INC_ORRO(0x1360), + INOVELLI(0x1361), + DEVERITEC_GMBH(0x1362), + CHARTER_COMMUNICATIONS(0x1363), + MONOLITHIC_POWER_SYSTEMS_INC(0x1364), + NINGBO_DOOYA_MECHANIC_AND_ELECTRONIC_TECHNOLOGY_CO(0x1365), + SHENZHEN_SDMC_TECHNOLOGY_CO(0x1366), + HP_INC(0x1367), + MUI_LAB_INC(0x1368), + BHTRONICS_SRL(0x1369), + AKUVOX_XIAMEN_NETWORKS_CO(0x136A), + GEWISS_SPA(0x1994), + CLIMAX_TECHNOLOGY_CO(0x2794), + GOOGLE_LLC(0x6006), + CONNECTIVITY_STANDARDS_ALLIANCE_1(0xC5A0), + CONNECTIVITY_STANDARDS_ALLIANCE_2(0xC5A1), + CONNECTIVITY_STANDARDS_ALLIANCE_3(0xC5A2), + CONNECTIVITY_STANDARDS_ALLIANCE_4(0xC5A3), + CONNECTIVITY_STANDARDS_ALLIANCE_5(0xC5A4), + CONNECTIVITY_STANDARDS_ALLIANCE_6(0xC5A5), + CONNECTIVITY_STANDARDS_ALLIANCE_7(0xC5A6), + CONNECTIVITY_STANDARDS_ALLIANCE_8(0xC5A7), + CONNECTIVITY_STANDARDS_ALLIANCE_9(0xC5A8), + CONNECTIVITY_STANDARDS_ALLIANCE_10(0xC5A9), + CONNECTIVITY_STANDARDS_ALLIANCE_11(0xC5AA), + CONNECTIVITY_STANDARDS_ALLIANCE_12(0xC5AB), + CONNECTIVITY_STANDARDS_ALLIANCE_13(0xC5AC), + CONNECTIVITY_STANDARDS_ALLIANCE_14(0xC5AD), + CONNECTIVITY_STANDARDS_ALLIANCE_15(0xC5AE), + CONNECTIVITY_STANDARDS_ALLIANCE_16(0xC5AF), + TESTVENDOR1(0xFFF1), + TESTVENDOR2(0xFFF2), + TESTVENDOR3(0xFFF3), + TESTVENDOR4(0xFFF4), +} + diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 0248cc27172020..12585d03b60a16 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -11953,68 +11953,47 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string newElement_0_modeCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_0_modeClassName.c_str(), newElement_0_modeCtorSignature.c_str(), entry_0.mode, newElement_0_mode); - jobject newElement_0_modeTags; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_modeTags); + jobject newElement_0_semanticTags; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_semanticTags); - auto iter_newElement_0_modeTags_2 = entry_0.modeTags.begin(); - while (iter_newElement_0_modeTags_2.Next()) + auto iter_newElement_0_semanticTags_2 = entry_0.semanticTags.begin(); + while (iter_newElement_0_semanticTags_2.Next()) { - auto & entry_2 = iter_newElement_0_modeTags_2.GetValue(); + auto & entry_2 = iter_newElement_0_semanticTags_2.GetValue(); jobject newElement_2; jobject newElement_2_mfgCode; - if (!entry_2.mfgCode.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_mfgCode); - } - else - { - jobject newElement_2_mfgCodeInsideOptional; - std::string newElement_2_mfgCodeInsideOptionalClassName = "java/lang/Integer"; - std::string newElement_2_mfgCodeInsideOptionalCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_mfgCodeInsideOptionalClassName.c_str(), - newElement_2_mfgCodeInsideOptionalCtorSignature.c_str(), static_cast(entry_2.mfgCode.Value()), - newElement_2_mfgCodeInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_mfgCodeInsideOptional, newElement_2_mfgCode); - } + std::string newElement_2_mfgCodeClassName = "java/lang/Integer"; + std::string newElement_2_mfgCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_mfgCodeClassName.c_str(), newElement_2_mfgCodeCtorSignature.c_str(), + static_cast(entry_2.mfgCode), newElement_2_mfgCode); jobject newElement_2_value; std::string newElement_2_valueClassName = "java/lang/Integer"; std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } - jclass modeTagStructStructClass_3; + jclass semanticTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$ModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$ModeSelectClusterSemanticTagStruct", + semanticTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterSemanticTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); - if (modeTagStructStructCtor_3 == nullptr) + jmethodID semanticTagStructStructCtor_3 = + env->GetMethodID(semanticTagStructStructClass_3, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (semanticTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterSemanticTagStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + newElement_2 = env->NewObject(semanticTagStructStructClass_3, semanticTagStructStructCtor_3, + newElement_2_mfgCode, newElement_2_value); + chip::JniReferences::GetInstance().AddToList(newElement_0_semanticTags, newElement_2); } jclass modeOptionStructStructClass_1; @@ -12034,7 +12013,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); + newElement_0_mode, newElement_0_semanticTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -12230,22 +12209,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::LaundryWasherModeSelect::Id: { - using namespace app::Clusters::LaundryWasherModeSelect; + case app::Clusters::LaundryWasherMode::Id: { + using namespace app::Clusters::LaundryWasherMode; switch (aPath.mAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } case Attributes::SupportedModes::Id: { using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; @@ -12299,55 +12266,42 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeSelectClusterModeTagStruct", - modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeTagStruct constructor"); return nullptr; } newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct", + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeOptionStruct"); return nullptr; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID( modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeOptionStruct constructor"); return nullptr; } @@ -12548,22 +12502,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id: { - using namespace app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect; + case app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { + using namespace app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode; switch (aPath.mAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } case Attributes::SupportedModes::Id: { using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; @@ -12617,69 +12559,52 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( env, - "chip/devicecontroller/" - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct", + "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class " - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct"); + ChipLogError( + Zcl, + "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError( - Zcl, - "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct " - "constructor"); + ChipLogError(Zcl, + "Could not find " + "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct constructor"); return nullptr; } newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, - "chip/devicecontroller/" - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct", + env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class " - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct"); + ChipLogError( + Zcl, + "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct"); return nullptr; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID( modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError( - Zcl, - "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct " - "constructor"); + ChipLogError(Zcl, + "Could not find " + "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct constructor"); return nullptr; } @@ -13096,22 +13021,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::RvcRunModeSelect::Id: { - using namespace app::Clusters::RvcRunModeSelect; + case app::Clusters::RvcRunMode::Id: { + using namespace app::Clusters::RvcRunMode; switch (aPath.mAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } case Attributes::SupportedModes::Id: { using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; @@ -13165,54 +13078,41 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeTagStruct constructor"); return nullptr; } newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeSelectClusterModeOptionStruct", - modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeOptionStruct"); return nullptr; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID( modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeOptionStruct constructor"); return nullptr; } @@ -13413,22 +13313,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::RvcCleanModeSelect::Id: { - using namespace app::Clusters::RvcCleanModeSelect; + case app::Clusters::RvcCleanMode::Id: { + using namespace app::Clusters::RvcCleanMode; switch (aPath.mAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } case Attributes::SupportedModes::Id: { using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; @@ -13482,55 +13370,41 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeSelectClusterModeTagStruct", - modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeTagStruct constructor"); return nullptr; } newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeSelectClusterModeOptionStruct", - modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeOptionStruct"); return nullptr; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID( modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeOptionStruct constructor"); return nullptr; } @@ -14129,22 +14003,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::DishwasherModeSelect::Id: { - using namespace app::Clusters::DishwasherModeSelect; + case app::Clusters::DishwasherMode::Id: { + using namespace app::Clusters::DishwasherMode; switch (aPath.mAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } case Attributes::SupportedModes::Id: { using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; @@ -14198,55 +14060,41 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeSelectClusterModeTagStruct", - modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeTagStruct constructor"); return nullptr; } newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeSelectClusterModeOptionStruct", - modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeOptionStruct"); return nullptr; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID( modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeOptionStruct constructor"); return nullptr; } @@ -15011,10 +14859,20 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_0_operationalStateIDClassName.c_str(), newElement_0_operationalStateIDCtorSignature.c_str(), - static_cast(entry_0.operationalStateID), newElement_0_operationalStateID); + entry_0.operationalStateID, newElement_0_operationalStateID); jobject newElement_0_operationalStateLabel; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel, - newElement_0_operationalStateLabel)); + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.operationalStateLabel.Value(), newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } jclass operationalStateStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -15026,7 +14884,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jmethodID operationalStateStructStructCtor_1 = - env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_1 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); @@ -15051,12 +14909,22 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value_operationalStateID; std::string value_operationalStateIDClassName = "java/lang/Integer"; std::string value_operationalStateIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - value_operationalStateIDClassName.c_str(), value_operationalStateIDCtorSignature.c_str(), - static_cast(cppValue.operationalStateID), value_operationalStateID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_operationalStateIDClassName.c_str(), + value_operationalStateIDCtorSignature.c_str(), + cppValue.operationalStateID, value_operationalStateID); jobject value_operationalStateLabel; - LogErrorOnFailure( - chip::JniReferences::GetInstance().CharToStringUTF(cppValue.operationalStateLabel, value_operationalStateLabel)); + if (!cppValue.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_operationalStateLabel); + } + else + { + jobject value_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.operationalStateLabel.Value(), + value_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_operationalStateLabelInsideOptional, + value_operationalStateLabel); + } jclass operationalStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( @@ -15068,7 +14936,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jmethodID operationalStateStructStructCtor_0 = - env->GetMethodID(operationalStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + env->GetMethodID(operationalStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_0 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); @@ -15091,18 +14959,20 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value_errorStateID; std::string value_errorStateIDClassName = "java/lang/Integer"; std::string value_errorStateIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - value_errorStateIDClassName.c_str(), value_errorStateIDCtorSignature.c_str(), - static_cast(cppValue.errorStateID), value_errorStateID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_errorStateIDClassName.c_str(), + value_errorStateIDCtorSignature.c_str(), + cppValue.errorStateID, value_errorStateID); jobject value_errorStateLabel; - if (cppValue.errorStateLabel.IsNull()) + if (!cppValue.errorStateLabel.HasValue()) { - value_errorStateLabel = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorStateLabel); } else { - LogErrorOnFailure( - chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateLabel.Value(), value_errorStateLabel)); + jobject value_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateLabel.Value(), + value_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorStateLabelInsideOptional, value_errorStateLabel); } jobject value_errorStateDetails; if (!cppValue.errorStateDetails.HasValue()) @@ -15126,7 +14996,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jmethodID errorStateStructStructCtor_0 = env->GetMethodID( - errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); @@ -15269,6 +15139,383 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::RvcOperationalState::Id: { + using namespace app::Clusters::RvcOperationalState; + switch (aPath.mAttributeId) + { + case Attributes::PhaseList::Id: { + using TypeInfo = Attributes::PhaseList::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 + { + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_1 = cppValue.Value().begin(); + while (iter_value_1.Next()) + { + auto & entry_1 = iter_value_1.GetValue(); + jobject newElement_1; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1, newElement_1)); + chip::JniReferences::GetInstance().AddToList(value, newElement_1); + } + } + return value; + } + case Attributes::CurrentPhase::Id: { + using TypeInfo = Attributes::CurrentPhase::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"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::CountdownTime::Id: { + using TypeInfo = Attributes::CountdownTime::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/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::OperationalStateList::Id: { + using TypeInfo = Attributes::OperationalStateList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_operationalStateID; + std::string newElement_0_operationalStateIDClassName = "java/lang/Integer"; + std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_operationalStateIDClassName.c_str(), newElement_0_operationalStateIDCtorSignature.c_str(), + entry_0.operationalStateID, newElement_0_operationalStateID); + jobject newElement_0_operationalStateLabel; + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.operationalStateLabel.Value(), newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } + + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterOperationalStateStruct"); + return nullptr; + } + jmethodID operationalStateStructStructCtor_1 = + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); + if (operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::OperationalState::Id: { + using TypeInfo = Attributes::OperationalState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_operationalStateID; + std::string value_operationalStateIDClassName = "java/lang/Integer"; + std::string value_operationalStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_operationalStateIDClassName.c_str(), + value_operationalStateIDCtorSignature.c_str(), + cppValue.operationalStateID, value_operationalStateID); + jobject value_operationalStateLabel; + if (!cppValue.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_operationalStateLabel); + } + else + { + jobject value_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.operationalStateLabel.Value(), + value_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_operationalStateLabelInsideOptional, + value_operationalStateLabel); + } + + jclass operationalStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterOperationalStateStruct"); + return nullptr; + } + jmethodID operationalStateStructStructCtor_0 = + env->GetMethodID(operationalStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); + if (operationalStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } + + value = env->NewObject(operationalStateStructStructClass_0, operationalStateStructStructCtor_0, + value_operationalStateID, value_operationalStateLabel); + return value; + } + case Attributes::OperationalError::Id: { + using TypeInfo = Attributes::OperationalError::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_errorStateID; + std::string value_errorStateIDClassName = "java/lang/Integer"; + std::string value_errorStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_errorStateIDClassName.c_str(), + value_errorStateIDCtorSignature.c_str(), + cppValue.errorStateID, value_errorStateID); + jobject value_errorStateLabel; + if (!cppValue.errorStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorStateLabel); + } + else + { + jobject value_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateLabel.Value(), + value_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorStateLabelInsideOptional, value_errorStateLabel); + } + jobject value_errorStateDetails; + if (!cppValue.errorStateDetails.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorStateDetails); + } + else + { + jobject value_errorStateDetailsInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateDetails.Value(), + value_errorStateDetailsInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorStateDetailsInsideOptional, value_errorStateDetails); + } + + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); + return nullptr; + } + jmethodID errorStateStructStructCtor_0 = env->GetMethodID( + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } + + value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, + value_errorStateLabel, value_errorStateDetails); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::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"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::HepaFilterMonitoring::Id: { using namespace app::Clusters::HepaFilterMonitoring; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index b7537c2e38ad24..9e3c8a92513186 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -475,30 +475,29 @@ typedef void (*ModeSelectEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ModeSelectAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*LaundryWasherModeSelectSupportedModesListAttributeCallback)( +typedef void (*LaundryWasherModeSupportedModesListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::LaundryWasherModeSelect::Structs::ModeOptionStruct::DecodableType> & data); -typedef void (*LaundryWasherModeSelectGeneratedCommandListListAttributeCallback)( + const chip::app::DataModel::DecodableList & + data); +typedef void (*LaundryWasherModeGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*LaundryWasherModeSelectAcceptedCommandListListAttributeCallback)( +typedef void (*LaundryWasherModeAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*LaundryWasherModeSelectEventListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*LaundryWasherModeSelectAttributeListListAttributeCallback)( +typedef void (*LaundryWasherModeEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*LaundryWasherModeAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesListAttributeCallback)( +typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSupportedModesListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Structs::ModeOptionStruct::DecodableType> & - data); -typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListListAttributeCallback)( + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::DecodableType> & data); +typedef void (*RefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListListAttributeCallback)( +typedef void (*RefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSelectEventListListAttributeCallback)( +typedef void (*RefrigeratorAndTemperatureControlledCabinetModeEventListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListListAttributeCallback)( +typedef void (*RefrigeratorAndTemperatureControlledCabinetModeAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*WasherControlsSpinSpeedsListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); @@ -510,30 +509,28 @@ typedef void (*WasherControlsEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*WasherControlsAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcRunModeSelectSupportedModesListAttributeCallback)( +typedef void (*RvcRunModeSupportedModesListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList & - data); -typedef void (*RvcRunModeSelectGeneratedCommandListListAttributeCallback)( + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcRunModeGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcRunModeSelectAcceptedCommandListListAttributeCallback)( +typedef void (*RvcRunModeAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcRunModeSelectEventListListAttributeCallback)(void * context, - const chip::app::DataModel::DecodableList & data); -typedef void (*RvcRunModeSelectAttributeListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcCleanModeSelectSupportedModesListAttributeCallback)( +typedef void (*RvcRunModeEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcRunModeAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcCleanModeSupportedModesListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList & - data); -typedef void (*RvcCleanModeSelectGeneratedCommandListListAttributeCallback)( + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcCleanModeGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcCleanModeSelectAcceptedCommandListListAttributeCallback)( +typedef void (*RvcCleanModeAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcCleanModeSelectEventListListAttributeCallback)(void * context, - const chip::app::DataModel::DecodableList & data); -typedef void (*RvcCleanModeSelectAttributeListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RvcCleanModeEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcCleanModeAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); typedef void (*TemperatureControlSupportedTemperatureLevelsListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*TemperatureControlGeneratedCommandListListAttributeCallback)( @@ -552,17 +549,17 @@ typedef void (*RefrigeratorAlarmEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*RefrigeratorAlarmAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*DishwasherModeSelectSupportedModesListAttributeCallback)( +typedef void (*DishwasherModeSupportedModesListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & data); -typedef void (*DishwasherModeSelectGeneratedCommandListListAttributeCallback)( +typedef void (*DishwasherModeGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*DishwasherModeSelectAcceptedCommandListListAttributeCallback)( +typedef void (*DishwasherModeAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*DishwasherModeSelectEventListListAttributeCallback)(void * context, - const chip::app::DataModel::DecodableList & data); -typedef void (*DishwasherModeSelectAttributeListListAttributeCallback)( +typedef void (*DishwasherModeEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*DishwasherModeAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); @@ -594,6 +591,20 @@ typedef void (*OperationalStateEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RvcOperationalStatePhaseListListAttributeCallback)( + void * context, const chip::app::DataModel::Nullable> & data); +typedef void (*RvcOperationalStateOperationalStateListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & data); +typedef void (*RvcOperationalStateGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RvcOperationalStateAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RvcOperationalStateEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcOperationalStateAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HepaFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HepaFilterMonitoringAcceptedCommandListListAttributeCallback)( diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index 237ebacd4ac70c..4fe9a9ebc89a9e 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -2342,12 +2342,12 @@ JNI_METHOD(void, ModeSelectCluster, writeOnModeAttribute) onFailure.release(); } -JNI_METHOD(void, LaundryWasherModeSelectCluster, writeStartUpModeAttribute) +JNI_METHOD(void, LaundryWasherModeCluster, writeStartUpModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::LaundryWasherModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = chip::app::Clusters::LaundryWasherMode::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2376,8 +2376,8 @@ JNI_METHOD(void, LaundryWasherModeSelectCluster, writeStartUpModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LaundryWasherModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LaundryWasherModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2402,12 +2402,12 @@ JNI_METHOD(void, LaundryWasherModeSelectCluster, writeStartUpModeAttribute) onFailure.release(); } -JNI_METHOD(void, LaundryWasherModeSelectCluster, writeOnModeAttribute) +JNI_METHOD(void, LaundryWasherModeCluster, writeOnModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::LaundryWasherModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = chip::app::Clusters::LaundryWasherMode::Attributes::OnMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2436,8 +2436,8 @@ JNI_METHOD(void, LaundryWasherModeSelectCluster, writeOnModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LaundryWasherModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LaundryWasherModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2462,12 +2462,12 @@ JNI_METHOD(void, LaundryWasherModeSelectCluster, writeOnModeAttribute) onFailure.release(); } -JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeSelectCluster, writeStartUpModeAttribute) +JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeCluster, writeStartUpModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2497,8 +2497,8 @@ JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeSelectCluster, w env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - RefrigeratorAndTemperatureControlledCabinetModeSelectCluster * cppCluster = - reinterpret_cast(clusterPtr); + RefrigeratorAndTemperatureControlledCabinetModeCluster * cppCluster = + reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2523,12 +2523,12 @@ JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeSelectCluster, w onFailure.release(); } -JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeSelectCluster, writeOnModeAttribute) +JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeCluster, writeOnModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::OnMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2558,8 +2558,8 @@ JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeSelectCluster, w env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - RefrigeratorAndTemperatureControlledCabinetModeSelectCluster * cppCluster = - reinterpret_cast(clusterPtr); + RefrigeratorAndTemperatureControlledCabinetModeCluster * cppCluster = + reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2704,12 +2704,12 @@ JNI_METHOD(void, WasherControlsCluster, writeNumberOfRinsesAttribute) onFailure.release(); } -JNI_METHOD(void, RvcRunModeSelectCluster, writeStartUpModeAttribute) +JNI_METHOD(void, RvcRunModeCluster, writeStartUpModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RvcRunModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RvcRunMode::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2738,8 +2738,8 @@ JNI_METHOD(void, RvcRunModeSelectCluster, writeStartUpModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RvcRunModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RvcRunModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2764,12 +2764,12 @@ JNI_METHOD(void, RvcRunModeSelectCluster, writeStartUpModeAttribute) onFailure.release(); } -JNI_METHOD(void, RvcRunModeSelectCluster, writeOnModeAttribute) +JNI_METHOD(void, RvcRunModeCluster, writeOnModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RvcRunModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RvcRunMode::Attributes::OnMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2798,8 +2798,8 @@ JNI_METHOD(void, RvcRunModeSelectCluster, writeOnModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RvcRunModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RvcRunModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2824,12 +2824,12 @@ JNI_METHOD(void, RvcRunModeSelectCluster, writeOnModeAttribute) onFailure.release(); } -JNI_METHOD(void, RvcCleanModeSelectCluster, writeStartUpModeAttribute) +JNI_METHOD(void, RvcCleanModeCluster, writeStartUpModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RvcCleanModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RvcCleanMode::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2858,8 +2858,8 @@ JNI_METHOD(void, RvcCleanModeSelectCluster, writeStartUpModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RvcCleanModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RvcCleanModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2884,12 +2884,12 @@ JNI_METHOD(void, RvcCleanModeSelectCluster, writeStartUpModeAttribute) onFailure.release(); } -JNI_METHOD(void, RvcCleanModeSelectCluster, writeOnModeAttribute) +JNI_METHOD(void, RvcCleanModeCluster, writeOnModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RvcCleanModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RvcCleanMode::Attributes::OnMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2918,8 +2918,8 @@ JNI_METHOD(void, RvcCleanModeSelectCluster, writeOnModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RvcCleanModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RvcCleanModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2944,12 +2944,12 @@ JNI_METHOD(void, RvcCleanModeSelectCluster, writeOnModeAttribute) onFailure.release(); } -JNI_METHOD(void, DishwasherModeSelectCluster, writeStartUpModeAttribute) +JNI_METHOD(void, DishwasherModeCluster, writeStartUpModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::DishwasherModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = chip::app::Clusters::DishwasherMode::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2978,8 +2978,8 @@ JNI_METHOD(void, DishwasherModeSelectCluster, writeStartUpModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DishwasherModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DishwasherModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -3004,12 +3004,12 @@ JNI_METHOD(void, DishwasherModeSelectCluster, writeStartUpModeAttribute) onFailure.release(); } -JNI_METHOD(void, DishwasherModeSelectCluster, writeOnModeAttribute) +JNI_METHOD(void, DishwasherModeCluster, writeOnModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::DishwasherModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = chip::app::Clusters::DishwasherMode::Attributes::OnMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -3038,8 +3038,8 @@ JNI_METHOD(void, DishwasherModeSelectCluster, writeOnModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DishwasherModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DishwasherModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 03ebc2ef9083f4..ea8d604224fa77 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -2425,8 +2425,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::LaundryWasherModeSelect::Id: { - using namespace app::Clusters::LaundryWasherModeSelect; + case app::Clusters::LaundryWasherMode::Id: { + using namespace app::Clusters::LaundryWasherMode; switch (aPath.mEventId) { default: @@ -2435,8 +2435,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id: { - using namespace app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect; + case app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { + using namespace app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode; switch (aPath.mEventId) { default: @@ -2455,8 +2455,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::RvcRunModeSelect::Id: { - using namespace app::Clusters::RvcRunModeSelect; + case app::Clusters::RvcRunMode::Id: { + using namespace app::Clusters::RvcRunMode; switch (aPath.mEventId) { default: @@ -2465,8 +2465,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::RvcCleanModeSelect::Id: { - using namespace app::Clusters::RvcCleanModeSelect; + case app::Clusters::RvcCleanMode::Id: { + using namespace app::Clusters::RvcCleanMode; switch (aPath.mEventId) { default: @@ -2547,8 +2547,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::DishwasherModeSelect::Id: { - using namespace app::Clusters::DishwasherModeSelect; + case app::Clusters::DishwasherMode::Id: { + using namespace app::Clusters::DishwasherMode; switch (aPath.mEventId) { default: @@ -2883,16 +2883,19 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & std::string value_errorState_errorStateIDCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( value_errorState_errorStateIDClassName.c_str(), value_errorState_errorStateIDCtorSignature.c_str(), - static_cast(cppValue.errorState.errorStateID), value_errorState_errorStateID); + cppValue.errorState.errorStateID, value_errorState_errorStateID); jobject value_errorState_errorStateLabel; - if (cppValue.errorState.errorStateLabel.IsNull()) + if (!cppValue.errorState.errorStateLabel.HasValue()) { - value_errorState_errorStateLabel = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorState_errorStateLabel); } else { - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorState.errorStateLabel.Value(), - value_errorState_errorStateLabel)); + jobject value_errorState_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.errorState.errorStateLabel.Value(), value_errorState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorState_errorStateLabelInsideOptional, + value_errorState_errorStateLabel); } jobject value_errorState_errorStateDetails; if (!cppValue.errorState.errorStateDetails.HasValue()) @@ -2917,7 +2920,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & return nullptr; } jmethodID errorStateStructStructCtor_0 = env->GetMethodID( - errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); @@ -2960,9 +2963,9 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jobject value_completionErrorCode; std::string value_completionErrorCodeClassName = "java/lang/Integer"; std::string value_completionErrorCodeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - value_completionErrorCodeClassName.c_str(), value_completionErrorCodeCtorSignature.c_str(), - static_cast(cppValue.completionErrorCode), value_completionErrorCode); + chip::JniReferences::GetInstance().CreateBoxedObject(value_completionErrorCodeClassName.c_str(), + value_completionErrorCodeCtorSignature.c_str(), + cppValue.completionErrorCode, value_completionErrorCode); jobject value_totalOperationalTime; if (!cppValue.totalOperationalTime.HasValue()) @@ -3040,6 +3043,183 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::RvcOperationalState::Id: { + using namespace app::Clusters::RvcOperationalState; + switch (aPath.mEventId) + { + case Events::OperationalError::Id: { + Events::OperationalError::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_errorState; + jobject value_errorState_errorStateID; + std::string value_errorState_errorStateIDClassName = "java/lang/Integer"; + std::string value_errorState_errorStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_errorState_errorStateIDClassName.c_str(), value_errorState_errorStateIDCtorSignature.c_str(), + cppValue.errorState.errorStateID, value_errorState_errorStateID); + jobject value_errorState_errorStateLabel; + if (!cppValue.errorState.errorStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorState_errorStateLabel); + } + else + { + jobject value_errorState_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.errorState.errorStateLabel.Value(), value_errorState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorState_errorStateLabelInsideOptional, + value_errorState_errorStateLabel); + } + jobject value_errorState_errorStateDetails; + if (!cppValue.errorState.errorStateDetails.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorState_errorStateDetails); + } + else + { + jobject value_errorState_errorStateDetailsInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.errorState.errorStateDetails.Value(), value_errorState_errorStateDetailsInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorState_errorStateDetailsInsideOptional, + value_errorState_errorStateDetails); + } + + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); + return nullptr; + } + jmethodID errorStateStructStructCtor_0 = env->GetMethodID( + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } + + value_errorState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, + value_errorState_errorStateLabel, value_errorState_errorStateDetails); + + jclass operationalErrorStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$RvcOperationalStateClusterOperationalErrorEvent", + operationalErrorStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$RvcOperationalStateClusterOperationalErrorEvent"); + return nullptr; + } + jmethodID operationalErrorStructCtor = + env->GetMethodID(operationalErrorStructClass, "", + "(Lchip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct;)V"); + if (operationalErrorStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$RvcOperationalStateClusterOperationalErrorEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(operationalErrorStructClass, operationalErrorStructCtor, value_errorState); + + return value; + } + case Events::OperationCompletion::Id: { + Events::OperationCompletion::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_completionErrorCode; + std::string value_completionErrorCodeClassName = "java/lang/Integer"; + std::string value_completionErrorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_completionErrorCodeClassName.c_str(), + value_completionErrorCodeCtorSignature.c_str(), + cppValue.completionErrorCode, value_completionErrorCode); + + jobject value_totalOperationalTime; + if (!cppValue.totalOperationalTime.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_totalOperationalTime); + } + else + { + jobject value_totalOperationalTimeInsideOptional; + if (cppValue.totalOperationalTime.Value().IsNull()) + { + value_totalOperationalTimeInsideOptional = nullptr; + } + else + { + std::string value_totalOperationalTimeInsideOptionalClassName = "java/lang/Long"; + std::string value_totalOperationalTimeInsideOptionalCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_totalOperationalTimeInsideOptionalClassName.c_str(), + value_totalOperationalTimeInsideOptionalCtorSignature.c_str(), + cppValue.totalOperationalTime.Value().Value(), value_totalOperationalTimeInsideOptional); + } + chip::JniReferences::GetInstance().CreateOptional(value_totalOperationalTimeInsideOptional, + value_totalOperationalTime); + } + + jobject value_pausedTime; + if (!cppValue.pausedTime.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_pausedTime); + } + else + { + jobject value_pausedTimeInsideOptional; + if (cppValue.pausedTime.Value().IsNull()) + { + value_pausedTimeInsideOptional = nullptr; + } + else + { + std::string value_pausedTimeInsideOptionalClassName = "java/lang/Long"; + std::string value_pausedTimeInsideOptionalCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_pausedTimeInsideOptionalClassName.c_str(), value_pausedTimeInsideOptionalCtorSignature.c_str(), + cppValue.pausedTime.Value().Value(), value_pausedTimeInsideOptional); + } + chip::JniReferences::GetInstance().CreateOptional(value_pausedTimeInsideOptional, value_pausedTime); + } + + jclass operationCompletionStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$RvcOperationalStateClusterOperationCompletionEvent", + operationCompletionStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$RvcOperationalStateClusterOperationCompletionEvent"); + return nullptr; + } + jmethodID operationCompletionStructCtor = env->GetMethodID( + operationCompletionStructClass, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (operationCompletionStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$RvcOperationalStateClusterOperationCompletionEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(operationCompletionStructClass, operationCompletionStructCtor, value_completionErrorCode, + value_totalOperationalTime, value_pausedTime); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::HepaFilterMonitoring::Id: { using namespace app::Clusters::HepaFilterMonitoring; switch (aPath.mEventId) diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index dacb197027abec..0abae72ad343c9 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -2811,8 +2811,9 @@ void CHIPIcdManagementClusterRegisterClientResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, ICDCounter); } -CHIPModeSelectClusterChangeToModeResponseCallback::CHIPModeSelectClusterChangeToModeResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPLaundryWasherModeClusterChangeToModeResponseCallback::CHIPLaundryWasherModeClusterChangeToModeResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2828,7 +2829,7 @@ CHIPModeSelectClusterChangeToModeResponseCallback::CHIPModeSelectClusterChangeTo } } -CHIPModeSelectClusterChangeToModeResponseCallback::~CHIPModeSelectClusterChangeToModeResponseCallback() +CHIPLaundryWasherModeClusterChangeToModeResponseCallback::~CHIPLaundryWasherModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2839,8 +2840,8 @@ CHIPModeSelectClusterChangeToModeResponseCallback::~CHIPModeSelectClusterChangeT env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPModeSelectClusterChangeToModeResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType & dataResponse) +void CHIPLaundryWasherModeClusterChangeToModeResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -2850,10 +2851,10 @@ void CHIPModeSelectClusterChangeToModeResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -2884,9 +2885,9 @@ void CHIPModeSelectClusterChangeToModeResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); } -CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2902,7 +2903,8 @@ CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::CHIPLaundryWashe } } -CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::~CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2913,9 +2915,10 @@ CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::~CHIPLaundryWash env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback::CallbackFn( void * context, - const chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType & dataResponse) + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType & + dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -2925,10 +2928,11 @@ void CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -2959,10 +2963,8 @@ void CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, - this) +CHIPRvcRunModeClusterChangeToModeResponseCallback::CHIPRvcRunModeClusterChangeToModeResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2978,8 +2980,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResp } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback() +CHIPRvcRunModeClusterChangeToModeResponseCallback::~CHIPRvcRunModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2990,10 +2991,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResp env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback::CallbackFn( - void * context, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeResponse:: - DecodableType & dataResponse) +void CHIPRvcRunModeClusterChangeToModeResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3003,12 +3002,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToMod VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback( - reinterpret_cast( - context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -3039,9 +3036,8 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToMod env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); } -CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::CHIPRvcRunModeSelectClusterChangeToModeResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPRvcCleanModeClusterChangeToModeResponseCallback::CHIPRvcCleanModeClusterChangeToModeResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3057,7 +3053,7 @@ CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::CHIPRvcRunModeSelectClu } } -CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::~CHIPRvcRunModeSelectClusterChangeToModeResponseCallback() +CHIPRvcCleanModeClusterChangeToModeResponseCallback::~CHIPRvcCleanModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3068,8 +3064,8 @@ CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::~CHIPRvcRunModeSelectCl env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType & dataResponse) +void CHIPRvcCleanModeClusterChangeToModeResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3079,10 +3075,10 @@ void CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -3113,9 +3109,8 @@ void CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); } -CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPDishwasherModeClusterChangeToModeResponseCallback::CHIPDishwasherModeClusterChangeToModeResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3131,7 +3126,7 @@ CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::CHIPRvcCleanModeSelec } } -CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::~CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback() +CHIPDishwasherModeClusterChangeToModeResponseCallback::~CHIPDishwasherModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3142,8 +3137,8 @@ CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::~CHIPRvcCleanModeSele env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType & dataResponse) +void CHIPDishwasherModeClusterChangeToModeResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3153,10 +3148,10 @@ void CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -3187,9 +3182,9 @@ void CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); } -CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::CHIPDishwasherModeSelectClusterChangeToModeResponseCallback( +CHIPOperationalStateClusterOperationalCommandResponseCallback::CHIPOperationalStateClusterOperationalCommandResponseCallback( jobject javaCallback) : - Callback::Callback(CallbackFn, this) + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3205,7 +3200,7 @@ CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::CHIPDishwasherModeS } } -CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::~CHIPDishwasherModeSelectClusterChangeToModeResponseCallback() +CHIPOperationalStateClusterOperationalCommandResponseCallback::~CHIPOperationalStateClusterOperationalCommandResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3216,8 +3211,8 @@ CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::~CHIPDishwasherMode env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType & dataResponse) +void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3227,43 +3222,80 @@ void CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/Optional;)V", + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Lchip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject Status; - std::string StatusClassName = "java/lang/Integer"; - std::string StatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), - dataResponse.status, Status); - jobject StatusText; - if (!dataResponse.statusText.HasValue()) + jobject CommandResponseState; + jobject CommandResponseState_errorStateID; + std::string CommandResponseState_errorStateIDClassName = "java/lang/Integer"; + std::string CommandResponseState_errorStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + CommandResponseState_errorStateIDClassName.c_str(), CommandResponseState_errorStateIDCtorSignature.c_str(), + dataResponse.commandResponseState.errorStateID, CommandResponseState_errorStateID); + jobject CommandResponseState_errorStateLabel; + if (!dataResponse.commandResponseState.errorStateLabel.HasValue()) { - chip::JniReferences::GetInstance().CreateOptional(nullptr, StatusText); + chip::JniReferences::GetInstance().CreateOptional(nullptr, CommandResponseState_errorStateLabel); } else { - jobject StatusTextInsideOptional; - LogErrorOnFailure( - chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.statusText.Value(), StatusTextInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(StatusTextInsideOptional, StatusText); + jobject CommandResponseState_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + dataResponse.commandResponseState.errorStateLabel.Value(), CommandResponseState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(CommandResponseState_errorStateLabelInsideOptional, + CommandResponseState_errorStateLabel); + } + jobject CommandResponseState_errorStateDetails; + if (!dataResponse.commandResponseState.errorStateDetails.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, CommandResponseState_errorStateDetails); + } + else + { + jobject CommandResponseState_errorStateDetailsInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + dataResponse.commandResponseState.errorStateDetails.Value(), CommandResponseState_errorStateDetailsInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(CommandResponseState_errorStateDetailsInsideOptional, + CommandResponseState_errorStateDetails); } - env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); + return; + } + jmethodID errorStateStructStructCtor_0 = + env->GetMethodID(errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); + return; + } + + CommandResponseState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, CommandResponseState_errorStateID, + CommandResponseState_errorStateLabel, CommandResponseState_errorStateDetails); + + env->CallVoidMethod(javaCallbackRef, javaMethod, CommandResponseState); } -CHIPOperationalStateClusterOperationalCommandResponseCallback::CHIPOperationalStateClusterOperationalCommandResponseCallback( +CHIPRvcOperationalStateClusterOperationalCommandResponseCallback::CHIPRvcOperationalStateClusterOperationalCommandResponseCallback( jobject javaCallback) : - Callback::Callback(CallbackFn, this) + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3279,7 +3311,8 @@ CHIPOperationalStateClusterOperationalCommandResponseCallback::CHIPOperationalSt } } -CHIPOperationalStateClusterOperationalCommandResponseCallback::~CHIPOperationalStateClusterOperationalCommandResponseCallback() +CHIPRvcOperationalStateClusterOperationalCommandResponseCallback:: + ~CHIPRvcOperationalStateClusterOperationalCommandResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3290,8 +3323,9 @@ CHIPOperationalStateClusterOperationalCommandResponseCallback::~CHIPOperationalS env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & dataResponse) +void CHIPRvcOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3301,19 +3335,19 @@ void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", - "(Lchip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct;)V", - &javaMethod); + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", "(Lchip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); jobject CommandResponseState; @@ -3322,16 +3356,19 @@ void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( std::string CommandResponseState_errorStateIDCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( CommandResponseState_errorStateIDClassName.c_str(), CommandResponseState_errorStateIDCtorSignature.c_str(), - static_cast(dataResponse.commandResponseState.errorStateID), CommandResponseState_errorStateID); + dataResponse.commandResponseState.errorStateID, CommandResponseState_errorStateID); jobject CommandResponseState_errorStateLabel; - if (dataResponse.commandResponseState.errorStateLabel.IsNull()) + if (!dataResponse.commandResponseState.errorStateLabel.HasValue()) { - CommandResponseState_errorStateLabel = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, CommandResponseState_errorStateLabel); } else { + jobject CommandResponseState_errorStateLabelInsideOptional; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( - dataResponse.commandResponseState.errorStateLabel.Value(), CommandResponseState_errorStateLabel)); + dataResponse.commandResponseState.errorStateLabel.Value(), CommandResponseState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(CommandResponseState_errorStateLabelInsideOptional, + CommandResponseState_errorStateLabel); } jobject CommandResponseState_errorStateDetails; if (!dataResponse.commandResponseState.errorStateDetails.HasValue()) @@ -3349,17 +3386,17 @@ void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( jclass errorStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); return; } jmethodID errorStateStructStructCtor_0 = - env->GetMethodID(errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + env->GetMethodID(errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); return; } diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 585195f541e966..2f93fd858fbec2 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -464,108 +464,109 @@ class CHIPIcdManagementClusterRegisterClientResponseCallback jobject javaCallbackRef; }; -class CHIPModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback +class CHIPLaundryWasherModeClusterChangeToModeResponseCallback + : public Callback::Callback { public: - CHIPModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); + CHIPLaundryWasherModeClusterChangeToModeResponseCallback(jobject javaCallback); - ~CHIPModeSelectClusterChangeToModeResponseCallback(); + ~CHIPLaundryWasherModeClusterChangeToModeResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType & data); + const chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType & data); private: jobject javaCallbackRef; }; -class CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback +class CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback + : public Callback::Callback { public: - CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); + CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(jobject javaCallback); - ~CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback(); + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(); - static void - CallbackFn(void * context, - const chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType & data); + static void CallbackFn( + void * context, + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType & + data); private: jobject javaCallbackRef; }; -class CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback +class CHIPRvcRunModeClusterChangeToModeResponseCallback + : public Callback::Callback { public: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); + CHIPRvcRunModeClusterChangeToModeResponseCallback(jobject javaCallback); - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback(); + ~CHIPRvcRunModeClusterChangeToModeResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands:: - ChangeToModeResponse::DecodableType & data); + const chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::DecodableType & data); private: jobject javaCallbackRef; }; -class CHIPRvcRunModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback +class CHIPRvcCleanModeClusterChangeToModeResponseCallback + : public Callback::Callback { public: - CHIPRvcRunModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); + CHIPRvcCleanModeClusterChangeToModeResponseCallback(jobject javaCallback); - ~CHIPRvcRunModeSelectClusterChangeToModeResponseCallback(); + ~CHIPRvcCleanModeClusterChangeToModeResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType & data); + const chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::DecodableType & data); private: jobject javaCallbackRef; }; -class CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback +class CHIPDishwasherModeClusterChangeToModeResponseCallback + : public Callback::Callback { public: - CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); + CHIPDishwasherModeClusterChangeToModeResponseCallback(jobject javaCallback); - ~CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback(); + ~CHIPDishwasherModeClusterChangeToModeResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType & data); + const chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::DecodableType & data); private: jobject javaCallbackRef; }; -class CHIPDishwasherModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback +class CHIPOperationalStateClusterOperationalCommandResponseCallback + : public Callback::Callback { public: - CHIPDishwasherModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); + CHIPOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback); - ~CHIPDishwasherModeSelectClusterChangeToModeResponseCallback(); + ~CHIPOperationalStateClusterOperationalCommandResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType & data); + const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data); private: jobject javaCallbackRef; }; -class CHIPOperationalStateClusterOperationalCommandResponseCallback - : public Callback::Callback +class CHIPRvcOperationalStateClusterOperationalCommandResponseCallback + : public Callback::Callback { public: - CHIPOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback); + CHIPRvcOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback); - ~CHIPOperationalStateClusterOperationalCommandResponseCallback(); + ~CHIPRvcOperationalStateClusterOperationalCommandResponseCallback(); - static void CallbackFn(void * context, - const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data); + static void + CallbackFn(void * context, + const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & data); private: jobject javaCallbackRef; diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 23be9ec0902b8f..215fd94d28c22f 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -19764,66 +19764,45 @@ void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( std::string newElement_0_modeCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_0_modeClassName.c_str(), newElement_0_modeCtorSignature.c_str(), entry_0.mode, newElement_0_mode); - jobject newElement_0_modeTags; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_modeTags); + jobject newElement_0_semanticTags; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_semanticTags); - auto iter_newElement_0_modeTags_2 = entry_0.modeTags.begin(); - while (iter_newElement_0_modeTags_2.Next()) + auto iter_newElement_0_semanticTags_2 = entry_0.semanticTags.begin(); + while (iter_newElement_0_semanticTags_2.Next()) { - auto & entry_2 = iter_newElement_0_modeTags_2.GetValue(); + auto & entry_2 = iter_newElement_0_semanticTags_2.GetValue(); jobject newElement_2; jobject newElement_2_mfgCode; - if (!entry_2.mfgCode.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_mfgCode); - } - else - { - jobject newElement_2_mfgCodeInsideOptional; - std::string newElement_2_mfgCodeInsideOptionalClassName = "java/lang/Integer"; - std::string newElement_2_mfgCodeInsideOptionalCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_mfgCodeInsideOptionalClassName.c_str(), newElement_2_mfgCodeInsideOptionalCtorSignature.c_str(), - static_cast(entry_2.mfgCode.Value()), newElement_2_mfgCodeInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_mfgCodeInsideOptional, newElement_2_mfgCode); - } + std::string newElement_2_mfgCodeClassName = "java/lang/Integer"; + std::string newElement_2_mfgCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_mfgCodeClassName.c_str(), newElement_2_mfgCodeCtorSignature.c_str(), + static_cast(entry_2.mfgCode), newElement_2_mfgCode); jobject newElement_2_value; std::string newElement_2_valueClassName = "java/lang/Integer"; std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } - jclass modeTagStructStructClass_3; + jclass semanticTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$ModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$ModeSelectClusterSemanticTagStruct", semanticTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterSemanticTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); - if (modeTagStructStructCtor_3 == nullptr) + jmethodID semanticTagStructStructCtor_3 = + env->GetMethodID(semanticTagStructStructClass_3, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (semanticTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterSemanticTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + newElement_2 = env->NewObject(semanticTagStructStructClass_3, semanticTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + chip::JniReferences::GetInstance().AddToList(newElement_0_semanticTags, newElement_2); } jclass modeOptionStructStructClass_1; @@ -19843,7 +19822,7 @@ void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( } newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); + newElement_0_mode, newElement_0_semanticTags); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -20259,9 +20238,9 @@ void CHIPModeSelectAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CHIPLaundryWasherModeSelectSupportedModesAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPLaundryWasherModeSupportedModesAttributeCallback::CHIPLaundryWasherModeSupportedModesAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20278,7 +20257,7 @@ CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CHIPLaundryWasherMod } } -CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::~CHIPLaundryWasherModeSelectSupportedModesAttributeCallback() +CHIPLaundryWasherModeSupportedModesAttributeCallback::~CHIPLaundryWasherModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20289,10 +20268,10 @@ CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::~CHIPLaundryWasherMo env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CallbackFn( +void CHIPLaundryWasherModeSupportedModesAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::LaundryWasherModeSelect::Structs::ModeOptionStruct::DecodableType> & list) + const chip::app::DataModel::DecodableList & + list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -20301,8 +20280,8 @@ void CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20356,53 +20335,41 @@ void CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CallbackFn( std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2 = + env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeOptionStruct"); return; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID(modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeOptionStruct constructor"); return; } @@ -20415,9 +20382,9 @@ void CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::CHIPLaundryWasherModeSelectStartUpModeAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPLaundryWasherModeStartUpModeAttributeCallback::CHIPLaundryWasherModeStartUpModeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20434,7 +20401,7 @@ CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::CHIPLaundryWasherModeSe } } -CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::~CHIPLaundryWasherModeSelectStartUpModeAttributeCallback() +CHIPLaundryWasherModeStartUpModeAttributeCallback::~CHIPLaundryWasherModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20445,8 +20412,8 @@ CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::~CHIPLaundryWasherModeS env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPLaundryWasherModeStartUpModeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -20454,8 +20421,8 @@ void CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20482,10 +20449,8 @@ void CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPLaundryWasherModeSelectOnModeAttributeCallback::CHIPLaundryWasherModeSelectOnModeAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPLaundryWasherModeOnModeAttributeCallback::CHIPLaundryWasherModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20501,7 +20466,7 @@ CHIPLaundryWasherModeSelectOnModeAttributeCallback::CHIPLaundryWasherModeSelectO } } -CHIPLaundryWasherModeSelectOnModeAttributeCallback::~CHIPLaundryWasherModeSelectOnModeAttributeCallback() +CHIPLaundryWasherModeOnModeAttributeCallback::~CHIPLaundryWasherModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20512,8 +20477,7 @@ CHIPLaundryWasherModeSelectOnModeAttributeCallback::~CHIPLaundryWasherModeSelect env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectOnModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPLaundryWasherModeOnModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -20521,8 +20485,8 @@ void CHIPLaundryWasherModeSelectOnModeAttributeCallback::CallbackFn(void * conte jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20549,9 +20513,9 @@ void CHIPLaundryWasherModeSelectOnModeAttributeCallback::CallbackFn(void * conte env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback::CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback( +CHIPLaundryWasherModeGeneratedCommandListAttributeCallback::CHIPLaundryWasherModeGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20568,8 +20532,7 @@ CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback::CHIPLaundryWas } } -CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback:: - ~CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback() +CHIPLaundryWasherModeGeneratedCommandListAttributeCallback::~CHIPLaundryWasherModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20580,7 +20543,7 @@ CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPLaundryWasherModeGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -20590,8 +20553,8 @@ void CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback::CallbackF VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20621,9 +20584,9 @@ void CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback::CallbackF env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback( +CHIPLaundryWasherModeAcceptedCommandListAttributeCallback::CHIPLaundryWasherModeAcceptedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20640,7 +20603,7 @@ CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::CHIPLaundryWash } } -CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::~CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback() +CHIPLaundryWasherModeAcceptedCommandListAttributeCallback::~CHIPLaundryWasherModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20651,7 +20614,7 @@ CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::~CHIPLaundryWas env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPLaundryWasherModeAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -20661,8 +20624,8 @@ void CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20692,9 +20655,9 @@ void CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPLaundryWasherModeSelectEventListAttributeCallback::CHIPLaundryWasherModeSelectEventListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPLaundryWasherModeEventListAttributeCallback::CHIPLaundryWasherModeEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20711,7 +20674,7 @@ CHIPLaundryWasherModeSelectEventListAttributeCallback::CHIPLaundryWasherModeSele } } -CHIPLaundryWasherModeSelectEventListAttributeCallback::~CHIPLaundryWasherModeSelectEventListAttributeCallback() +CHIPLaundryWasherModeEventListAttributeCallback::~CHIPLaundryWasherModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20722,8 +20685,8 @@ CHIPLaundryWasherModeSelectEventListAttributeCallback::~CHIPLaundryWasherModeSel env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectEventListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPLaundryWasherModeEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -20732,8 +20695,8 @@ void CHIPLaundryWasherModeSelectEventListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20763,9 +20726,9 @@ void CHIPLaundryWasherModeSelectEventListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPLaundryWasherModeSelectAttributeListAttributeCallback::CHIPLaundryWasherModeSelectAttributeListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPLaundryWasherModeAttributeListAttributeCallback::CHIPLaundryWasherModeAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20782,7 +20745,7 @@ CHIPLaundryWasherModeSelectAttributeListAttributeCallback::CHIPLaundryWasherMode } } -CHIPLaundryWasherModeSelectAttributeListAttributeCallback::~CHIPLaundryWasherModeSelectAttributeListAttributeCallback() +CHIPLaundryWasherModeAttributeListAttributeCallback::~CHIPLaundryWasherModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20793,7 +20756,7 @@ CHIPLaundryWasherModeSelectAttributeListAttributeCallback::~CHIPLaundryWasherMod env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectAttributeListAttributeCallback::CallbackFn( +void CHIPLaundryWasherModeAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -20803,8 +20766,8 @@ void CHIPLaundryWasherModeSelectAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20834,9 +20797,9 @@ void CHIPLaundryWasherModeSelectAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback( +CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) { @@ -20854,8 +20817,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttribute } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20866,11 +20829,10 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttribute env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Structs::ModeOptionStruct::DecodableType> & - list) + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::DecodableType> & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -20879,11 +20841,9 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttr VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr - cppCallback( - reinterpret_cast(context), - maybeDestroy); + std::unique_ptr + cppCallback(reinterpret_cast(context), + maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20937,63 +20897,49 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttr std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct", + env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { ChipLogError( - Zcl, - "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct"); + Zcl, "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct " - "constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2 = + env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct", + env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, - "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, + "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct"); return; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID(modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct " - "constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct constructor"); return; } @@ -21006,10 +20952,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttr env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback( - CallbackFn, this), +CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, + this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -21026,8 +20972,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCal } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21038,7 +20984,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCal env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; @@ -21047,10 +20993,9 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttribu jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr - cppCallback( - reinterpret_cast(context), - maybeDestroy); + std::unique_ptr + cppCallback(reinterpret_cast(context), + maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -21077,10 +21022,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttribu env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback( - CallbackFn, this), +CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, + this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -21097,8 +21042,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21109,7 +21054,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; @@ -21118,8 +21063,8 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCal jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr - cppCallback(reinterpret_cast(context), + std::unique_ptr + cppCallback(reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. @@ -21147,12 +21092,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCal env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback< - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterGeneratedCommandListAttributeCallbackType>(CallbackFn, - this), +CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback( + CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -21169,8 +21112,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAtt } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21181,7 +21124,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAtt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -21191,11 +21134,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandLi VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast( - context), + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. @@ -21226,11 +21168,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandLi env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback< - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterAcceptedCommandListAttributeCallbackType>(CallbackFn, this), +CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback( + CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -21247,8 +21188,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttr } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21259,7 +21200,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttr env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -21269,11 +21210,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandLis VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast( - context), + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. @@ -21304,10 +21244,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandLis env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback( - CallbackFn, this), +CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, + this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -21324,8 +21264,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallb } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21336,7 +21276,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallb env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -21346,10 +21286,9 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttribute VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr - cppCallback( - reinterpret_cast(context), - maybeDestroy); + std::unique_ptr + cppCallback(reinterpret_cast(context), + maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -21379,9 +21318,9 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttribute env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback( +CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) { @@ -21399,8 +21338,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeC } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21411,7 +21350,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeC env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -21421,11 +21360,9 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttri VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr - cppCallback( - reinterpret_cast(context), - maybeDestroy); + std::unique_ptr + cppCallback(reinterpret_cast(context), + maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -21937,10 +21874,8 @@ void CHIPWasherControlsAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcRunModeSelectSupportedModesAttributeCallback::CHIPRvcRunModeSelectSupportedModesAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcRunModeSupportedModesAttributeCallback::CHIPRvcRunModeSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21956,7 +21891,7 @@ CHIPRvcRunModeSelectSupportedModesAttributeCallback::CHIPRvcRunModeSelectSupport } } -CHIPRvcRunModeSelectSupportedModesAttributeCallback::~CHIPRvcRunModeSelectSupportedModesAttributeCallback() +CHIPRvcRunModeSupportedModesAttributeCallback::~CHIPRvcRunModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21967,10 +21902,9 @@ CHIPRvcRunModeSelectSupportedModesAttributeCallback::~CHIPRvcRunModeSelectSuppor env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectSupportedModesAttributeCallback::CallbackFn( +void CHIPRvcRunModeSupportedModesAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & - list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -21979,8 +21913,8 @@ void CHIPRvcRunModeSelectSupportedModesAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22034,53 +21968,41 @@ void CHIPRvcRunModeSelectSupportedModesAttributeCallback::CallbackFn( std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2 = + env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeOptionStruct"); return; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID(modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeOptionStruct constructor"); return; } @@ -22093,10 +22015,8 @@ void CHIPRvcRunModeSelectSupportedModesAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcRunModeSelectStartUpModeAttributeCallback::CHIPRvcRunModeSelectStartUpModeAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcRunModeStartUpModeAttributeCallback::CHIPRvcRunModeStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22112,7 +22032,7 @@ CHIPRvcRunModeSelectStartUpModeAttributeCallback::CHIPRvcRunModeSelectStartUpMod } } -CHIPRvcRunModeSelectStartUpModeAttributeCallback::~CHIPRvcRunModeSelectStartUpModeAttributeCallback() +CHIPRvcRunModeStartUpModeAttributeCallback::~CHIPRvcRunModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22123,8 +22043,7 @@ CHIPRvcRunModeSelectStartUpModeAttributeCallback::~CHIPRvcRunModeSelectStartUpMo env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectStartUpModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPRvcRunModeStartUpModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22132,8 +22051,8 @@ void CHIPRvcRunModeSelectStartUpModeAttributeCallback::CallbackFn(void * context jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22160,8 +22079,8 @@ void CHIPRvcRunModeSelectStartUpModeAttributeCallback::CallbackFn(void * context env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRvcRunModeSelectOnModeAttributeCallback::CHIPRvcRunModeSelectOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPRvcRunModeOnModeAttributeCallback::CHIPRvcRunModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22177,7 +22096,7 @@ CHIPRvcRunModeSelectOnModeAttributeCallback::CHIPRvcRunModeSelectOnModeAttribute } } -CHIPRvcRunModeSelectOnModeAttributeCallback::~CHIPRvcRunModeSelectOnModeAttributeCallback() +CHIPRvcRunModeOnModeAttributeCallback::~CHIPRvcRunModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22188,7 +22107,7 @@ CHIPRvcRunModeSelectOnModeAttributeCallback::~CHIPRvcRunModeSelectOnModeAttribut env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectOnModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) +void CHIPRvcRunModeOnModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22196,8 +22115,8 @@ void CHIPRvcRunModeSelectOnModeAttributeCallback::CallbackFn(void * context, con jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22224,9 +22143,9 @@ void CHIPRvcRunModeSelectOnModeAttributeCallback::CallbackFn(void * context, con env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcRunModeGeneratedCommandListAttributeCallback::CHIPRvcRunModeGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -22243,7 +22162,7 @@ CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::CHIPRvcRunModeSelectG } } -CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::~CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback() +CHIPRvcRunModeGeneratedCommandListAttributeCallback::~CHIPRvcRunModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22254,7 +22173,7 @@ CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::~CHIPRvcRunModeSelect env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPRvcRunModeGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -22264,8 +22183,8 @@ void CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22295,9 +22214,9 @@ void CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcRunModeAcceptedCommandListAttributeCallback::CHIPRvcRunModeAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -22314,7 +22233,7 @@ CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::CHIPRvcRunModeSelectAc } } -CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::~CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback() +CHIPRvcRunModeAcceptedCommandListAttributeCallback::~CHIPRvcRunModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22325,7 +22244,7 @@ CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::~CHIPRvcRunModeSelectA env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPRvcRunModeAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -22335,8 +22254,8 @@ void CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22366,10 +22285,8 @@ void CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcRunModeSelectEventListAttributeCallback::CHIPRvcRunModeSelectEventListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcRunModeEventListAttributeCallback::CHIPRvcRunModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22385,7 +22302,7 @@ CHIPRvcRunModeSelectEventListAttributeCallback::CHIPRvcRunModeSelectEventListAtt } } -CHIPRvcRunModeSelectEventListAttributeCallback::~CHIPRvcRunModeSelectEventListAttributeCallback() +CHIPRvcRunModeEventListAttributeCallback::~CHIPRvcRunModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22396,8 +22313,8 @@ CHIPRvcRunModeSelectEventListAttributeCallback::~CHIPRvcRunModeSelectEventListAt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPRvcRunModeEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22406,8 +22323,8 @@ void CHIPRvcRunModeSelectEventListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22437,10 +22354,8 @@ void CHIPRvcRunModeSelectEventListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcRunModeSelectAttributeListAttributeCallback::CHIPRvcRunModeSelectAttributeListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcRunModeAttributeListAttributeCallback::CHIPRvcRunModeAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22456,7 +22371,7 @@ CHIPRvcRunModeSelectAttributeListAttributeCallback::CHIPRvcRunModeSelectAttribut } } -CHIPRvcRunModeSelectAttributeListAttributeCallback::~CHIPRvcRunModeSelectAttributeListAttributeCallback() +CHIPRvcRunModeAttributeListAttributeCallback::~CHIPRvcRunModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22467,8 +22382,8 @@ CHIPRvcRunModeSelectAttributeListAttributeCallback::~CHIPRvcRunModeSelectAttribu env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPRvcRunModeAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22477,8 +22392,8 @@ void CHIPRvcRunModeSelectAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22508,9 +22423,9 @@ void CHIPRvcRunModeSelectAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CHIPRvcCleanModeSelectSupportedModesAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcCleanModeSupportedModesAttributeCallback::CHIPRvcCleanModeSupportedModesAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -22527,7 +22442,7 @@ CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CHIPRvcCleanModeSelectSup } } -CHIPRvcCleanModeSelectSupportedModesAttributeCallback::~CHIPRvcCleanModeSelectSupportedModesAttributeCallback() +CHIPRvcCleanModeSupportedModesAttributeCallback::~CHIPRvcCleanModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22538,10 +22453,9 @@ CHIPRvcCleanModeSelectSupportedModesAttributeCallback::~CHIPRvcCleanModeSelectSu env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CallbackFn( +void CHIPRvcCleanModeSupportedModesAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & - list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22550,8 +22464,8 @@ void CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22605,53 +22519,41 @@ void CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CallbackFn( std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2 = + env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeOptionStruct"); return; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID(modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeOptionStruct constructor"); return; } @@ -22664,10 +22566,8 @@ void CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcCleanModeSelectStartUpModeAttributeCallback::CHIPRvcCleanModeSelectStartUpModeAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcCleanModeStartUpModeAttributeCallback::CHIPRvcCleanModeStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22683,7 +22583,7 @@ CHIPRvcCleanModeSelectStartUpModeAttributeCallback::CHIPRvcCleanModeSelectStartU } } -CHIPRvcCleanModeSelectStartUpModeAttributeCallback::~CHIPRvcCleanModeSelectStartUpModeAttributeCallback() +CHIPRvcCleanModeStartUpModeAttributeCallback::~CHIPRvcCleanModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22694,8 +22594,7 @@ CHIPRvcCleanModeSelectStartUpModeAttributeCallback::~CHIPRvcCleanModeSelectStart env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectStartUpModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPRvcCleanModeStartUpModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22703,8 +22602,8 @@ void CHIPRvcCleanModeSelectStartUpModeAttributeCallback::CallbackFn(void * conte jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22731,8 +22630,8 @@ void CHIPRvcCleanModeSelectStartUpModeAttributeCallback::CallbackFn(void * conte env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRvcCleanModeSelectOnModeAttributeCallback::CHIPRvcCleanModeSelectOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPRvcCleanModeOnModeAttributeCallback::CHIPRvcCleanModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22748,7 +22647,7 @@ CHIPRvcCleanModeSelectOnModeAttributeCallback::CHIPRvcCleanModeSelectOnModeAttri } } -CHIPRvcCleanModeSelectOnModeAttributeCallback::~CHIPRvcCleanModeSelectOnModeAttributeCallback() +CHIPRvcCleanModeOnModeAttributeCallback::~CHIPRvcCleanModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22759,8 +22658,7 @@ CHIPRvcCleanModeSelectOnModeAttributeCallback::~CHIPRvcCleanModeSelectOnModeAttr env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectOnModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPRvcCleanModeOnModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22768,8 +22666,8 @@ void CHIPRvcCleanModeSelectOnModeAttributeCallback::CallbackFn(void * context, jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22796,9 +22694,9 @@ void CHIPRvcCleanModeSelectOnModeAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcCleanModeGeneratedCommandListAttributeCallback::CHIPRvcCleanModeGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -22815,7 +22713,7 @@ CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::CHIPRvcCleanModeSel } } -CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::~CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback() +CHIPRvcCleanModeGeneratedCommandListAttributeCallback::~CHIPRvcCleanModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22826,7 +22724,7 @@ CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::~CHIPRvcCleanModeSe env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPRvcCleanModeGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -22836,8 +22734,8 @@ void CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22867,9 +22765,9 @@ void CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcCleanModeAcceptedCommandListAttributeCallback::CHIPRvcCleanModeAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -22886,7 +22784,7 @@ CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::CHIPRvcCleanModeSele } } -CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::~CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback() +CHIPRvcCleanModeAcceptedCommandListAttributeCallback::~CHIPRvcCleanModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22897,7 +22795,7 @@ CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::~CHIPRvcCleanModeSel env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPRvcCleanModeAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -22907,8 +22805,8 @@ void CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22938,10 +22836,8 @@ void CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcCleanModeSelectEventListAttributeCallback::CHIPRvcCleanModeSelectEventListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcCleanModeEventListAttributeCallback::CHIPRvcCleanModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22957,7 +22853,7 @@ CHIPRvcCleanModeSelectEventListAttributeCallback::CHIPRvcCleanModeSelectEventLis } } -CHIPRvcCleanModeSelectEventListAttributeCallback::~CHIPRvcCleanModeSelectEventListAttributeCallback() +CHIPRvcCleanModeEventListAttributeCallback::~CHIPRvcCleanModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22968,8 +22864,8 @@ CHIPRvcCleanModeSelectEventListAttributeCallback::~CHIPRvcCleanModeSelectEventLi env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPRvcCleanModeEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22978,8 +22874,8 @@ void CHIPRvcCleanModeSelectEventListAttributeCallback::CallbackFn(void * context VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -23009,9 +22905,9 @@ void CHIPRvcCleanModeSelectEventListAttributeCallback::CallbackFn(void * context env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcCleanModeSelectAttributeListAttributeCallback::CHIPRvcCleanModeSelectAttributeListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcCleanModeAttributeListAttributeCallback::CHIPRvcCleanModeAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -23028,7 +22924,7 @@ CHIPRvcCleanModeSelectAttributeListAttributeCallback::CHIPRvcCleanModeSelectAttr } } -CHIPRvcCleanModeSelectAttributeListAttributeCallback::~CHIPRvcCleanModeSelectAttributeListAttributeCallback() +CHIPRvcCleanModeAttributeListAttributeCallback::~CHIPRvcCleanModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23039,8 +22935,8 @@ CHIPRvcCleanModeSelectAttributeListAttributeCallback::~CHIPRvcCleanModeSelectAtt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPRvcCleanModeAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -23049,8 +22945,8 @@ void CHIPRvcCleanModeSelectAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -23717,9 +23613,9 @@ void CHIPRefrigeratorAlarmAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDishwasherModeSelectSupportedModesAttributeCallback::CHIPDishwasherModeSelectSupportedModesAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPDishwasherModeSupportedModesAttributeCallback::CHIPDishwasherModeSupportedModesAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -23736,7 +23632,7 @@ CHIPDishwasherModeSelectSupportedModesAttributeCallback::CHIPDishwasherModeSelec } } -CHIPDishwasherModeSelectSupportedModesAttributeCallback::~CHIPDishwasherModeSelectSupportedModesAttributeCallback() +CHIPDishwasherModeSupportedModesAttributeCallback::~CHIPDishwasherModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23747,10 +23643,9 @@ CHIPDishwasherModeSelectSupportedModesAttributeCallback::~CHIPDishwasherModeSele env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectSupportedModesAttributeCallback::CallbackFn( +void CHIPDishwasherModeSupportedModesAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & - list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -23759,8 +23654,8 @@ void CHIPDishwasherModeSelectSupportedModesAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -23814,53 +23709,41 @@ void CHIPDishwasherModeSelectSupportedModesAttributeCallback::CallbackFn( std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2 = + env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeOptionStruct"); return; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID(modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeOptionStruct constructor"); return; } @@ -23873,9 +23756,9 @@ void CHIPDishwasherModeSelectSupportedModesAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDishwasherModeSelectStartUpModeAttributeCallback::CHIPDishwasherModeSelectStartUpModeAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPDishwasherModeStartUpModeAttributeCallback::CHIPDishwasherModeStartUpModeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -23892,7 +23775,7 @@ CHIPDishwasherModeSelectStartUpModeAttributeCallback::CHIPDishwasherModeSelectSt } } -CHIPDishwasherModeSelectStartUpModeAttributeCallback::~CHIPDishwasherModeSelectStartUpModeAttributeCallback() +CHIPDishwasherModeStartUpModeAttributeCallback::~CHIPDishwasherModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23903,8 +23786,8 @@ CHIPDishwasherModeSelectStartUpModeAttributeCallback::~CHIPDishwasherModeSelectS env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPDishwasherModeStartUpModeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -23912,8 +23795,8 @@ void CHIPDishwasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * con jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -23940,10 +23823,8 @@ void CHIPDishwasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * con env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPDishwasherModeSelectOnModeAttributeCallback::CHIPDishwasherModeSelectOnModeAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPDishwasherModeOnModeAttributeCallback::CHIPDishwasherModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23959,7 +23840,7 @@ CHIPDishwasherModeSelectOnModeAttributeCallback::CHIPDishwasherModeSelectOnModeA } } -CHIPDishwasherModeSelectOnModeAttributeCallback::~CHIPDishwasherModeSelectOnModeAttributeCallback() +CHIPDishwasherModeOnModeAttributeCallback::~CHIPDishwasherModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23970,8 +23851,7 @@ CHIPDishwasherModeSelectOnModeAttributeCallback::~CHIPDishwasherModeSelectOnMode env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectOnModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPDishwasherModeOnModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -23979,8 +23859,8 @@ void CHIPDishwasherModeSelectOnModeAttributeCallback::CallbackFn(void * context, jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -24007,9 +23887,9 @@ void CHIPDishwasherModeSelectOnModeAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback( +CHIPDishwasherModeGeneratedCommandListAttributeCallback::CHIPDishwasherModeGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -24026,7 +23906,7 @@ CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::CHIPDishwasherMod } } -CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::~CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback() +CHIPDishwasherModeGeneratedCommandListAttributeCallback::~CHIPDishwasherModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24037,7 +23917,7 @@ CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::~CHIPDishwasherMo env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPDishwasherModeGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -24047,8 +23927,8 @@ void CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -24078,9 +23958,9 @@ void CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPDishwasherModeAcceptedCommandListAttributeCallback::CHIPDishwasherModeAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -24097,7 +23977,7 @@ CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::CHIPDishwasherMode } } -CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::~CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback() +CHIPDishwasherModeAcceptedCommandListAttributeCallback::~CHIPDishwasherModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24108,7 +23988,7 @@ CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::~CHIPDishwasherMod env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPDishwasherModeAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -24118,8 +23998,8 @@ void CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -24149,10 +24029,8 @@ void CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDishwasherModeSelectEventListAttributeCallback::CHIPDishwasherModeSelectEventListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPDishwasherModeEventListAttributeCallback::CHIPDishwasherModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24168,7 +24046,7 @@ CHIPDishwasherModeSelectEventListAttributeCallback::CHIPDishwasherModeSelectEven } } -CHIPDishwasherModeSelectEventListAttributeCallback::~CHIPDishwasherModeSelectEventListAttributeCallback() +CHIPDishwasherModeEventListAttributeCallback::~CHIPDishwasherModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24179,8 +24057,8 @@ CHIPDishwasherModeSelectEventListAttributeCallback::~CHIPDishwasherModeSelectEve env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPDishwasherModeEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -24189,8 +24067,8 @@ void CHIPDishwasherModeSelectEventListAttributeCallback::CallbackFn(void * conte VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -24220,9 +24098,9 @@ void CHIPDishwasherModeSelectEventListAttributeCallback::CallbackFn(void * conte env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDishwasherModeSelectAttributeListAttributeCallback::CHIPDishwasherModeSelectAttributeListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPDishwasherModeAttributeListAttributeCallback::CHIPDishwasherModeAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -24239,7 +24117,7 @@ CHIPDishwasherModeSelectAttributeListAttributeCallback::CHIPDishwasherModeSelect } } -CHIPDishwasherModeSelectAttributeListAttributeCallback::~CHIPDishwasherModeSelectAttributeListAttributeCallback() +CHIPDishwasherModeAttributeListAttributeCallback::~CHIPDishwasherModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24250,7 +24128,7 @@ CHIPDishwasherModeSelectAttributeListAttributeCallback::~CHIPDishwasherModeSelec env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectAttributeListAttributeCallback::CallbackFn( +void CHIPDishwasherModeAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -24260,8 +24138,8 @@ void CHIPDishwasherModeSelectAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -25127,12 +25005,22 @@ void CHIPOperationalStateOperationalStateListAttributeCallback::CallbackFn( jobject newElement_0_operationalStateID; std::string newElement_0_operationalStateIDClassName = "java/lang/Integer"; std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_operationalStateIDClassName.c_str(), newElement_0_operationalStateIDCtorSignature.c_str(), - static_cast(entry_0.operationalStateID), newElement_0_operationalStateID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_operationalStateIDClassName.c_str(), + newElement_0_operationalStateIDCtorSignature.c_str(), + entry_0.operationalStateID, newElement_0_operationalStateID); jobject newElement_0_operationalStateLabel; - LogErrorOnFailure( - chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel, newElement_0_operationalStateLabel)); + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel.Value(), + newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } jclass operationalStateStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -25144,7 +25032,7 @@ void CHIPOperationalStateOperationalStateListAttributeCallback::CallbackFn( return; } jmethodID operationalStateStructStructCtor_1 = - env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_1 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); @@ -25444,6 +25332,607 @@ void CHIPOperationalStateAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPRvcOperationalStatePhaseListAttributeCallback::CHIPRvcOperationalStatePhaseListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRvcOperationalStatePhaseListAttributeCallback::~CHIPRvcOperationalStatePhaseListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRvcOperationalStatePhaseListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + if (list.IsNull()) + { + arrayListObj = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_1 = list.Value().begin(); + while (iter_arrayListObj_1.Next()) + { + auto & entry_1 = iter_arrayListObj_1.GetValue(); + jobject newElement_1; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1, newElement_1)); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_1); + } + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRvcOperationalStateCurrentPhaseAttributeCallback::CHIPRvcOperationalStateCurrentPhaseAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRvcOperationalStateCurrentPhaseAttributeCallback::~CHIPRvcOperationalStateCurrentPhaseAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRvcOperationalStateCurrentPhaseAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPRvcOperationalStateCountdownTimeAttributeCallback::CHIPRvcOperationalStateCountdownTimeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRvcOperationalStateCountdownTimeAttributeCallback::~CHIPRvcOperationalStateCountdownTimeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRvcOperationalStateCountdownTimeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPRvcOperationalStateOperationalStateListAttributeCallback::CHIPRvcOperationalStateOperationalStateListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRvcOperationalStateOperationalStateListAttributeCallback::~CHIPRvcOperationalStateOperationalStateListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRvcOperationalStateOperationalStateListAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_operationalStateID; + std::string newElement_0_operationalStateIDClassName = "java/lang/Integer"; + std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_operationalStateIDClassName.c_str(), + newElement_0_operationalStateIDCtorSignature.c_str(), + entry_0.operationalStateID, newElement_0_operationalStateID); + jobject newElement_0_operationalStateLabel; + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel.Value(), + newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } + + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterOperationalStateStruct"); + return; + } + jmethodID operationalStateStructStructCtor_1 = + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); + if (operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); + return; + } + + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRvcOperationalStateGeneratedCommandListAttributeCallback::CHIPRvcOperationalStateGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRvcOperationalStateGeneratedCommandListAttributeCallback::~CHIPRvcOperationalStateGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRvcOperationalStateGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRvcOperationalStateAcceptedCommandListAttributeCallback::CHIPRvcOperationalStateAcceptedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRvcOperationalStateAcceptedCommandListAttributeCallback::~CHIPRvcOperationalStateAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRvcOperationalStateAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRvcOperationalStateEventListAttributeCallback::CHIPRvcOperationalStateEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRvcOperationalStateEventListAttributeCallback::~CHIPRvcOperationalStateEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRvcOperationalStateEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRvcOperationalStateAttributeListAttributeCallback::CHIPRvcOperationalStateAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRvcOperationalStateAttributeListAttributeCallback::~CHIPRvcOperationalStateAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRvcOperationalStateAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPHepaFilterMonitoringGeneratedCommandListAttributeCallback::CHIPHepaFilterMonitoringGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index f9aca55fe803e6..23ca8d6a4308bf 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -13420,29 +13420,9 @@ public void changeToMode(DefaultClusterCallback callback , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - public interface ChangeToModeResponseCallback { - void onSuccess(Integer status, Optional statusText); - - void onError(Exception error); - } - public interface StandardNamespaceAttributeCallback { void onSuccess(@Nullable Integer value); @@ -13732,41 +13712,27 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class LaundryWasherModeSelectCluster extends BaseChipCluster { + public static class LaundryWasherModeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 81L; - public LaundryWasherModeSelectCluster(long devicePtr, int endpointId) { + public LaundryWasherModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode) { changeToMode(chipClusterPtr, callback, newMode, null); } - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } - private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback + private native void changeToMode(long chipClusterPtr, ChangeToModeResponseCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); public interface ChangeToModeResponseCallback { @@ -13777,7 +13743,7 @@ public interface ChangeToModeResponseCallback { public interface SupportedModesAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } @@ -13812,18 +13778,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readDescriptionAttribute( - CharStringAttributeCallback callback - ) { - readDescriptionAttribute(chipClusterPtr, callback); - } - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback -, - int minInterval, int maxInterval) { - subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readSupportedModesAttribute( SupportedModesAttributeCallback callback ) { @@ -13958,13 +13912,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback - ); - private native void subscribeDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback -, int minInterval, int maxInterval); - private native void readSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback ); @@ -14040,41 +13987,27 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class RefrigeratorAndTemperatureControlledCabinetModeSelectCluster extends BaseChipCluster { + public static class RefrigeratorAndTemperatureControlledCabinetModeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 82L; - public RefrigeratorAndTemperatureControlledCabinetModeSelectCluster(long devicePtr, int endpointId) { + public RefrigeratorAndTemperatureControlledCabinetModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode) { changeToMode(chipClusterPtr, callback, newMode, null); } - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } - private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback + private native void changeToMode(long chipClusterPtr, ChangeToModeResponseCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); public interface ChangeToModeResponseCallback { @@ -14085,7 +14018,7 @@ public interface ChangeToModeResponseCallback { public interface SupportedModesAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } @@ -14120,18 +14053,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readDescriptionAttribute( - CharStringAttributeCallback callback - ) { - readDescriptionAttribute(chipClusterPtr, callback); - } - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback -, - int minInterval, int maxInterval) { - subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readSupportedModesAttribute( SupportedModesAttributeCallback callback ) { @@ -14266,13 +14187,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback - ); - private native void subscribeDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback -, int minInterval, int maxInterval); - private native void readSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback ); @@ -14603,41 +14517,27 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class RvcRunModeSelectCluster extends BaseChipCluster { + public static class RvcRunModeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 84L; - public RvcRunModeSelectCluster(long devicePtr, int endpointId) { + public RvcRunModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode) { changeToMode(chipClusterPtr, callback, newMode, null); } - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } - private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback + private native void changeToMode(long chipClusterPtr, ChangeToModeResponseCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); public interface ChangeToModeResponseCallback { @@ -14648,7 +14548,7 @@ public interface ChangeToModeResponseCallback { public interface SupportedModesAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } @@ -14683,18 +14583,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readDescriptionAttribute( - CharStringAttributeCallback callback - ) { - readDescriptionAttribute(chipClusterPtr, callback); - } - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback -, - int minInterval, int maxInterval) { - subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readSupportedModesAttribute( SupportedModesAttributeCallback callback ) { @@ -14829,13 +14717,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback - ); - private native void subscribeDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback -, int minInterval, int maxInterval); - private native void readSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback ); @@ -14911,41 +14792,27 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class RvcCleanModeSelectCluster extends BaseChipCluster { + public static class RvcCleanModeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 85L; - public RvcCleanModeSelectCluster(long devicePtr, int endpointId) { + public RvcCleanModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode) { changeToMode(chipClusterPtr, callback, newMode, null); } - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } - private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback + private native void changeToMode(long chipClusterPtr, ChangeToModeResponseCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); public interface ChangeToModeResponseCallback { @@ -14956,7 +14823,7 @@ public interface ChangeToModeResponseCallback { public interface SupportedModesAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } @@ -14991,18 +14858,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readDescriptionAttribute( - CharStringAttributeCallback callback - ) { - readDescriptionAttribute(chipClusterPtr, callback); - } - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback -, - int minInterval, int maxInterval) { - subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readSupportedModesAttribute( SupportedModesAttributeCallback callback ) { @@ -15137,13 +14992,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback - ); - private native void subscribeDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback -, int minInterval, int maxInterval); - private native void readSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback ); @@ -15668,41 +15516,27 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class DishwasherModeSelectCluster extends BaseChipCluster { + public static class DishwasherModeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 89L; - public DishwasherModeSelectCluster(long devicePtr, int endpointId) { + public DishwasherModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode) { changeToMode(chipClusterPtr, callback, newMode, null); } - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } - private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback + private native void changeToMode(long chipClusterPtr, ChangeToModeResponseCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); public interface ChangeToModeResponseCallback { @@ -15713,7 +15547,7 @@ public interface ChangeToModeResponseCallback { public interface SupportedModesAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } @@ -15748,18 +15582,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readDescriptionAttribute( - CharStringAttributeCallback callback - ) { - readDescriptionAttribute(chipClusterPtr, callback); - } - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback -, - int minInterval, int maxInterval) { - subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readSupportedModesAttribute( SupportedModesAttributeCallback callback ) { @@ -15894,13 +15716,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback - ); - private native void subscribeDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback -, int minInterval, int maxInterval); - private native void readSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback ); @@ -16780,6 +16595,310 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } + public static class RvcOperationalStateCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 97L; + + public RvcOperationalStateCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void pause(OperationalCommandResponseCallback callback + ) { + pause(chipClusterPtr, callback, null); + } + + public void pause(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + pause(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + public void stop(OperationalCommandResponseCallback callback + ) { + stop(chipClusterPtr, callback, null); + } + + public void stop(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + stop(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + public void start(OperationalCommandResponseCallback callback + ) { + start(chipClusterPtr, callback, null); + } + + public void start(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + start(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + public void resume(OperationalCommandResponseCallback callback + ) { + resume(chipClusterPtr, callback, null); + } + + public void resume(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + resume(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + private native void pause(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + private native void stop(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + private native void start(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + private native void resume(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + public interface OperationalCommandResponseCallback { + void onSuccess(ChipStructs.RvcOperationalStateClusterErrorStateStruct commandResponseState); + + void onError(Exception error); + } + + + public interface PhaseListAttributeCallback { + void onSuccess(@Nullable List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface CurrentPhaseAttributeCallback { + void onSuccess(@Nullable Integer value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface CountdownTimeAttributeCallback { + void onSuccess(@Nullable Long value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface OperationalStateListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface GeneratedCommandListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface AcceptedCommandListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface EventListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface AttributeListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readPhaseListAttribute( + PhaseListAttributeCallback callback + ) { + readPhaseListAttribute(chipClusterPtr, callback); + } + public void subscribePhaseListAttribute( + PhaseListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribePhaseListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCurrentPhaseAttribute( + CurrentPhaseAttributeCallback callback + ) { + readCurrentPhaseAttribute(chipClusterPtr, callback); + } + public void subscribeCurrentPhaseAttribute( + CurrentPhaseAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeCurrentPhaseAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCountdownTimeAttribute( + CountdownTimeAttributeCallback callback + ) { + readCountdownTimeAttribute(chipClusterPtr, callback); + } + public void subscribeCountdownTimeAttribute( + CountdownTimeAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeCountdownTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readOperationalStateListAttribute( + OperationalStateListAttributeCallback callback + ) { + readOperationalStateListAttribute(chipClusterPtr, callback); + } + public void subscribeOperationalStateListAttribute( + OperationalStateListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeOperationalStateListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback + ) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback + ) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback + ) { + readEventListAttribute(chipClusterPtr, callback); + } + public void subscribeEventListAttribute( + EventListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback + ) { + readAttributeListAttribute(chipClusterPtr, callback); + } + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback + ) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback +, + int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback + ) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback +, + int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readPhaseListAttribute(long chipClusterPtr, + PhaseListAttributeCallback callback + ); + private native void subscribePhaseListAttribute(long chipClusterPtr, + PhaseListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readCurrentPhaseAttribute(long chipClusterPtr, + CurrentPhaseAttributeCallback callback + ); + private native void subscribeCurrentPhaseAttribute(long chipClusterPtr, + CurrentPhaseAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readCountdownTimeAttribute(long chipClusterPtr, + CountdownTimeAttributeCallback callback + ); + private native void subscribeCountdownTimeAttribute(long chipClusterPtr, + CountdownTimeAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readOperationalStateListAttribute(long chipClusterPtr, + OperationalStateListAttributeCallback callback + ); + private native void subscribeOperationalStateListAttribute(long chipClusterPtr, + OperationalStateListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readGeneratedCommandListAttribute(long chipClusterPtr, + GeneratedCommandListAttributeCallback callback + ); + private native void subscribeGeneratedCommandListAttribute(long chipClusterPtr, + GeneratedCommandListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readAcceptedCommandListAttribute(long chipClusterPtr, + AcceptedCommandListAttributeCallback callback + ); + private native void subscribeAcceptedCommandListAttribute(long chipClusterPtr, + AcceptedCommandListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readEventListAttribute(long chipClusterPtr, + EventListAttributeCallback callback + ); + private native void subscribeEventListAttribute(long chipClusterPtr, + EventListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readAttributeListAttribute(long chipClusterPtr, + AttributeListAttributeCallback callback + ); + private native void subscribeAttributeListAttribute(long chipClusterPtr, + AttributeListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readFeatureMapAttribute(long chipClusterPtr, + LongAttributeCallback callback + ); + private native void subscribeFeatureMapAttribute(long chipClusterPtr, + LongAttributeCallback callback +, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute(long chipClusterPtr, + IntegerAttributeCallback callback + ); + private native void subscribeClusterRevisionAttribute(long chipClusterPtr, + IntegerAttributeCallback callback +, int minInterval, int maxInterval); + } + public static class HepaFilterMonitoringCluster extends BaseChipCluster { public static final long CLUSTER_ID = 113L; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java index 5141fbb60aa041..81ef1fa558d09f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -1305,6 +1305,60 @@ public String toString() { } } +public static class RvcOperationalStateClusterOperationalErrorEvent { +public ChipStructs.RvcOperationalStateClusterErrorStateStruct errorState; + + public RvcOperationalStateClusterOperationalErrorEvent( + ChipStructs.RvcOperationalStateClusterErrorStateStruct errorState + ) { + this.errorState = errorState; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RvcOperationalStateClusterOperationalErrorEvent {\n"); + output.append("\terrorState: "); + output.append(errorState); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + +public static class RvcOperationalStateClusterOperationCompletionEvent { +public Integer completionErrorCode; +public @Nullable Optional totalOperationalTime; +public @Nullable Optional pausedTime; + + public RvcOperationalStateClusterOperationCompletionEvent( + Integer completionErrorCode + , @Nullable Optional totalOperationalTime + , @Nullable Optional pausedTime + ) { + this.completionErrorCode = completionErrorCode; + this.totalOperationalTime = totalOperationalTime; + this.pausedTime = pausedTime; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RvcOperationalStateClusterOperationCompletionEvent {\n"); + output.append("\tcompletionErrorCode: "); + output.append(completionErrorCode); + output.append("\n"); + output.append("\ttotalOperationalTime: "); + output.append(totalOperationalTime); + output.append("\n"); + output.append("\tpausedTime: "); + output.append(pausedTime); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + public static class DoorLockClusterDoorLockAlarmEvent { public Integer alarmCode; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 83e7e60c2e79ea..77bdd9bce58781 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -151,19 +151,19 @@ public static String clusterIdToName(long clusterId) { return "ModeSelect"; } if (clusterId == 81L) { - return "LaundryWasherModeSelect"; + return "LaundryWasherMode"; } if (clusterId == 82L) { - return "RefrigeratorAndTemperatureControlledCabinetModeSelect"; + return "RefrigeratorAndTemperatureControlledCabinetMode"; } if (clusterId == 83L) { return "WasherControls"; } if (clusterId == 84L) { - return "RvcRunModeSelect"; + return "RvcRunMode"; } if (clusterId == 85L) { - return "RvcCleanModeSelect"; + return "RvcCleanMode"; } if (clusterId == 86L) { return "TemperatureControl"; @@ -172,7 +172,7 @@ public static String clusterIdToName(long clusterId) { return "RefrigeratorAlarm"; } if (clusterId == 89L) { - return "DishwasherModeSelect"; + return "DishwasherMode"; } if (clusterId == 91L) { return "AirQuality"; @@ -183,6 +183,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 96L) { return "OperationalState"; } + if (clusterId == 97L) { + return "RvcOperationalState"; + } if (clusterId == 113L) { return "HepaFilterMonitoring"; } @@ -2173,18 +2176,15 @@ public static String attributeIdToName(long clusterId, long attributeId) { } if (clusterId == 81L) { if (attributeId == 0L) { - return "Description"; - } - if (attributeId == 2L) { return "SupportedModes"; } - if (attributeId == 3L) { + if (attributeId == 1L) { return "CurrentMode"; } - if (attributeId == 4L) { + if (attributeId == 2L) { return "StartUpMode"; } - if (attributeId == 5L) { + if (attributeId == 3L) { return "OnMode"; } if (attributeId == 65528L) { @@ -2209,18 +2209,15 @@ public static String attributeIdToName(long clusterId, long attributeId) { } if (clusterId == 82L) { if (attributeId == 0L) { - return "Description"; - } - if (attributeId == 2L) { return "SupportedModes"; } - if (attributeId == 3L) { + if (attributeId == 1L) { return "CurrentMode"; } - if (attributeId == 4L) { + if (attributeId == 2L) { return "StartUpMode"; } - if (attributeId == 5L) { + if (attributeId == 3L) { return "OnMode"; } if (attributeId == 65528L) { @@ -2278,18 +2275,15 @@ public static String attributeIdToName(long clusterId, long attributeId) { } if (clusterId == 84L) { if (attributeId == 0L) { - return "Description"; - } - if (attributeId == 2L) { return "SupportedModes"; } - if (attributeId == 3L) { + if (attributeId == 1L) { return "CurrentMode"; } - if (attributeId == 4L) { + if (attributeId == 2L) { return "StartUpMode"; } - if (attributeId == 5L) { + if (attributeId == 3L) { return "OnMode"; } if (attributeId == 65528L) { @@ -2314,18 +2308,15 @@ public static String attributeIdToName(long clusterId, long attributeId) { } if (clusterId == 85L) { if (attributeId == 0L) { - return "Description"; - } - if (attributeId == 2L) { return "SupportedModes"; } - if (attributeId == 3L) { + if (attributeId == 1L) { return "CurrentMode"; } - if (attributeId == 4L) { + if (attributeId == 2L) { return "StartUpMode"; } - if (attributeId == 5L) { + if (attributeId == 3L) { return "OnMode"; } if (attributeId == 65528L) { @@ -2416,18 +2407,15 @@ public static String attributeIdToName(long clusterId, long attributeId) { } if (clusterId == 89L) { if (attributeId == 0L) { - return "Description"; - } - if (attributeId == 2L) { return "SupportedModes"; } - if (attributeId == 3L) { + if (attributeId == 1L) { return "CurrentMode"; } - if (attributeId == 4L) { + if (attributeId == 2L) { return "StartUpMode"; } - if (attributeId == 5L) { + if (attributeId == 3L) { return "OnMode"; } if (attributeId == 65528L) { @@ -2570,6 +2558,45 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 97L) { + if (attributeId == 0L) { + return "PhaseList"; + } + if (attributeId == 1L) { + return "CurrentPhase"; + } + if (attributeId == 2L) { + return "CountdownTime"; + } + if (attributeId == 3L) { + return "OperationalStateList"; + } + if (attributeId == 4L) { + return "OperationalState"; + } + if (attributeId == 5L) { + return "OperationalError"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 113L) { if (attributeId == 0L) { return "Condition"; @@ -7366,6 +7393,15 @@ public static String eventIdToName(long clusterId, long eventId) { } return ""; } + if (clusterId == 97L) { + if (eventId == 0L) { + return "OperationalError"; + } + if (eventId == 1L) { + return "OperationCompletion"; + } + return ""; + } if (clusterId == 113L) { return ""; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index b5294f94e6054b..b024e13325d2b8 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1542,34 +1542,28 @@ public String toString() { } } -public static class ModeSelectClusterModeTagStruct { -public Optional mfgCode; +public static class ModeSelectClusterSemanticTagStruct { +public Integer mfgCode; public Integer value; -public Optional tagName; - public ModeSelectClusterModeTagStruct( - Optional mfgCode + public ModeSelectClusterSemanticTagStruct( + Integer mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("ModeSelectClusterModeTagStruct {\n"); + output.append("ModeSelectClusterSemanticTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } @@ -1578,16 +1572,16 @@ public String toString() { public static class ModeSelectClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList semanticTags; public ModeSelectClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList semanticTags ) { this.label = label; this.mode = mode; - this.modeTags = modeTags; + this.semanticTags = semanticTags; } @Override @@ -1600,56 +1594,50 @@ public String toString() { output.append("\tmode: "); output.append(mode); output.append("\n"); - output.append("\tmodeTags: "); - output.append(modeTags); + output.append("\tsemanticTags: "); + output.append(semanticTags); output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class LaundryWasherModeSelectClusterModeTagStruct { +public static class LaundryWasherModeClusterModeTagStruct { public Optional mfgCode; public Integer value; -public Optional tagName; - public LaundryWasherModeSelectClusterModeTagStruct( + public LaundryWasherModeClusterModeTagStruct( Optional mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("LaundryWasherModeSelectClusterModeTagStruct {\n"); + output.append("LaundryWasherModeClusterModeTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class LaundryWasherModeSelectClusterModeOptionStruct { +public static class LaundryWasherModeClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList modeTags; - public LaundryWasherModeSelectClusterModeOptionStruct( + public LaundryWasherModeClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList modeTags ) { this.label = label; this.mode = mode; @@ -1659,7 +1647,7 @@ public LaundryWasherModeSelectClusterModeOptionStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("LaundryWasherModeSelectClusterModeOptionStruct {\n"); + output.append("LaundryWasherModeClusterModeOptionStruct {\n"); output.append("\tlabel: "); output.append(label); output.append("\n"); @@ -1674,48 +1662,42 @@ public String toString() { } } -public static class RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct { +public static class RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct { public Optional mfgCode; public Integer value; -public Optional tagName; - public RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct( + public RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct( Optional mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct {\n"); + output.append("RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct { +public static class RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList modeTags; - public RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct( + public RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList modeTags ) { this.label = label; this.mode = mode; @@ -1725,7 +1707,7 @@ public RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStr @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct {\n"); + output.append("RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct {\n"); output.append("\tlabel: "); output.append(label); output.append("\n"); @@ -1740,48 +1722,42 @@ public String toString() { } } -public static class RvcRunModeSelectClusterModeTagStruct { +public static class RvcRunModeClusterModeTagStruct { public Optional mfgCode; public Integer value; -public Optional tagName; - public RvcRunModeSelectClusterModeTagStruct( + public RvcRunModeClusterModeTagStruct( Optional mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RvcRunModeSelectClusterModeTagStruct {\n"); + output.append("RvcRunModeClusterModeTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class RvcRunModeSelectClusterModeOptionStruct { +public static class RvcRunModeClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList modeTags; - public RvcRunModeSelectClusterModeOptionStruct( + public RvcRunModeClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList modeTags ) { this.label = label; this.mode = mode; @@ -1791,7 +1767,7 @@ public RvcRunModeSelectClusterModeOptionStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RvcRunModeSelectClusterModeOptionStruct {\n"); + output.append("RvcRunModeClusterModeOptionStruct {\n"); output.append("\tlabel: "); output.append(label); output.append("\n"); @@ -1806,48 +1782,42 @@ public String toString() { } } -public static class RvcCleanModeSelectClusterModeTagStruct { +public static class RvcCleanModeClusterModeTagStruct { public Optional mfgCode; public Integer value; -public Optional tagName; - public RvcCleanModeSelectClusterModeTagStruct( + public RvcCleanModeClusterModeTagStruct( Optional mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RvcCleanModeSelectClusterModeTagStruct {\n"); + output.append("RvcCleanModeClusterModeTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class RvcCleanModeSelectClusterModeOptionStruct { +public static class RvcCleanModeClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList modeTags; - public RvcCleanModeSelectClusterModeOptionStruct( + public RvcCleanModeClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList modeTags ) { this.label = label; this.mode = mode; @@ -1857,7 +1827,7 @@ public RvcCleanModeSelectClusterModeOptionStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RvcCleanModeSelectClusterModeOptionStruct {\n"); + output.append("RvcCleanModeClusterModeOptionStruct {\n"); output.append("\tlabel: "); output.append(label); output.append("\n"); @@ -1872,48 +1842,42 @@ public String toString() { } } -public static class DishwasherModeSelectClusterModeTagStruct { +public static class DishwasherModeClusterModeTagStruct { public Optional mfgCode; public Integer value; -public Optional tagName; - public DishwasherModeSelectClusterModeTagStruct( + public DishwasherModeClusterModeTagStruct( Optional mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("DishwasherModeSelectClusterModeTagStruct {\n"); + output.append("DishwasherModeClusterModeTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class DishwasherModeSelectClusterModeOptionStruct { +public static class DishwasherModeClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList modeTags; - public DishwasherModeSelectClusterModeOptionStruct( + public DishwasherModeClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList modeTags ) { this.label = label; this.mode = mode; @@ -1923,7 +1887,7 @@ public DishwasherModeSelectClusterModeOptionStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("DishwasherModeSelectClusterModeOptionStruct {\n"); + output.append("DishwasherModeClusterModeOptionStruct {\n"); output.append("\tlabel: "); output.append(label); output.append("\n"); @@ -1940,12 +1904,12 @@ public String toString() { public static class OperationalStateClusterErrorStateStruct { public Integer errorStateID; -public @Nullable String errorStateLabel; +public Optional errorStateLabel; public Optional errorStateDetails; public OperationalStateClusterErrorStateStruct( Integer errorStateID - , @Nullable String errorStateLabel + , Optional errorStateLabel , Optional errorStateDetails ) { this.errorStateID = errorStateID; @@ -1973,11 +1937,11 @@ public String toString() { public static class OperationalStateClusterOperationalStateStruct { public Integer operationalStateID; -public String operationalStateLabel; +public Optional operationalStateLabel; public OperationalStateClusterOperationalStateStruct( Integer operationalStateID - , String operationalStateLabel + , Optional operationalStateLabel ) { this.operationalStateID = operationalStateID; this.operationalStateLabel = operationalStateLabel; @@ -1998,6 +1962,66 @@ public String toString() { } } +public static class RvcOperationalStateClusterErrorStateStruct { +public Integer errorStateID; +public Optional errorStateLabel; +public Optional errorStateDetails; + + public RvcOperationalStateClusterErrorStateStruct( + Integer errorStateID + , Optional errorStateLabel + , Optional errorStateDetails + ) { + this.errorStateID = errorStateID; + this.errorStateLabel = errorStateLabel; + this.errorStateDetails = errorStateDetails; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RvcOperationalStateClusterErrorStateStruct {\n"); + output.append("\terrorStateID: "); + output.append(errorStateID); + output.append("\n"); + output.append("\terrorStateLabel: "); + output.append(errorStateLabel); + output.append("\n"); + output.append("\terrorStateDetails: "); + output.append(errorStateDetails); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + +public static class RvcOperationalStateClusterOperationalStateStruct { +public Integer operationalStateID; +public Optional operationalStateLabel; + + public RvcOperationalStateClusterOperationalStateStruct( + Integer operationalStateID + , Optional operationalStateLabel + ) { + this.operationalStateID = operationalStateID; + this.operationalStateLabel = operationalStateLabel; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RvcOperationalStateClusterOperationalStateStruct {\n"); + output.append("\toperationalStateID: "); + output.append(operationalStateID); + output.append("\n"); + output.append("\toperationalStateLabel: "); + output.append(operationalStateLabel); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + public static class DoorLockClusterCredentialStruct { public Integer credentialType; public Integer credentialIndex; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 92f7fa0d6f7645..3db9f1bd3dba72 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -5757,29 +5757,6 @@ public void onError(Exception ex) { } } - public static class DelegatedModeSelectClusterChangeToModeResponseCallback implements ChipClusters.ModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(Integer Status, Optional StatusText) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo StatusResponseValue = new CommandResponseInfo("Status", "Integer"); - responseValues.put(StatusResponseValue, Status); - CommandResponseInfo StatusTextResponseValue = new CommandResponseInfo("StatusText", "Optional"); - responseValues.put(StatusTextResponseValue, StatusText); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception error) { - callback.onFailure(error); - } - } - public static class DelegatedModeSelectClusterStandardNamespaceAttributeCallback implements ChipClusters.ModeSelectCluster.StandardNamespaceAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -5933,7 +5910,7 @@ public void onError(Exception ex) { } } - public static class DelegatedLaundryWasherModeSelectClusterChangeToModeResponseCallback implements ChipClusters.LaundryWasherModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterChangeToModeResponseCallback implements ChipClusters.LaundryWasherModeCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -5956,7 +5933,7 @@ public void onError(Exception error) { } } - public static class DelegatedLaundryWasherModeSelectClusterSupportedModesAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterSupportedModesAttributeCallback implements ChipClusters.LaundryWasherModeCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -5964,9 +5941,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5975,7 +5952,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterStartUpModeAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterStartUpModeAttributeCallback implements ChipClusters.LaundryWasherModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -5994,7 +5971,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterOnModeAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.OnModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterOnModeAttributeCallback implements ChipClusters.LaundryWasherModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6013,7 +5990,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterGeneratedCommandListAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.LaundryWasherModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6032,7 +6009,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterAcceptedCommandListAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterAcceptedCommandListAttributeCallback implements ChipClusters.LaundryWasherModeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6051,7 +6028,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterEventListAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterEventListAttributeCallback implements ChipClusters.LaundryWasherModeCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6070,7 +6047,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterAttributeListAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterAttributeListAttributeCallback implements ChipClusters.LaundryWasherModeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6090,7 +6067,7 @@ public void onError(Exception ex) { } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6113,7 +6090,7 @@ public void onError(Exception error) { } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterSupportedModesAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterSupportedModesAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6121,9 +6098,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6132,7 +6109,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterStartUpModeAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterStartUpModeAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6151,7 +6128,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterOnModeAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.OnModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterOnModeAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6170,7 +6147,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterGeneratedCommandListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6189,7 +6166,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterAcceptedCommandListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterAcceptedCommandListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6208,7 +6185,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterEventListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterEventListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6227,7 +6204,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterAttributeListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterAttributeListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6381,7 +6358,7 @@ public void onError(Exception ex) { } } - public static class DelegatedRvcRunModeSelectClusterChangeToModeResponseCallback implements ChipClusters.RvcRunModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterChangeToModeResponseCallback implements ChipClusters.RvcRunModeCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6404,7 +6381,7 @@ public void onError(Exception error) { } } - public static class DelegatedRvcRunModeSelectClusterSupportedModesAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterSupportedModesAttributeCallback implements ChipClusters.RvcRunModeCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6412,9 +6389,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6423,7 +6400,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterStartUpModeAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterStartUpModeAttributeCallback implements ChipClusters.RvcRunModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6442,7 +6419,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterOnModeAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.OnModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterOnModeAttributeCallback implements ChipClusters.RvcRunModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6461,7 +6438,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterGeneratedCommandListAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.RvcRunModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6480,7 +6457,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterAcceptedCommandListAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterAcceptedCommandListAttributeCallback implements ChipClusters.RvcRunModeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6499,7 +6476,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterEventListAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterEventListAttributeCallback implements ChipClusters.RvcRunModeCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6518,7 +6495,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterAttributeListAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterAttributeListAttributeCallback implements ChipClusters.RvcRunModeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6538,7 +6515,7 @@ public void onError(Exception ex) { } } - public static class DelegatedRvcCleanModeSelectClusterChangeToModeResponseCallback implements ChipClusters.RvcCleanModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterChangeToModeResponseCallback implements ChipClusters.RvcCleanModeCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6561,7 +6538,7 @@ public void onError(Exception error) { } } - public static class DelegatedRvcCleanModeSelectClusterSupportedModesAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterSupportedModesAttributeCallback implements ChipClusters.RvcCleanModeCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6569,9 +6546,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6580,7 +6557,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterStartUpModeAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterStartUpModeAttributeCallback implements ChipClusters.RvcCleanModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6599,7 +6576,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterOnModeAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.OnModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterOnModeAttributeCallback implements ChipClusters.RvcCleanModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6618,7 +6595,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterGeneratedCommandListAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.RvcCleanModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6637,7 +6614,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterAcceptedCommandListAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterAcceptedCommandListAttributeCallback implements ChipClusters.RvcCleanModeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6656,7 +6633,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterEventListAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterEventListAttributeCallback implements ChipClusters.RvcCleanModeCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6675,7 +6652,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterAttributeListAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterAttributeListAttributeCallback implements ChipClusters.RvcCleanModeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6868,7 +6845,7 @@ public void onError(Exception ex) { } } - public static class DelegatedDishwasherModeSelectClusterChangeToModeResponseCallback implements ChipClusters.DishwasherModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterChangeToModeResponseCallback implements ChipClusters.DishwasherModeCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6891,7 +6868,7 @@ public void onError(Exception error) { } } - public static class DelegatedDishwasherModeSelectClusterSupportedModesAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterSupportedModesAttributeCallback implements ChipClusters.DishwasherModeCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6899,9 +6876,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6910,7 +6887,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterStartUpModeAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterStartUpModeAttributeCallback implements ChipClusters.DishwasherModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6929,7 +6906,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterOnModeAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.OnModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterOnModeAttributeCallback implements ChipClusters.DishwasherModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6948,7 +6925,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterGeneratedCommandListAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.DishwasherModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6967,7 +6944,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterAcceptedCommandListAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterAcceptedCommandListAttributeCallback implements ChipClusters.DishwasherModeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6986,7 +6963,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterEventListAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterEventListAttributeCallback implements ChipClusters.DishwasherModeCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7005,7 +6982,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterAttributeListAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterAttributeListAttributeCallback implements ChipClusters.DishwasherModeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7319,6 +7296,180 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { this.callback = callback; } +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback implements ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.RvcOperationalStateClusterErrorStateStruct CommandResponseState) { + Map responseValues = new LinkedHashMap<>(); + // CommandResponseState: Struct ErrorStateStruct + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedRvcOperationalStateClusterPhaseListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.PhaseListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess(@Nullable List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRvcOperationalStateClusterCurrentPhaseAttributeCallback implements ChipClusters.RvcOperationalStateCluster.CurrentPhaseAttributeCallback, 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 DelegatedRvcOperationalStateClusterCountdownTimeAttributeCallback implements ChipClusters.RvcOperationalStateCluster.CountdownTimeAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRvcOperationalStateClusterOperationalStateListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.OperationalStateListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRvcOperationalStateClusterGeneratedCommandListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRvcOperationalStateClusterAcceptedCommandListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRvcOperationalStateClusterEventListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRvcOperationalStateClusterAttributeListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + @Override public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); @@ -19819,30 +19970,30 @@ public Map initializeClusterMap() { ClusterInfo modeSelectClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.ModeSelectCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("modeSelect", modeSelectClusterInfo); - ClusterInfo laundryWasherModeSelectClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.LaundryWasherModeSelectCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("laundryWasherModeSelect", laundryWasherModeSelectClusterInfo); - ClusterInfo refrigeratorAndTemperatureControlledCabinetModeSelectClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("refrigeratorAndTemperatureControlledCabinetModeSelect", refrigeratorAndTemperatureControlledCabinetModeSelectClusterInfo); + ClusterInfo laundryWasherModeClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.LaundryWasherModeCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("laundryWasherMode", laundryWasherModeClusterInfo); + ClusterInfo refrigeratorAndTemperatureControlledCabinetModeClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("refrigeratorAndTemperatureControlledCabinetMode", refrigeratorAndTemperatureControlledCabinetModeClusterInfo); ClusterInfo washerControlsClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.WasherControlsCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("washerControls", washerControlsClusterInfo); - ClusterInfo rvcRunModeSelectClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.RvcRunModeSelectCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("rvcRunModeSelect", rvcRunModeSelectClusterInfo); - ClusterInfo rvcCleanModeSelectClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.RvcCleanModeSelectCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("rvcCleanModeSelect", rvcCleanModeSelectClusterInfo); + ClusterInfo rvcRunModeClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.RvcRunModeCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("rvcRunMode", rvcRunModeClusterInfo); + ClusterInfo rvcCleanModeClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.RvcCleanModeCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("rvcCleanMode", rvcCleanModeClusterInfo); ClusterInfo temperatureControlClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.TemperatureControlCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("temperatureControl", temperatureControlClusterInfo); ClusterInfo refrigeratorAlarmClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.RefrigeratorAlarmCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("refrigeratorAlarm", refrigeratorAlarmClusterInfo); - ClusterInfo dishwasherModeSelectClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.DishwasherModeSelectCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("dishwasherModeSelect", dishwasherModeSelectClusterInfo); + ClusterInfo dishwasherModeClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.DishwasherModeCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("dishwasherMode", dishwasherModeClusterInfo); ClusterInfo airQualityClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.AirQualityCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("airQuality", airQualityClusterInfo); @@ -19852,6 +20003,9 @@ public Map initializeClusterMap() { ClusterInfo operationalStateClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.OperationalStateCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("operationalState", operationalStateClusterInfo); + ClusterInfo rvcOperationalStateClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.RvcOperationalStateCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("rvcOperationalState", rvcOperationalStateClusterInfo); ClusterInfo hepaFilterMonitoringClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.HepaFilterMonitoringCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("hepaFilterMonitoring", hepaFilterMonitoringClusterInfo); @@ -20132,17 +20286,18 @@ public void combineCommand(Map destination, Map> getCommandMap() { modeSelectchangeToModeCommandParams ); modeSelectClusterInteractionInfoMap.put("changeToMode", modeSelectchangeToModeInteractionInfo); - Map modeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo modeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - modeSelectchangeToModeWithStatusCommandParams.put("newMode",modeSelectchangeToModeWithStatusnewModeCommandParameterInfo); - - InteractionInfo modeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.ModeSelectCluster.ChangeToModeResponseCallback) callback - , (Integer) - commandArguments.get("newMode") - - ); - }, - () -> new DelegatedModeSelectClusterChangeToModeResponseCallback(), - modeSelectchangeToModeWithStatusCommandParams - ); - modeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", modeSelectchangeToModeWithStatusInteractionInfo); commandMap.put("modeSelect", modeSelectClusterInteractionInfoMap); - Map laundryWasherModeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); - Map laundryWasherModeSelectchangeToModeCommandParams = new LinkedHashMap(); - CommandParameterInfo laundryWasherModeSelectchangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - laundryWasherModeSelectchangeToModeCommandParams.put("newMode",laundryWasherModeSelectchangeToModenewModeCommandParameterInfo); + Map laundryWasherModeClusterInteractionInfoMap = new LinkedHashMap<>(); + Map laundryWasherModechangeToModeCommandParams = new LinkedHashMap(); + CommandParameterInfo laundryWasherModechangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); + laundryWasherModechangeToModeCommandParams.put("newMode",laundryWasherModechangeToModenewModeCommandParameterInfo); - InteractionInfo laundryWasherModeSelectchangeToModeInteractionInfo = new InteractionInfo( + InteractionInfo laundryWasherModechangeToModeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster) - .changeToMode((DefaultClusterCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster) + .changeToMode((ChipClusters.LaundryWasherModeCluster.ChangeToModeResponseCallback) callback , (Integer) commandArguments.get("newMode") ); }, - () -> new DelegatedDefaultClusterCallback(), - laundryWasherModeSelectchangeToModeCommandParams + () -> new DelegatedLaundryWasherModeClusterChangeToModeResponseCallback(), + laundryWasherModechangeToModeCommandParams ); - laundryWasherModeSelectClusterInteractionInfoMap.put("changeToMode", laundryWasherModeSelectchangeToModeInteractionInfo); - Map laundryWasherModeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo laundryWasherModeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - laundryWasherModeSelectchangeToModeWithStatusCommandParams.put("newMode",laundryWasherModeSelectchangeToModeWithStatusnewModeCommandParameterInfo); + laundryWasherModeClusterInteractionInfoMap.put("changeToMode", laundryWasherModechangeToModeInteractionInfo); + commandMap.put("laundryWasherMode", laundryWasherModeClusterInteractionInfoMap); + Map refrigeratorAndTemperatureControlledCabinetModeClusterInteractionInfoMap = new LinkedHashMap<>(); + Map refrigeratorAndTemperatureControlledCabinetModechangeToModeCommandParams = new LinkedHashMap(); + CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModechangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); + refrigeratorAndTemperatureControlledCabinetModechangeToModeCommandParams.put("newMode",refrigeratorAndTemperatureControlledCabinetModechangeToModenewModeCommandParameterInfo); - InteractionInfo laundryWasherModeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( + InteractionInfo refrigeratorAndTemperatureControlledCabinetModechangeToModeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.LaundryWasherModeSelectCluster.ChangeToModeResponseCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster) + .changeToMode((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.ChangeToModeResponseCallback) callback , (Integer) commandArguments.get("newMode") ); }, - () -> new DelegatedLaundryWasherModeSelectClusterChangeToModeResponseCallback(), - laundryWasherModeSelectchangeToModeWithStatusCommandParams + () -> new DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(), + refrigeratorAndTemperatureControlledCabinetModechangeToModeCommandParams ); - laundryWasherModeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", laundryWasherModeSelectchangeToModeWithStatusInteractionInfo); - commandMap.put("laundryWasherModeSelect", laundryWasherModeSelectClusterInteractionInfoMap); - Map refrigeratorAndTemperatureControlledCabinetModeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); - Map refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeCommandParams = new LinkedHashMap(); - CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeCommandParams.put("newMode",refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModenewModeCommandParameterInfo); - - InteractionInfo refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster) - .changeToMode((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("newMode") - - ); - }, - () -> new DelegatedDefaultClusterCallback(), - refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeCommandParams - ); - refrigeratorAndTemperatureControlledCabinetModeSelectClusterInteractionInfoMap.put("changeToMode", refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeInteractionInfo); - Map refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusCommandParams.put("newMode",refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusnewModeCommandParameterInfo); + refrigeratorAndTemperatureControlledCabinetModeClusterInteractionInfoMap.put("changeToMode", refrigeratorAndTemperatureControlledCabinetModechangeToModeInteractionInfo); + commandMap.put("refrigeratorAndTemperatureControlledCabinetMode", refrigeratorAndTemperatureControlledCabinetModeClusterInteractionInfoMap); + Map washerControlsClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("washerControls", washerControlsClusterInteractionInfoMap); + Map rvcRunModeClusterInteractionInfoMap = new LinkedHashMap<>(); + Map rvcRunModechangeToModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcRunModechangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); + rvcRunModechangeToModeCommandParams.put("newMode",rvcRunModechangeToModenewModeCommandParameterInfo); - InteractionInfo refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( + InteractionInfo rvcRunModechangeToModeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.ChangeToModeResponseCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster) + .changeToMode((ChipClusters.RvcRunModeCluster.ChangeToModeResponseCallback) callback , (Integer) commandArguments.get("newMode") ); }, - () -> new DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback(), - refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusCommandParams + () -> new DelegatedRvcRunModeClusterChangeToModeResponseCallback(), + rvcRunModechangeToModeCommandParams ); - refrigeratorAndTemperatureControlledCabinetModeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusInteractionInfo); - commandMap.put("refrigeratorAndTemperatureControlledCabinetModeSelect", refrigeratorAndTemperatureControlledCabinetModeSelectClusterInteractionInfoMap); - Map washerControlsClusterInteractionInfoMap = new LinkedHashMap<>(); - commandMap.put("washerControls", washerControlsClusterInteractionInfoMap); - Map rvcRunModeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); - Map rvcRunModeSelectchangeToModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcRunModeSelectchangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - rvcRunModeSelectchangeToModeCommandParams.put("newMode",rvcRunModeSelectchangeToModenewModeCommandParameterInfo); + rvcRunModeClusterInteractionInfoMap.put("changeToMode", rvcRunModechangeToModeInteractionInfo); + commandMap.put("rvcRunMode", rvcRunModeClusterInteractionInfoMap); + Map rvcCleanModeClusterInteractionInfoMap = new LinkedHashMap<>(); + Map rvcCleanModechangeToModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcCleanModechangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); + rvcCleanModechangeToModeCommandParams.put("newMode",rvcCleanModechangeToModenewModeCommandParameterInfo); - InteractionInfo rvcRunModeSelectchangeToModeInteractionInfo = new InteractionInfo( + InteractionInfo rvcCleanModechangeToModeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster) - .changeToMode((DefaultClusterCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster) + .changeToMode((ChipClusters.RvcCleanModeCluster.ChangeToModeResponseCallback) callback , (Integer) commandArguments.get("newMode") ); }, - () -> new DelegatedDefaultClusterCallback(), - rvcRunModeSelectchangeToModeCommandParams + () -> new DelegatedRvcCleanModeClusterChangeToModeResponseCallback(), + rvcCleanModechangeToModeCommandParams ); - rvcRunModeSelectClusterInteractionInfoMap.put("changeToMode", rvcRunModeSelectchangeToModeInteractionInfo); - Map rvcRunModeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcRunModeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - rvcRunModeSelectchangeToModeWithStatusCommandParams.put("newMode",rvcRunModeSelectchangeToModeWithStatusnewModeCommandParameterInfo); + rvcCleanModeClusterInteractionInfoMap.put("changeToMode", rvcCleanModechangeToModeInteractionInfo); + commandMap.put("rvcCleanMode", rvcCleanModeClusterInteractionInfoMap); + Map temperatureControlClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("temperatureControl", temperatureControlClusterInteractionInfoMap); + Map refrigeratorAlarmClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("refrigeratorAlarm", refrigeratorAlarmClusterInteractionInfoMap); + Map dishwasherModeClusterInteractionInfoMap = new LinkedHashMap<>(); + Map dishwasherModechangeToModeCommandParams = new LinkedHashMap(); + CommandParameterInfo dishwasherModechangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); + dishwasherModechangeToModeCommandParams.put("newMode",dishwasherModechangeToModenewModeCommandParameterInfo); - InteractionInfo rvcRunModeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( + InteractionInfo dishwasherModechangeToModeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.RvcRunModeSelectCluster.ChangeToModeResponseCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster) + .changeToMode((ChipClusters.DishwasherModeCluster.ChangeToModeResponseCallback) callback , (Integer) commandArguments.get("newMode") ); }, - () -> new DelegatedRvcRunModeSelectClusterChangeToModeResponseCallback(), - rvcRunModeSelectchangeToModeWithStatusCommandParams + () -> new DelegatedDishwasherModeClusterChangeToModeResponseCallback(), + dishwasherModechangeToModeCommandParams ); - rvcRunModeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", rvcRunModeSelectchangeToModeWithStatusInteractionInfo); - commandMap.put("rvcRunModeSelect", rvcRunModeSelectClusterInteractionInfoMap); - Map rvcCleanModeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); - Map rvcCleanModeSelectchangeToModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcCleanModeSelectchangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - rvcCleanModeSelectchangeToModeCommandParams.put("newMode",rvcCleanModeSelectchangeToModenewModeCommandParameterInfo); - - InteractionInfo rvcCleanModeSelectchangeToModeInteractionInfo = new InteractionInfo( + dishwasherModeClusterInteractionInfoMap.put("changeToMode", dishwasherModechangeToModeInteractionInfo); + commandMap.put("dishwasherMode", dishwasherModeClusterInteractionInfoMap); + Map airQualityClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("airQuality", airQualityClusterInteractionInfoMap); + Map smokeCoAlarmClusterInteractionInfoMap = new LinkedHashMap<>(); + Map smokeCoAlarmselfTestRequestCommandParams = new LinkedHashMap(); + InteractionInfo smokeCoAlarmselfTestRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster) - .changeToMode((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("newMode") + ((ChipClusters.SmokeCoAlarmCluster) cluster) + .selfTestRequest((DefaultClusterCallback) callback ); }, () -> new DelegatedDefaultClusterCallback(), - rvcCleanModeSelectchangeToModeCommandParams + smokeCoAlarmselfTestRequestCommandParams ); - rvcCleanModeSelectClusterInteractionInfoMap.put("changeToMode", rvcCleanModeSelectchangeToModeInteractionInfo); - Map rvcCleanModeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcCleanModeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - rvcCleanModeSelectchangeToModeWithStatusCommandParams.put("newMode",rvcCleanModeSelectchangeToModeWithStatusnewModeCommandParameterInfo); - - InteractionInfo rvcCleanModeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( + smokeCoAlarmClusterInteractionInfoMap.put("selfTestRequest", smokeCoAlarmselfTestRequestInteractionInfo); + commandMap.put("smokeCoAlarm", smokeCoAlarmClusterInteractionInfoMap); + Map operationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("operationalState", operationalStateClusterInteractionInfoMap); + Map rvcOperationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); + Map rvcOperationalStatepauseCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStatepauseInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.RvcCleanModeSelectCluster.ChangeToModeResponseCallback) callback - , (Integer) - commandArguments.get("newMode") + ((ChipClusters.RvcOperationalStateCluster) cluster) + .pause((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedRvcCleanModeSelectClusterChangeToModeResponseCallback(), - rvcCleanModeSelectchangeToModeWithStatusCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStatepauseCommandParams ); - rvcCleanModeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", rvcCleanModeSelectchangeToModeWithStatusInteractionInfo); - commandMap.put("rvcCleanModeSelect", rvcCleanModeSelectClusterInteractionInfoMap); - Map temperatureControlClusterInteractionInfoMap = new LinkedHashMap<>(); - commandMap.put("temperatureControl", temperatureControlClusterInteractionInfoMap); - Map refrigeratorAlarmClusterInteractionInfoMap = new LinkedHashMap<>(); - commandMap.put("refrigeratorAlarm", refrigeratorAlarmClusterInteractionInfoMap); - Map dishwasherModeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); - Map dishwasherModeSelectchangeToModeCommandParams = new LinkedHashMap(); - CommandParameterInfo dishwasherModeSelectchangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - dishwasherModeSelectchangeToModeCommandParams.put("newMode",dishwasherModeSelectchangeToModenewModeCommandParameterInfo); - - InteractionInfo dishwasherModeSelectchangeToModeInteractionInfo = new InteractionInfo( + rvcOperationalStateClusterInteractionInfoMap.put("pause", rvcOperationalStatepauseInteractionInfo); + Map rvcOperationalStatestopCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStatestopInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster) - .changeToMode((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("newMode") + ((ChipClusters.RvcOperationalStateCluster) cluster) + .stop((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedDefaultClusterCallback(), - dishwasherModeSelectchangeToModeCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStatestopCommandParams ); - dishwasherModeSelectClusterInteractionInfoMap.put("changeToMode", dishwasherModeSelectchangeToModeInteractionInfo); - Map dishwasherModeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo dishwasherModeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - dishwasherModeSelectchangeToModeWithStatusCommandParams.put("newMode",dishwasherModeSelectchangeToModeWithStatusnewModeCommandParameterInfo); - - InteractionInfo dishwasherModeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( + rvcOperationalStateClusterInteractionInfoMap.put("stop", rvcOperationalStatestopInteractionInfo); + Map rvcOperationalStatestartCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStatestartInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.DishwasherModeSelectCluster.ChangeToModeResponseCallback) callback - , (Integer) - commandArguments.get("newMode") + ((ChipClusters.RvcOperationalStateCluster) cluster) + .start((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedDishwasherModeSelectClusterChangeToModeResponseCallback(), - dishwasherModeSelectchangeToModeWithStatusCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStatestartCommandParams ); - dishwasherModeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", dishwasherModeSelectchangeToModeWithStatusInteractionInfo); - commandMap.put("dishwasherModeSelect", dishwasherModeSelectClusterInteractionInfoMap); - Map airQualityClusterInteractionInfoMap = new LinkedHashMap<>(); - commandMap.put("airQuality", airQualityClusterInteractionInfoMap); - Map smokeCoAlarmClusterInteractionInfoMap = new LinkedHashMap<>(); - Map smokeCoAlarmselfTestRequestCommandParams = new LinkedHashMap(); - InteractionInfo smokeCoAlarmselfTestRequestInteractionInfo = new InteractionInfo( + rvcOperationalStateClusterInteractionInfoMap.put("start", rvcOperationalStatestartInteractionInfo); + Map rvcOperationalStateresumeCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStateresumeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.SmokeCoAlarmCluster) cluster) - .selfTestRequest((DefaultClusterCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster) + .resume((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedDefaultClusterCallback(), - smokeCoAlarmselfTestRequestCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStateresumeCommandParams ); - smokeCoAlarmClusterInteractionInfoMap.put("selfTestRequest", smokeCoAlarmselfTestRequestInteractionInfo); - commandMap.put("smokeCoAlarm", smokeCoAlarmClusterInteractionInfoMap); - Map operationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); - commandMap.put("operationalState", operationalStateClusterInteractionInfoMap); + rvcOperationalStateClusterInteractionInfoMap.put("resume", rvcOperationalStateresumeInteractionInfo); + commandMap.put("rvcOperationalState", rvcOperationalStateClusterInteractionInfoMap); Map hepaFilterMonitoringClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("hepaFilterMonitoring", hepaFilterMonitoringClusterInteractionInfoMap); Map activatedCarbonFilterMonitoringClusterInteractionInfoMap = new LinkedHashMap<>(); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index d65219839e0887..ebcb10cbbb1287 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -4279,13 +4279,6 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { @@ -4364,8 +4357,8 @@ class ChipClusters: }, }, } - _LAUNDRY_WASHER_MODE_SELECT_CLUSTER_INFO = { - "clusterName": "LaundryWasherModeSelect", + _LAUNDRY_WASHER_MODE_CLUSTER_INFO = { + "clusterName": "LaundryWasherMode", "clusterId": 0x00000051, "commands": { 0x00000000: { @@ -4375,43 +4368,30 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { - "attributeName": "Description", - "attributeId": 0x00000000, - "type": "str", - "reportable": True, - }, - 0x00000002: { "attributeName": "SupportedModes", - "attributeId": 0x00000002, + "attributeId": 0x00000000, "type": "", "reportable": True, }, - 0x00000003: { + 0x00000001: { "attributeName": "CurrentMode", - "attributeId": 0x00000003, + "attributeId": 0x00000001, "type": "int", "reportable": True, }, - 0x00000004: { + 0x00000002: { "attributeName": "StartUpMode", - "attributeId": 0x00000004, + "attributeId": 0x00000002, "type": "int", "reportable": True, "writable": True, }, - 0x00000005: { + 0x00000003: { "attributeName": "OnMode", - "attributeId": 0x00000005, + "attributeId": 0x00000003, "type": "int", "reportable": True, "writable": True, @@ -4454,8 +4434,8 @@ class ChipClusters: }, }, } - _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER_INFO = { - "clusterName": "RefrigeratorAndTemperatureControlledCabinetModeSelect", + _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_INFO = { + "clusterName": "RefrigeratorAndTemperatureControlledCabinetMode", "clusterId": 0x00000052, "commands": { 0x00000000: { @@ -4465,43 +4445,30 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { - "attributeName": "Description", - "attributeId": 0x00000000, - "type": "str", - "reportable": True, - }, - 0x00000002: { "attributeName": "SupportedModes", - "attributeId": 0x00000002, + "attributeId": 0x00000000, "type": "", "reportable": True, }, - 0x00000003: { + 0x00000001: { "attributeName": "CurrentMode", - "attributeId": 0x00000003, + "attributeId": 0x00000001, "type": "int", "reportable": True, }, - 0x00000004: { + 0x00000002: { "attributeName": "StartUpMode", - "attributeId": 0x00000004, + "attributeId": 0x00000002, "type": "int", "reportable": True, "writable": True, }, - 0x00000005: { + 0x00000003: { "attributeName": "OnMode", - "attributeId": 0x00000005, + "attributeId": 0x00000003, "type": "int", "reportable": True, "writable": True, @@ -4614,8 +4581,8 @@ class ChipClusters: }, }, } - _RVC_RUN_MODE_SELECT_CLUSTER_INFO = { - "clusterName": "RvcRunModeSelect", + _RVC_RUN_MODE_CLUSTER_INFO = { + "clusterName": "RvcRunMode", "clusterId": 0x00000054, "commands": { 0x00000000: { @@ -4625,43 +4592,30 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { - "attributeName": "Description", - "attributeId": 0x00000000, - "type": "str", - "reportable": True, - }, - 0x00000002: { "attributeName": "SupportedModes", - "attributeId": 0x00000002, + "attributeId": 0x00000000, "type": "", "reportable": True, }, - 0x00000003: { + 0x00000001: { "attributeName": "CurrentMode", - "attributeId": 0x00000003, + "attributeId": 0x00000001, "type": "int", "reportable": True, }, - 0x00000004: { + 0x00000002: { "attributeName": "StartUpMode", - "attributeId": 0x00000004, + "attributeId": 0x00000002, "type": "int", "reportable": True, "writable": True, }, - 0x00000005: { + 0x00000003: { "attributeName": "OnMode", - "attributeId": 0x00000005, + "attributeId": 0x00000003, "type": "int", "reportable": True, "writable": True, @@ -4704,8 +4658,8 @@ class ChipClusters: }, }, } - _RVC_CLEAN_MODE_SELECT_CLUSTER_INFO = { - "clusterName": "RvcCleanModeSelect", + _RVC_CLEAN_MODE_CLUSTER_INFO = { + "clusterName": "RvcCleanMode", "clusterId": 0x00000055, "commands": { 0x00000000: { @@ -4715,43 +4669,30 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { - "attributeName": "Description", - "attributeId": 0x00000000, - "type": "str", - "reportable": True, - }, - 0x00000002: { "attributeName": "SupportedModes", - "attributeId": 0x00000002, + "attributeId": 0x00000000, "type": "", "reportable": True, }, - 0x00000003: { + 0x00000001: { "attributeName": "CurrentMode", - "attributeId": 0x00000003, + "attributeId": 0x00000001, "type": "int", "reportable": True, }, - 0x00000004: { + 0x00000002: { "attributeName": "StartUpMode", - "attributeId": 0x00000004, + "attributeId": 0x00000002, "type": "int", "reportable": True, "writable": True, }, - 0x00000005: { + 0x00000003: { "attributeName": "OnMode", - "attributeId": 0x00000005, + "attributeId": 0x00000003, "type": "int", "reportable": True, "writable": True, @@ -4938,8 +4879,8 @@ class ChipClusters: }, }, } - _DISHWASHER_MODE_SELECT_CLUSTER_INFO = { - "clusterName": "DishwasherModeSelect", + _DISHWASHER_MODE_CLUSTER_INFO = { + "clusterName": "DishwasherMode", "clusterId": 0x00000059, "commands": { 0x00000000: { @@ -4949,43 +4890,30 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { - "attributeName": "Description", - "attributeId": 0x00000000, - "type": "str", - "reportable": True, - }, - 0x00000002: { "attributeName": "SupportedModes", - "attributeId": 0x00000002, + "attributeId": 0x00000000, "type": "", "reportable": True, }, - 0x00000003: { + 0x00000001: { "attributeName": "CurrentMode", - "attributeId": 0x00000003, + "attributeId": 0x00000001, "type": "int", "reportable": True, }, - 0x00000004: { + 0x00000002: { "attributeName": "StartUpMode", - "attributeId": 0x00000004, + "attributeId": 0x00000002, "type": "int", "reportable": True, "writable": True, }, - 0x00000005: { + 0x00000003: { "attributeName": "OnMode", - "attributeId": 0x00000005, + "attributeId": 0x00000003, "type": "int", "reportable": True, "writable": True, @@ -5305,6 +5233,110 @@ class ChipClusters: }, }, } + _RVC_OPERATIONAL_STATE_CLUSTER_INFO = { + "clusterName": "RvcOperationalState", + "clusterId": 0x00000061, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "Pause", + "args": { + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "Stop", + "args": { + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "Start", + "args": { + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "Resume", + "args": { + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "PhaseList", + "attributeId": 0x00000000, + "type": "str", + "reportable": True, + }, + 0x00000001: { + "attributeName": "CurrentPhase", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "CountdownTime", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "OperationalStateList", + "attributeId": 0x00000003, + "type": "", + "reportable": True, + }, + 0x00000004: { + "attributeName": "OperationalState", + "attributeId": 0x00000004, + "type": "", + "reportable": True, + }, + 0x00000005: { + "attributeName": "OperationalError", + "attributeId": 0x00000005, + "type": "", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _HEPA_FILTER_MONITORING_CLUSTER_INFO = { "clusterName": "HepaFilterMonitoring", "clusterId": 0x00000071, @@ -15580,17 +15612,18 @@ class ChipClusters: 0x00000045: _BOOLEAN_STATE_CLUSTER_INFO, 0x00000046: _ICD_MANAGEMENT_CLUSTER_INFO, 0x00000050: _MODE_SELECT_CLUSTER_INFO, - 0x00000051: _LAUNDRY_WASHER_MODE_SELECT_CLUSTER_INFO, - 0x00000052: _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER_INFO, + 0x00000051: _LAUNDRY_WASHER_MODE_CLUSTER_INFO, + 0x00000052: _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_INFO, 0x00000053: _WASHER_CONTROLS_CLUSTER_INFO, - 0x00000054: _RVC_RUN_MODE_SELECT_CLUSTER_INFO, - 0x00000055: _RVC_CLEAN_MODE_SELECT_CLUSTER_INFO, + 0x00000054: _RVC_RUN_MODE_CLUSTER_INFO, + 0x00000055: _RVC_CLEAN_MODE_CLUSTER_INFO, 0x00000056: _TEMPERATURE_CONTROL_CLUSTER_INFO, 0x00000057: _REFRIGERATOR_ALARM_CLUSTER_INFO, - 0x00000059: _DISHWASHER_MODE_SELECT_CLUSTER_INFO, + 0x00000059: _DISHWASHER_MODE_CLUSTER_INFO, 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, 0x00000060: _OPERATIONAL_STATE_CLUSTER_INFO, + 0x00000061: _RVC_OPERATIONAL_STATE_CLUSTER_INFO, 0x00000071: _HEPA_FILTER_MONITORING_CLUSTER_INFO, 0x00000072: _ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_INFO, 0x00000073: _CERAMIC_FILTER_MONITORING_CLUSTER_INFO, @@ -15714,17 +15747,18 @@ class ChipClusters: "BooleanState": _BOOLEAN_STATE_CLUSTER_INFO, "IcdManagement": _ICD_MANAGEMENT_CLUSTER_INFO, "ModeSelect": _MODE_SELECT_CLUSTER_INFO, - "LaundryWasherModeSelect": _LAUNDRY_WASHER_MODE_SELECT_CLUSTER_INFO, - "RefrigeratorAndTemperatureControlledCabinetModeSelect": _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER_INFO, + "LaundryWasherMode": _LAUNDRY_WASHER_MODE_CLUSTER_INFO, + "RefrigeratorAndTemperatureControlledCabinetMode": _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_INFO, "WasherControls": _WASHER_CONTROLS_CLUSTER_INFO, - "RvcRunModeSelect": _RVC_RUN_MODE_SELECT_CLUSTER_INFO, - "RvcCleanModeSelect": _RVC_CLEAN_MODE_SELECT_CLUSTER_INFO, + "RvcRunMode": _RVC_RUN_MODE_CLUSTER_INFO, + "RvcCleanMode": _RVC_CLEAN_MODE_CLUSTER_INFO, "TemperatureControl": _TEMPERATURE_CONTROL_CLUSTER_INFO, "RefrigeratorAlarm": _REFRIGERATOR_ALARM_CLUSTER_INFO, - "DishwasherModeSelect": _DISHWASHER_MODE_SELECT_CLUSTER_INFO, + "DishwasherMode": _DISHWASHER_MODE_CLUSTER_INFO, "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "SmokeCoAlarm": _SMOKE_CO_ALARM_CLUSTER_INFO, "OperationalState": _OPERATIONAL_STATE_CLUSTER_INFO, + "RvcOperationalState": _RVC_OPERATIONAL_STATE_CLUSTER_INFO, "HepaFilterMonitoring": _HEPA_FILTER_MONITORING_CLUSTER_INFO, "ActivatedCarbonFilterMonitoring": _ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_INFO, "CeramicFilterMonitoring": _CERAMIC_FILTER_MONITORING_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 06be17d6c5a97d..da33a4a753e694 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -14869,7 +14869,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="standardNamespace", Tag=0x00000001, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="standardNamespace", Tag=0x00000001, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[ModeSelect.Structs.ModeOptionStruct]), ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), @@ -14883,7 +14883,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ]) description: 'str' = None - standardNamespace: 'typing.Union[None, Nullable, uint]' = None + standardNamespace: 'typing.Union[Nullable, uint]' = None supportedModes: 'typing.List[ModeSelect.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None @@ -14895,54 +14895,23 @@ def descriptor(cls) -> ClusterObjectDescriptor: featureMap: 'uint' = None clusterRevision: 'uint' = None - class Enums: - class ModeTag(MatterIntEnum): - kAuto = 0x00 - kQuick = 0x01 - kQuiet = 0x02 - kLowNoise = 0x03 - kLowEnergy = 0x04 - kVacation = 0x05 - kMin = 0x06 - kMax = 0x07 - kNight = 0x08 - kDay = 0x09 - # 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 = 10, - - class StatusCode(MatterIntEnum): - kSuccess = 0x00 - kUnsupportedMode = 0x01 - kGenericFailure = 0x02 - # 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 = 3, - class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass - class ModeTagStruct(ClusterObject): + class SemanticTagStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) - mfgCode: 'typing.Optional[uint]' = None + mfgCode: 'uint' = 0 value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -14952,12 +14921,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[ModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="semanticTags", Tag=2, Type=typing.List[ModeSelect.Structs.SemanticTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[ModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + semanticTags: 'typing.List[ModeSelect.Structs.SemanticTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -14976,40 +14945,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: newMode: 'uint' = 0 - @dataclass - class ChangeToModeWithStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0050 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = 'ChangeToModeResponse' - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0050 - command_id: typing.ClassVar[int] = 0x00000002 - is_client: typing.ClassVar[bool] = False - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="statusText", Tag=1, Type=typing.Optional[str]), - ]) - - status: 'uint' = 0 - statusText: 'typing.Optional[str]' = None - class Attributes: @dataclass class Description(ClusterAttributeDescriptor): @@ -15039,9 +14974,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) - value: 'typing.Union[None, Nullable, uint]' = None + value: 'typing.Union[Nullable, uint]' = NullValue @dataclass class SupportedModes(ClusterAttributeDescriptor): @@ -15205,18 +15140,17 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class LaundryWasherModeSelect(Cluster): +class LaundryWasherMode(Cluster): id: typing.ClassVar[int] = 0x0051 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[LaundryWasherModeSelect.Structs.ModeOptionStruct]), - ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[LaundryWasherMode.Structs.ModeOptionStruct]), + ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -15225,8 +15159,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - description: 'str' = None - supportedModes: 'typing.List[LaundryWasherModeSelect.Structs.ModeOptionStruct]' = None + supportedModes: 'typing.List[LaundryWasherMode.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None onMode: 'typing.Union[None, Nullable, uint]' = None @@ -15252,7 +15185,6 @@ class ModeTag(MatterIntEnum): class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass @@ -15263,12 +15195,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) mfgCode: 'typing.Optional[uint]' = None value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -15278,12 +15208,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[LaundryWasherModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[LaundryWasherMode.Structs.ModeTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[LaundryWasherModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + modeTags: 'typing.List[LaundryWasherMode.Structs.ModeTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -15291,22 +15221,6 @@ class ChangeToMode(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0051 command_id: typing.ClassVar[int] = 0x00000000 is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeWithStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0051 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True response_type: typing.ClassVar[str] = 'ChangeToModeResponse' @ChipUtility.classproperty @@ -15321,7 +15235,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ChangeToModeResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0051 - command_id: typing.ClassVar[int] = 0x00000002 + command_id: typing.ClassVar[int] = 0x00000001 is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @@ -15337,22 +15251,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: statusText: 'typing.Optional[str]' = None class Attributes: - @dataclass - class Description(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0051 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=str) - - value: 'str' = "" - @dataclass class SupportedModes(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -15361,13 +15259,13 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000002 + return 0x00000000 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[LaundryWasherModeSelect.Structs.ModeOptionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[LaundryWasherMode.Structs.ModeOptionStruct]) - value: 'typing.List[LaundryWasherModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) + value: 'typing.List[LaundryWasherMode.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) @dataclass class CurrentMode(ClusterAttributeDescriptor): @@ -15377,7 +15275,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000003 + return 0x00000001 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -15393,7 +15291,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000004 + return 0x00000002 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -15409,7 +15307,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000005 + return 0x00000003 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -15515,18 +15413,17 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class RefrigeratorAndTemperatureControlledCabinetModeSelect(Cluster): +class RefrigeratorAndTemperatureControlledCabinetMode(Cluster): id: typing.ClassVar[int] = 0x0052 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeOptionStruct]), - ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeOptionStruct]), + ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -15535,8 +15432,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - description: 'str' = None - supportedModes: 'typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeOptionStruct]' = None + supportedModes: 'typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None onMode: 'typing.Union[None, Nullable, uint]' = None @@ -15560,7 +15456,6 @@ class ModeTag(MatterIntEnum): class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass @@ -15571,12 +15466,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) mfgCode: 'typing.Optional[uint]' = None value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -15586,12 +15479,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + modeTags: 'typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -15599,22 +15492,6 @@ class ChangeToMode(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0052 command_id: typing.ClassVar[int] = 0x00000000 is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeWithStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0052 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True response_type: typing.ClassVar[str] = 'ChangeToModeResponse' @ChipUtility.classproperty @@ -15629,7 +15506,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ChangeToModeResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0052 - command_id: typing.ClassVar[int] = 0x00000002 + command_id: typing.ClassVar[int] = 0x00000001 is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @@ -15645,22 +15522,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: statusText: 'typing.Optional[str]' = None class Attributes: - @dataclass - class Description(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0052 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=str) - - value: 'str' = "" - @dataclass class SupportedModes(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -15669,13 +15530,13 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000002 + return 0x00000000 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeOptionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeOptionStruct]) - value: 'typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) + value: 'typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) @dataclass class CurrentMode(ClusterAttributeDescriptor): @@ -15685,7 +15546,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000003 + return 0x00000001 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -15701,7 +15562,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000004 + return 0x00000002 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -15717,7 +15578,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000005 + return 0x00000003 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16021,18 +15882,17 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class RvcRunModeSelect(Cluster): +class RvcRunMode(Cluster): id: typing.ClassVar[int] = 0x0054 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[RvcRunModeSelect.Structs.ModeOptionStruct]), - ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[RvcRunMode.Structs.ModeOptionStruct]), + ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -16041,8 +15901,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - description: 'str' = None - supportedModes: 'typing.List[RvcRunModeSelect.Structs.ModeOptionStruct]' = None + supportedModes: 'typing.List[RvcRunMode.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None onMode: 'typing.Union[None, Nullable, uint]' = None @@ -16081,7 +15940,6 @@ class StatusCode(MatterIntEnum): class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass @@ -16092,12 +15950,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) mfgCode: 'typing.Optional[uint]' = None value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -16107,12 +15963,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RvcRunModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RvcRunMode.Structs.ModeTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[RvcRunModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + modeTags: 'typing.List[RvcRunMode.Structs.ModeTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -16120,22 +15976,6 @@ class ChangeToMode(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0054 command_id: typing.ClassVar[int] = 0x00000000 is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeWithStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0054 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True response_type: typing.ClassVar[str] = 'ChangeToModeResponse' @ChipUtility.classproperty @@ -16150,7 +15990,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ChangeToModeResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0054 - command_id: typing.ClassVar[int] = 0x00000002 + command_id: typing.ClassVar[int] = 0x00000001 is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @@ -16166,22 +16006,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: statusText: 'typing.Optional[str]' = None class Attributes: - @dataclass - class Description(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0054 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=str) - - value: 'str' = "" - @dataclass class SupportedModes(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -16190,13 +16014,13 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000002 + return 0x00000000 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[RvcRunModeSelect.Structs.ModeOptionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[RvcRunMode.Structs.ModeOptionStruct]) - value: 'typing.List[RvcRunModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) + value: 'typing.List[RvcRunMode.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) @dataclass class CurrentMode(ClusterAttributeDescriptor): @@ -16206,7 +16030,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000003 + return 0x00000001 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16222,7 +16046,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000004 + return 0x00000002 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16238,7 +16062,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000005 + return 0x00000003 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16344,18 +16168,17 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class RvcCleanModeSelect(Cluster): +class RvcCleanMode(Cluster): id: typing.ClassVar[int] = 0x0055 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[RvcCleanModeSelect.Structs.ModeOptionStruct]), - ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[RvcCleanMode.Structs.ModeOptionStruct]), + ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -16364,8 +16187,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - description: 'str' = None - supportedModes: 'typing.List[RvcCleanModeSelect.Structs.ModeOptionStruct]' = None + supportedModes: 'typing.List[RvcCleanMode.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None onMode: 'typing.Union[None, Nullable, uint]' = None @@ -16398,7 +16220,6 @@ class StatusCode(MatterIntEnum): class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass @@ -16409,12 +16230,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) mfgCode: 'typing.Optional[uint]' = None value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -16424,12 +16243,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RvcCleanModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RvcCleanMode.Structs.ModeTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[RvcCleanModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + modeTags: 'typing.List[RvcCleanMode.Structs.ModeTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -16437,22 +16256,6 @@ class ChangeToMode(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0055 command_id: typing.ClassVar[int] = 0x00000000 is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeWithStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0055 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True response_type: typing.ClassVar[str] = 'ChangeToModeResponse' @ChipUtility.classproperty @@ -16467,7 +16270,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ChangeToModeResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0055 - command_id: typing.ClassVar[int] = 0x00000002 + command_id: typing.ClassVar[int] = 0x00000001 is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @@ -16483,22 +16286,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: statusText: 'typing.Optional[str]' = None class Attributes: - @dataclass - class Description(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0055 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=str) - - value: 'str' = "" - @dataclass class SupportedModes(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -16507,13 +16294,13 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000002 + return 0x00000000 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[RvcCleanModeSelect.Structs.ModeOptionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[RvcCleanMode.Structs.ModeOptionStruct]) - value: 'typing.List[RvcCleanModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) + value: 'typing.List[RvcCleanMode.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) @dataclass class CurrentMode(ClusterAttributeDescriptor): @@ -16523,7 +16310,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000003 + return 0x00000001 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16539,7 +16326,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000004 + return 0x00000002 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16555,7 +16342,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000005 + return 0x00000003 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -17102,18 +16889,17 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass -class DishwasherModeSelect(Cluster): +class DishwasherMode(Cluster): id: typing.ClassVar[int] = 0x0059 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[DishwasherModeSelect.Structs.ModeOptionStruct]), - ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[DishwasherMode.Structs.ModeOptionStruct]), + ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -17122,8 +16908,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - description: 'str' = None - supportedModes: 'typing.List[DishwasherModeSelect.Structs.ModeOptionStruct]' = None + supportedModes: 'typing.List[DishwasherMode.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None onMode: 'typing.Union[None, Nullable, uint]' = None @@ -17148,7 +16933,6 @@ class ModeTag(MatterIntEnum): class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass @@ -17159,12 +16943,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) mfgCode: 'typing.Optional[uint]' = None value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -17174,12 +16956,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[DishwasherModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[DishwasherMode.Structs.ModeTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[DishwasherModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + modeTags: 'typing.List[DishwasherMode.Structs.ModeTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -17187,7 +16969,7 @@ class ChangeToMode(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0059 command_id: typing.ClassVar[int] = 0x00000000 is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None + response_type: typing.ClassVar[str] = 'ChangeToModeResponse' @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -17199,56 +16981,24 @@ def descriptor(cls) -> ClusterObjectDescriptor: newMode: 'uint' = 0 @dataclass - class ChangeToModeWithStatus(ClusterCommand): + class ChangeToModeResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0059 command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = 'ChangeToModeResponse' + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0059 - command_id: typing.ClassVar[int] = 0x00000002 - is_client: typing.ClassVar[bool] = False - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="statusText", Tag=1, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="statusText", Tag=1, Type=typing.Optional[str]), ]) status: 'uint' = 0 statusText: 'typing.Optional[str]' = None class Attributes: - @dataclass - class Description(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0059 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=str) - - value: 'str' = "" - @dataclass class SupportedModes(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -17257,13 +17007,13 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000002 + return 0x00000000 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[DishwasherModeSelect.Structs.ModeOptionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[DishwasherMode.Structs.ModeOptionStruct]) - value: 'typing.List[DishwasherModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) + value: 'typing.List[DishwasherMode.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) @dataclass class CurrentMode(ClusterAttributeDescriptor): @@ -17273,7 +17023,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000003 + return 0x00000001 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -17289,7 +17039,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000004 + return 0x00000002 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -17305,7 +17055,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000005 + return 0x00000003 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -18235,13 +17985,13 @@ class ErrorStateStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="errorStateID", Tag=0, Type=OperationalState.Enums.ErrorStateEnum), - ClusterObjectFieldDescriptor(Label="errorStateLabel", Tag=1, Type=typing.Union[Nullable, str]), + ClusterObjectFieldDescriptor(Label="errorStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="errorStateLabel", Tag=1, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="errorStateDetails", Tag=2, Type=typing.Optional[str]), ]) - errorStateID: 'OperationalState.Enums.ErrorStateEnum' = 0 - errorStateLabel: 'typing.Union[Nullable, str]' = NullValue + errorStateID: 'uint' = 0 + errorStateLabel: 'typing.Optional[str]' = None errorStateDetails: 'typing.Optional[str]' = None @dataclass @@ -18250,12 +18000,12 @@ class OperationalStateStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="operationalStateID", Tag=0, Type=OperationalState.Enums.OperationalStateEnum), - ClusterObjectFieldDescriptor(Label="operationalStateLabel", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="operationalStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="operationalStateLabel", Tag=1, Type=typing.Optional[str]), ]) - operationalStateID: 'OperationalState.Enums.OperationalStateEnum' = 0 - operationalStateLabel: 'str' = "" + operationalStateID: 'uint' = 0 + operationalStateLabel: 'typing.Optional[str]' = None class Commands: @dataclass @@ -18553,12 +18303,408 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="completionErrorCode", Tag=0, Type=OperationalState.Enums.ErrorStateEnum), + ClusterObjectFieldDescriptor(Label="completionErrorCode", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="totalOperationalTime", Tag=1, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="pausedTime", Tag=2, Type=typing.Union[None, Nullable, uint]), + ]) + + completionErrorCode: 'uint' = 0 + totalOperationalTime: 'typing.Union[None, Nullable, uint]' = None + pausedTime: 'typing.Union[None, Nullable, uint]' = None + + +@dataclass +class RvcOperationalState(Cluster): + id: typing.ClassVar[int] = 0x0061 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="phaseList", Tag=0x00000000, Type=typing.Union[Nullable, typing.List[str]]), + ClusterObjectFieldDescriptor(Label="currentPhase", Tag=0x00000001, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="countdownTime", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="operationalStateList", Tag=0x00000003, Type=typing.List[RvcOperationalState.Structs.OperationalStateStruct]), + ClusterObjectFieldDescriptor(Label="operationalState", Tag=0x00000004, Type=RvcOperationalState.Structs.OperationalStateStruct), + ClusterObjectFieldDescriptor(Label="operationalError", Tag=0x00000005, Type=RvcOperationalState.Structs.ErrorStateStruct), + 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]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + phaseList: 'typing.Union[Nullable, typing.List[str]]' = None + currentPhase: 'typing.Union[Nullable, uint]' = None + countdownTime: 'typing.Union[None, Nullable, uint]' = None + operationalStateList: 'typing.List[RvcOperationalState.Structs.OperationalStateStruct]' = None + operationalState: 'RvcOperationalState.Structs.OperationalStateStruct' = None + operationalError: 'RvcOperationalState.Structs.ErrorStateStruct' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class ErrorStateEnum(MatterIntEnum): + kFailedToFindChargingDock = 0x40 + kStuck = 0x41 + kDustBinMissing = 0x42 + kDustBinFull = 0x43 + kWaterTankEmpty = 0x44 + kWaterTankMissing = 0x45 + kWaterTankLidOpen = 0x46 + kMopCleaningPadMissing = 0x47 + # 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 = 0, + + class OperationalStateEnum(MatterIntEnum): + kSeekingCharger = 0x40 + kCharging = 0x41 + kDocked = 0x42 + # 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 = 0, + + class Structs: + @dataclass + class ErrorStateStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="errorStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="errorStateLabel", Tag=1, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="errorStateDetails", Tag=2, Type=typing.Optional[str]), + ]) + + errorStateID: 'uint' = 0 + errorStateLabel: 'typing.Optional[str]' = None + errorStateDetails: 'typing.Optional[str]' = None + + @dataclass + class OperationalStateStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="operationalStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="operationalStateLabel", Tag=1, Type=typing.Optional[str]), + ]) + + operationalStateID: 'uint' = 0 + operationalStateLabel: 'typing.Optional[str]' = None + + class Commands: + @dataclass + class Pause(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class Stop(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class Start(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class Resume(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class OperationalCommandResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="commandResponseState", Tag=0, Type=RvcOperationalState.Structs.ErrorStateStruct), + ]) + + commandResponseState: 'RvcOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.ErrorStateStruct()) + + class Attributes: + @dataclass + class PhaseList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, typing.List[str]]) + + value: 'typing.Union[Nullable, typing.List[str]]' = NullValue + + @dataclass + class CurrentPhase(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) + + value: 'typing.Union[Nullable, uint]' = NullValue + + @dataclass + class CountdownTime(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class OperationalStateList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[RvcOperationalState.Structs.OperationalStateStruct]) + + value: 'typing.List[RvcOperationalState.Structs.OperationalStateStruct]' = field(default_factory=lambda: []) + + @dataclass + class OperationalState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=RvcOperationalState.Structs.OperationalStateStruct) + + value: 'RvcOperationalState.Structs.OperationalStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.OperationalStateStruct()) + + @dataclass + class OperationalError(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=RvcOperationalState.Structs.ErrorStateStruct) + + value: 'RvcOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.ErrorStateStruct()) + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + class Events: + @dataclass + class OperationalError(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="errorState", Tag=0, Type=RvcOperationalState.Structs.ErrorStateStruct), + ]) + + errorState: 'RvcOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.ErrorStateStruct()) + + @dataclass + class OperationCompletion(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="completionErrorCode", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="totalOperationalTime", Tag=1, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="pausedTime", Tag=2, Type=typing.Union[None, Nullable, uint]), ]) - completionErrorCode: 'OperationalState.Enums.ErrorStateEnum' = 0 + completionErrorCode: 'uint' = 0 totalOperationalTime: 'typing.Union[None, Nullable, uint]' = None pausedTime: 'typing.Union[None, Nullable, uint]' = None diff --git a/src/controller/python/chip/yaml/runner.py b/src/controller/python/chip/yaml/runner.py index bd5dbf99ded8a7..2e21f5eefd7d02 100644 --- a/src/controller/python/chip/yaml/runner.py +++ b/src/controller/python/chip/yaml/runner.py @@ -837,7 +837,7 @@ def _default_pseudo_cluster(self, test_step): def encode(self, request) -> BaseAction: action = None - cluster = request.cluster.replace(' ', '').replace('/', '') + cluster = request.cluster.replace(' ', '').replace('/', '').replace('.', '') command = request.command if cluster == 'CommissionerCommands': return self._commissioner_command_action_factory(request) diff --git a/src/credentials/attestation_verifier/DeviceAttestationVerifier.cpp b/src/credentials/attestation_verifier/DeviceAttestationVerifier.cpp index ccaaa0eed88553..cc5d9d3030de80 100644 --- a/src/credentials/attestation_verifier/DeviceAttestationVerifier.cpp +++ b/src/credentials/attestation_verifier/DeviceAttestationVerifier.cpp @@ -124,7 +124,9 @@ static inline Platform::ScopedMemoryBufferWithSize CopyByteSpanHelper(c } DeviceAttestationVerifier::AttestationDeviceInfo::AttestationDeviceInfo(const AttestationInfo & attestationInfo) : - mPaiDerBuffer(CopyByteSpanHelper(attestationInfo.paiDerBuffer)), mDacDerBuffer(CopyByteSpanHelper(attestationInfo.dacDerBuffer)) + mPaiDerBuffer(CopyByteSpanHelper(attestationInfo.paiDerBuffer)), + mDacDerBuffer(CopyByteSpanHelper(attestationInfo.dacDerBuffer)), mBasicInformationVendorId(attestationInfo.vendorId), + mBasicInformationProductId(attestationInfo.productId) { ByteSpan certificationDeclarationSpan; ByteSpan attestationNonceSpan; diff --git a/src/credentials/attestation_verifier/DeviceAttestationVerifier.h b/src/credentials/attestation_verifier/DeviceAttestationVerifier.h index b79dd392aeb3bc..0f32a91b206cdd 100644 --- a/src/credentials/attestation_verifier/DeviceAttestationVerifier.h +++ b/src/credentials/attestation_verifier/DeviceAttestationVerifier.h @@ -295,7 +295,6 @@ class DeviceAttestationVerifier { public: AttestationDeviceInfo(const AttestationInfo & attestationInfo); - AttestationDeviceInfo(const ByteSpan & attestationElementsBuffer, const ByteSpan paiDerBuffer, const ByteSpan dacDerBuffer); ~AttestationDeviceInfo() = default; @@ -318,10 +317,16 @@ class DeviceAttestationVerifier } } + uint16_t BasicInformationVendorId() const { return mBasicInformationVendorId; } + + uint16_t BasicInformationProductId() const { return mBasicInformationProductId; } + private: Platform::ScopedMemoryBufferWithSize mPaiDerBuffer; Platform::ScopedMemoryBufferWithSize mDacDerBuffer; Platform::ScopedMemoryBufferWithSize mCdBuffer; + uint16_t mBasicInformationVendorId; + uint16_t mBasicInformationProductId; }; typedef void (*OnAttestationInformationVerification)(void * context, const AttestationInfo & info, diff --git a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h index 001c7058cdb34c..727fa01e64720d 100644 --- a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h +++ b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h @@ -35,9 +35,4 @@ NS_ASSUME_NONNULL_BEGIN @end -API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) -MTR_NEWLY_DEPRECATED("Please use MTRModeSelectClusterModeTagStruct") -@interface MTRModeSelectClusterSemanticTagStruct : MTRModeSelectClusterModeTagStruct -@end - NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm index 77949e0c765759..d74b24b8194939 100644 --- a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm +++ b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm @@ -22,6 +22,3 @@ * This file defines implementations of manual backwards-compat shims of various sorts to handle * API changes that happened. */ - -@implementation MTRModeSelectClusterSemanticTagStruct -@end diff --git a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h index a76f0c20145a17..889ba88096e69e 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h +++ b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h @@ -28,15 +28,29 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)new NS_UNAVAILABLE; /** - * The vendor ID for the device from the Device Attestation Certificate. May be nil only if attestation was unsucessful. + * The vendor ID from the Device Attestation Certificate. May be nil only if attestation was unsuccessful. */ @property (nonatomic, readonly, nullable) NSNumber * vendorID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); /** - * The product ID for the device from the Device Attestation Certificate. May be nil only if attestation was unsucessful. + * The product ID from the Device Attestation Certificate. May be nil only if attestation was unsuccessful. */ @property (nonatomic, readonly, nullable) NSNumber * productID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +/** + * The vendor ID value from the device's Basic Information cluster that was used + * for device attestation. If attestation succeeds, this must match the vendor + * ID from the certification declaration. + */ +@property (nonatomic, readonly) NSNumber * basicInformationVendorID MTR_NEWLY_AVAILABLE; + +/** + * The product ID value from the device's Basic Information cluster that was + * used for device attestation. If attestation succeeds, this must match one of + * the product IDs from the certification declaration. + */ +@property (nonatomic, readonly) NSNumber * basicInformationProductID MTR_NEWLY_AVAILABLE; + @property (nonatomic, readonly) MTRCertificateDERBytes dacCertificate; @property (nonatomic, readonly) MTRCertificateDERBytes dacPAICertificate; @property (nonatomic, readonly, nullable) NSData * certificateDeclaration; diff --git a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.mm b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.mm index a31292f7f75102..273f03ef31f623 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.mm @@ -28,11 +28,15 @@ @implementation MTRDeviceAttestationDeviceInfo - (instancetype)initWithDACCertificate:(MTRCertificateDERBytes)dacCertificate dacPAICertificate:(MTRCertificateDERBytes)dacPAICertificate certificateDeclaration:(NSData *)certificateDeclaration + basicInformationVendorID:(NSNumber *)basicInformationVendorID + basicInformationProductID:(NSNumber *)basicInformationProductID { if (self = [super init]) { _dacCertificate = [dacCertificate copy]; _dacPAICertificate = [dacPAICertificate copy]; _certificateDeclaration = [certificateDeclaration copy]; + _basicInformationVendorID = [basicInformationVendorID copy]; + _basicInformationProductID = [basicInformationProductID copy]; struct AttestationCertVidPid dacVidPid; if (ExtractVIDPIDFromX509Cert(AsByteSpan(_dacCertificate), dacVidPid) == CHIP_NO_ERROR) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegateBridge.mm b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegateBridge.mm index 65528045710008..b9179185f959f1 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegateBridge.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegateBridge.mm @@ -43,7 +43,9 @@ MTRDeviceAttestationDeviceInfo * deviceInfo = [[MTRDeviceAttestationDeviceInfo alloc] initWithDACCertificate:dacData dacPAICertificate:paiData - certificateDeclaration:cdData]; + certificateDeclaration:cdData + basicInformationVendorID:@(info.BasicInformationVendorId()) + basicInformationProductID:@(info.BasicInformationProductId())]; NSError * error = (attestationResult == chip::Credentials::AttestationVerificationResult::kSuccess) ? nil : [MTRError errorForCHIPErrorCode:CHIP_ERROR_INTEGRITY_CHECK_FAILED]; diff --git a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate_Internal.h index 9b978a903be76c..a19db3f6e6c591 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate_Internal.h @@ -23,7 +23,9 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithDACCertificate:(MTRCertificateDERBytes)dacCertificate dacPAICertificate:(MTRCertificateDERBytes)dacPAICertificate - certificateDeclaration:(NSData *)certificateDeclaration; + certificateDeclaration:(NSData *)certificateDeclaration + basicInformationVendorID:(NSNumber *)basicInformationVendorID + basicInformationProductID:(NSNumber *)basicInformationProductID; @end diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 331b3c09ebcd15..6a797e9185dddf 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -5316,6 +5316,8 @@ - ThreadMetricsStruct GeneralDiagnostics: - NetworkInterface + ModeSelect: + - SemanticTagStruct OperationalCredentials: - FabricDescriptorStruct DoorLock: @@ -5432,6 +5434,10 @@ - iPv4Addresses - iPv6Addresses - type + ModeSelect: + SemanticTagStruct: + - mfgCode + - value OperationalCredentials: FabricDescriptorStruct: - rootPublicKey @@ -6528,6 +6534,8 @@ ThreadMetricsStruct: ThreadMetrics GeneralDiagnostics: NetworkInterface: NetworkInterfaceType + ModeSelect: + SemanticTagStruct: SemanticTag OperationalCredentials: FabricDescriptorStruct: FabricDescriptor DoorLock: @@ -7515,8 +7523,6 @@ - ProductAppearanceStruct BridgedDeviceBasicInformation: - ProductAppearanceStruct - ModeSelect: - - ModeTagStruct NetworkCommissioning: - WiFiInterfaceScanResultStruct - ThreadInterfaceScanResultStruct @@ -7541,12 +7547,6 @@ ProductAppearanceStruct: - finish - primaryColor - ModeSelect: - ModeTagStruct: - - mfgCode - - value - ModeOptionStruct: - - modeTags NetworkCommissioning: WiFiInterfaceScanResultStruct: - security @@ -8278,10 +8278,6 @@ ThreadNetworkDiagnostics: - NeighborTable - RouteTable - struct fields: - ModeSelect: - ModeOptionStruct: - - semanticTags bitmaps: Groups: - GroupClusterFeature @@ -8307,8 +8303,6 @@ structs: AccessControl: AccessControlTargetStruct: Target - ModeSelect: - ModeTagStruct: SemanticTag NetworkCommissioning: WiFiInterfaceScanResultStruct: WiFiInterfaceScanResult ThreadInterfaceScanResultStruct: ThreadInterfaceScanResult @@ -8316,10 +8310,6 @@ ThreadNetworkDiagnostics: NeighborTableStruct: NeighborTable RouteTableStruct: RouteTable - struct fields: - ModeSelect: - ModeOptionStruct: - modeTags: semanticTags enum values: TimeSynchronization: TimeSourceEnum: @@ -8394,30 +8384,12 @@ - TonerCartridgeMonitoring # Not ready to be public API yet. - ICDManagement - - LaundryWasherModeSelect - - RefrigeratorAndTemperatureControlledCabinetModeSelect - - RVCRunModeSelect - - RVCCleanModeSelect - - DishwasherModeSelect + - LaundryWasherMode + - RefrigeratorAndTemperatureControlledCabinetMode + - RVCRunMode + - RVCCleanMode + - DishwasherMode - WasherControls - commands: - ModeSelect: - # Still very in-flux. - - ChangeToModeWithStatus - - ChangeToModeResponse - struct fields: - ModeSelect: - ModeTagStruct: - - tagName - enums: - ModeSelect: - # Still very in-flux. - - ModeTag - - StatusCode - bitmap values: - ModeSelect: - Feature: - - ExtendedStatus # Once we actually unmark TimeSynchronization as provisional, all these bits should go away too, and we should instead # mark things as introduced/deprecated as needed. The "ids" entries should go away, in particular. ids: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 0920c65ca69499..1b4bb1c6785da1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -2018,6 +2018,51 @@ static BOOL AttributeIsSpecifiedInOperationalStateCluster(AttributeId aAttribute } } } +static BOOL AttributeIsSpecifiedInRVCOperationalStateCluster(AttributeId aAttributeId) +{ + using namespace Clusters::RvcOperationalState; + switch (aAttributeId) { + case Attributes::PhaseList::Id: { + return YES; + } + case Attributes::CurrentPhase::Id: { + return YES; + } + case Attributes::CountdownTime::Id: { + return YES; + } + case Attributes::OperationalStateList::Id: { + return YES; + } + case Attributes::OperationalState::Id: { + return YES; + } + case Attributes::OperationalError::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInHEPAFilterMonitoringCluster(AttributeId aAttributeId) { using namespace Clusters::HepaFilterMonitoring; @@ -5100,6 +5145,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::OperationalState::Id: { return AttributeIsSpecifiedInOperationalStateCluster(aAttributeId); } + case Clusters::RvcOperationalState::Id: { + return AttributeIsSpecifiedInRVCOperationalStateCluster(aAttributeId); + } case Clusters::HepaFilterMonitoring::Id: { return AttributeIsSpecifiedInHEPAFilterMonitoringCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 4d7cbd75eab3d6..fe3c110ea46a02 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -9048,16 +9048,12 @@ static id _Nullable DecodeAttributeValueForModeSelectCluster( newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); + auto iter_2 = entry_0.semanticTags.begin(); while (iter_2.Next()) { auto & entry_2 = iter_2.GetValue(); - MTRModeSelectClusterModeTagStruct * newElement_2; - newElement_2 = [MTRModeSelectClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } + MTRModeSelectClusterSemanticTagStruct * newElement_2; + newElement_2 = [MTRModeSelectClusterSemanticTagStruct new]; + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode)]; newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; [array_2 addObject:newElement_2]; } @@ -9066,7 +9062,7 @@ static id _Nullable DecodeAttributeValueForModeSelectCluster( *aError = err; return nil; } - newElement_0.modeTags = array_2; + newElement_0.semanticTags = array_2; } [array_0 addObject:newElement_0]; } @@ -10146,12 +10142,16 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( auto & entry_0 = iter_0.GetValue(); MTROperationalStateClusterOperationalStateStruct * newElement_0; newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; - newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.operationalStateID)]; - newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel); - if (newElement_0.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.operationalStateLabel = nil; } [array_0 addObject:newElement_0]; } @@ -10173,12 +10173,16 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( } MTROperationalStateClusterOperationalStateStruct * _Nonnull value; value = [MTROperationalStateClusterOperationalStateStruct new]; - value.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.operationalStateID)]; - value.operationalStateLabel = AsString(cppValue.operationalStateLabel); - if (value.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; + value.operationalStateID = [NSNumber numberWithUnsignedChar:cppValue.operationalStateID]; + if (cppValue.operationalStateLabel.HasValue()) { + value.operationalStateLabel = AsString(cppValue.operationalStateLabel.Value()); + if (value.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.operationalStateLabel = nil; } return value; } @@ -10191,16 +10195,311 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( } MTROperationalStateClusterErrorStateStruct * _Nonnull value; value = [MTROperationalStateClusterErrorStateStruct new]; - value.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.errorStateID)]; - if (cppValue.errorStateLabel.IsNull()) { + value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; + if (cppValue.errorStateLabel.HasValue()) { + value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); + if (value.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { value.errorStateLabel = nil; + } + if (cppValue.errorStateDetails.HasValue()) { + value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); + if (value.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } } else { + value.errorStateDetails = nil; + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::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; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RvcOperationalState; + switch (aAttributeId) { + case Attributes::PhaseList::Id: { + using TypeInfo = Attributes::PhaseList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSString * newElement_1; + newElement_1 = AsString(entry_1); + if (newElement_1 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_1; + } + } + return value; + } + case Attributes::CurrentPhase::Id: { + using TypeInfo = Attributes::CurrentPhase::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } + case Attributes::CountdownTime::Id: { + using TypeInfo = Attributes::CountdownTime::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 numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::OperationalStateList::Id: { + using TypeInfo = Attributes::OperationalStateList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRVCOperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTRRVCOperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.operationalStateLabel = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::OperationalState::Id: { + using TypeInfo = Attributes::OperationalState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRRVCOperationalStateClusterOperationalStateStruct * _Nonnull value; + value = [MTRRVCOperationalStateClusterOperationalStateStruct new]; + value.operationalStateID = [NSNumber numberWithUnsignedChar:cppValue.operationalStateID]; + if (cppValue.operationalStateLabel.HasValue()) { + value.operationalStateLabel = AsString(cppValue.operationalStateLabel.Value()); + if (value.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.operationalStateLabel = nil; + } + return value; + } + case Attributes::OperationalError::Id: { + using TypeInfo = Attributes::OperationalError::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull value; + value = [MTRRVCOperationalStateClusterErrorStateStruct new]; + value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; + if (cppValue.errorStateLabel.HasValue()) { value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); if (value.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; *aError = err; return nil; } + } else { + value.errorStateLabel = nil; } if (cppValue.errorStateDetails.HasValue()) { value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); @@ -24288,6 +24587,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::OperationalState::Id: { return DecodeAttributeValueForOperationalStateCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::RvcOperationalState::Id: { + return DecodeAttributeValueForRVCOperationalStateCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::HepaFilterMonitoring::Id: { return DecodeAttributeValueForHEPAFilterMonitoringCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 599499f005e8a3..6e21a62b8e0a73 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7722,11 +7722,8 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) /** * Command ChangeToMode * - * If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an - INVALID_COMMAND status response. If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device - is unable to transition as requested, the server SHALL respond with a FAILURE status response. If the NewMode field matches the - Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the - CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. + * On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL + * set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. */ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params completion:(MTRStatusCompletion)completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -8736,6 +8733,213 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster RVC Operational State + * + * This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. + */ +MTR_NEWLY_AVAILABLE +@interface MTRBaseClusterRVCOperationalState : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +/** + * Command Pause + * + * Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. + */ +- (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)pauseWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +/** + * Command Stop + * + * Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. + */ +- (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +/** + * Command Start + * + * Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it + * can be started. + */ +- (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +/** + * Command Resume + * + * Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the + * point when it was paused by means outside of this cluster (for example by manual button press). + */ +- (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributePhaseListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeCurrentPhaseWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeCurrentPhaseWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeCurrentPhaseWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeCountdownTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeCountdownTimeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeCountdownTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeOperationalStateListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeOperationalStateListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeOperationalStateListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeOperationalStateWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeOperationalStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeOperationalErrorWithCompletion:(void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeOperationalErrorWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeOperationalErrorWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster HEPA Filter Monitoring * @@ -24439,6 +24643,23 @@ typedef NS_ENUM(uint8_t, MTROperationalState) { MTROperationalStateError MTR_NEWLY_AVAILABLE = 0x03, } MTR_NEWLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRRVCOperationalStateErrorState) { + MTRRVCOperationalStateErrorStateFailedToFindChargingDock MTR_NEWLY_AVAILABLE = 0x40, + MTRRVCOperationalStateErrorStateStuck MTR_NEWLY_AVAILABLE = 0x41, + MTRRVCOperationalStateErrorStateDustBinMissing MTR_NEWLY_AVAILABLE = 0x42, + MTRRVCOperationalStateErrorStateDustBinFull MTR_NEWLY_AVAILABLE = 0x43, + MTRRVCOperationalStateErrorStateWaterTankEmpty MTR_NEWLY_AVAILABLE = 0x44, + MTRRVCOperationalStateErrorStateWaterTankMissing MTR_NEWLY_AVAILABLE = 0x45, + MTRRVCOperationalStateErrorStateWaterTankLidOpen MTR_NEWLY_AVAILABLE = 0x46, + MTRRVCOperationalStateErrorStateMopCleaningPadMissing MTR_NEWLY_AVAILABLE = 0x47, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRRVCOperationalStateOperationalState) { + MTRRVCOperationalStateOperationalStateSeekingCharger MTR_NEWLY_AVAILABLE = 0x40, + MTRRVCOperationalStateOperationalStateCharging MTR_NEWLY_AVAILABLE = 0x41, + MTRRVCOperationalStateOperationalStateDocked MTR_NEWLY_AVAILABLE = 0x42, +} MTR_NEWLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRHEPAFilterMonitoringChangeIndication) { MTRHEPAFilterMonitoringChangeIndicationOK MTR_NEWLY_AVAILABLE = 0x00, MTRHEPAFilterMonitoringChangeIndicationWarning MTR_NEWLY_AVAILABLE = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index cdf9f56791411a..eb201d04621037 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -50705,6 +50705,715 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterRVCOperationalState + +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _device = device; + _endpoint = [endpointID unsignedShortValue]; + } + return self; +} + +- (void)pauseWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self pauseWithParams:nil completion:completion]; +} +- (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RvcOperationalState::Commands::Pause::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)stopWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self stopWithParams:nil completion:completion]; +} +- (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RvcOperationalState::Commands::Stop::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)startWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self startWithParams:nil completion:completion]; +} +- (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RvcOperationalState::Commands::Start::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)resumeWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self resumeWithParams:nil completion:completion]; +} +- (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RvcOperationalState::Commands::Resume::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::PhaseList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributePhaseListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::PhaseList::TypeInfo; + MTRSubscribeAttribute( + params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRVCOperationalStatePhaseListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RVCOperationalStatePhaseListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::PhaseList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeCurrentPhaseWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::CurrentPhase::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeCurrentPhaseWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::CurrentPhase::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeCurrentPhaseWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::CurrentPhase::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeCountdownTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::CountdownTime::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeCountdownTimeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::CountdownTime::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeCountdownTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::CountdownTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeOperationalStateListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::OperationalStateList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeOperationalStateListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::OperationalStateList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeOperationalStateListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RVCOperationalStateOperationalStateListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::OperationalStateList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeOperationalStateWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::OperationalState::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeOperationalStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::OperationalState::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, + reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + auto * bridge = new MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RVCOperationalStateOperationalStateStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::OperationalState::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeOperationalErrorWithCompletion:(void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::OperationalError::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeOperationalErrorWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::OperationalError::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, + self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeOperationalErrorWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + auto * bridge = new MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RVCOperationalStateOperationalErrorStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::OperationalError::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::GeneratedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::GeneratedCommandList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RVCOperationalStateGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::GeneratedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::AcceptedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::AcceptedCommandList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RVCOperationalStateAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::EventList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::EventList::TypeInfo; + MTRSubscribeAttribute( + params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRVCOperationalStateEventListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RVCOperationalStateEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::EventList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::AttributeList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::AttributeList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRVCOperationalStateAttributeListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RVCOperationalStateAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::FeatureMap::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::FeatureMap::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RvcOperationalState::Attributes::ClusterRevision::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RvcOperationalState::Attributes::ClusterRevision::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RvcOperationalState::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +@end + @implementation MTRBaseClusterHEPAFilterMonitoring - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index 1063a353250da9..d7135458fc7ec6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -225,6 +225,11 @@ @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end +@interface MTRBaseClusterRVCOperationalState () +@property (nonatomic, strong, readonly) MTRBaseDevice * device; +@property (nonatomic, assign, readonly) chip::EndpointId endpoint; +@end + @interface MTRBaseClusterHEPAFilterMonitoring () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index e239e1f9d503eb..74d4cfe31063c5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -87,6 +87,8 @@ typedef void (*GroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); typedef void (*OperationalStateClusterOperationalCommandResponseCallbackType)( void *, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType &); +typedef void (*RVCOperationalStateClusterOperationalCommandResponseCallbackType)( + void *, const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType &); typedef void (*DoorLockClusterGetWeekDayScheduleResponseCallbackType)( void *, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType &); typedef void (*DoorLockClusterGetYearDayScheduleResponseCallbackType)( @@ -414,6 +416,14 @@ typedef void (*OperationalStateClusterOperationalStateEnumAttributeCallback)( void *, chip::app::Clusters::OperationalState::OperationalStateEnum); typedef void (*NullableOperationalStateClusterOperationalStateEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*RVCOperationalStateClusterErrorStateEnumAttributeCallback)(void *, + chip::app::Clusters::RvcOperationalState::ErrorStateEnum); +typedef void (*NullableRVCOperationalStateClusterErrorStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*RVCOperationalStateClusterOperationalStateEnumAttributeCallback)( + void *, chip::app::Clusters::RvcOperationalState::OperationalStateEnum); +typedef void (*NullableRVCOperationalStateClusterOperationalStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*HEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( void *, chip::app::Clusters::HepaFilterMonitoring::ChangeIndicationEnum); typedef void (*NullableHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( @@ -1221,6 +1231,24 @@ typedef void (*OperationalStateEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RVCOperationalStatePhaseListListAttributeCallback)( + void * context, const chip::app::DataModel::Nullable> & data); +typedef void (*RVCOperationalStateOperationalStateListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & data); +typedef void (*RVCOperationalStateOperationalStateStructAttributeCallback)( + void *, const chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType &); +typedef void (*RVCOperationalStateOperationalErrorStructAttributeCallback)( + void *, const chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType &); +typedef void (*RVCOperationalStateGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RVCOperationalStateAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RVCOperationalStateEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RVCOperationalStateAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringAcceptedCommandListListAttributeCallback)( @@ -9591,6 +9619,275 @@ class MTROperationalStateAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRRVCOperationalStatePhaseListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRVCOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRVCOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable> & value); +}; + +class MTRRVCOperationalStatePhaseListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStatePhaseListListAttributeCallbackBridge +{ +public: + MTRRVCOperationalStatePhaseListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStatePhaseListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRVCOperationalStatePhaseListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStatePhaseListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & value); +}; + +class MTRRVCOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge +{ +public: + MTRRVCOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType & value); +}; + +class MTRRVCOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge +{ +public: + MTRRVCOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType & value); +}; + +class MTRRVCOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge +{ +public: + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge +{ +public: + MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge +{ +public: + MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRVCOperationalStateEventListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRVCOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRVCOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRVCOperationalStateEventListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateEventListListAttributeCallbackBridge +{ +public: + MTRRVCOperationalStateEventListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStateEventListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRVCOperationalStateEventListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateEventListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRVCOperationalStateAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRVCOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRVCOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRVCOperationalStateAttributeListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateAttributeListListAttributeCallbackBridge +{ +public: + MTRRVCOperationalStateAttributeListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStateAttributeListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRVCOperationalStateAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateAttributeListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRHEPAFilterMonitoringGeneratedCommandListListAttributeCallbackBridge : public MTRCallbackBridge { @@ -16764,6 +17061,22 @@ class MTROperationalStateClusterOperationalCommandResponseCallbackBridge const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data); }; +class MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void + OnSuccessFn(void * context, + const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & data); +}; + class MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge : public MTRCallbackBridge { @@ -22345,6 +22658,144 @@ class MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackSub MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::RvcOperationalState::ErrorStateEnum value); +}; + +class MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge +{ +public: + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); +}; + +class MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge +{ +public: + MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::RvcOperationalState::OperationalStateEnum value); +}; + +class MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge +{ +public: + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); +}; + +class MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge +{ +public: + MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 41a77955b9d517..6314800b01a871 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -8010,16 +8010,12 @@ newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); + auto iter_2 = entry_0.semanticTags.begin(); while (iter_2.Next()) { auto & entry_2 = iter_2.GetValue(); - MTRModeSelectClusterModeTagStruct * newElement_2; - newElement_2 = [MTRModeSelectClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } + MTRModeSelectClusterSemanticTagStruct * newElement_2; + newElement_2 = [MTRModeSelectClusterSemanticTagStruct new]; + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode)]; newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; [array_2 addObject:newElement_2]; } @@ -8028,7 +8024,7 @@ OnFailureFn(context, err); return; } - newElement_0.modeTags = array_2; + newElement_0.semanticTags = array_2; } [array_0 addObject:newElement_0]; } @@ -8965,12 +8961,16 @@ auto & entry_0 = iter_0.GetValue(); MTROperationalStateClusterOperationalStateStruct * newElement_0; newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; - newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.operationalStateID)]; - newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel); - if (newElement_0.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - OnFailureFn(context, err); - return; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + newElement_0.operationalStateLabel = nil; } [array_0 addObject:newElement_0]; } @@ -9004,12 +9004,16 @@ { MTROperationalStateClusterOperationalStateStruct * _Nonnull objCValue; objCValue = [MTROperationalStateClusterOperationalStateStruct new]; - objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.operationalStateID)]; - objCValue.operationalStateLabel = AsString(value.operationalStateLabel); - if (objCValue.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - OnFailureFn(context, err); - return; + objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:value.operationalStateID]; + if (value.operationalStateLabel.HasValue()) { + objCValue.operationalStateLabel = AsString(value.operationalStateLabel.Value()); + if (objCValue.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.operationalStateLabel = nil; } DispatchSuccess(context, objCValue); }; @@ -9034,16 +9038,16 @@ { MTROperationalStateClusterErrorStateStruct * _Nonnull objCValue; objCValue = [MTROperationalStateClusterErrorStateStruct new]; - objCValue.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.errorStateID)]; - if (value.errorStateLabel.IsNull()) { - objCValue.errorStateLabel = nil; - } else { + objCValue.errorStateID = [NSNumber numberWithUnsignedChar:value.errorStateID]; + if (value.errorStateLabel.HasValue()) { objCValue.errorStateLabel = AsString(value.errorStateLabel.Value()); if (objCValue.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; OnFailureFn(context, err); return; } + } else { + objCValue.errorStateLabel = nil; } if (value.errorStateDetails.HasValue()) { objCValue.errorStateDetails = AsString(value.errorStateDetails.Value()); @@ -9225,6 +9229,333 @@ } } +void MTRRVCOperationalStatePhaseListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable> & value) +{ + NSArray * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = value.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSString * newElement_1; + newElement_1 = AsString(entry_1); + if (newElement_1 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_1; + } + } + DispatchSuccess(context, objCValue); +}; + +void MTRRVCOperationalStatePhaseListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRVCOperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTRRVCOperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + newElement_0.operationalStateLabel = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRVCOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType & value) +{ + MTRRVCOperationalStateClusterOperationalStateStruct * _Nonnull objCValue; + objCValue = [MTRRVCOperationalStateClusterOperationalStateStruct new]; + objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:value.operationalStateID]; + if (value.operationalStateLabel.HasValue()) { + objCValue.operationalStateLabel = AsString(value.operationalStateLabel.Value()); + if (objCValue.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.operationalStateLabel = nil; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRVCOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType & value) +{ + MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull objCValue; + objCValue = [MTRRVCOperationalStateClusterErrorStateStruct new]; + objCValue.errorStateID = [NSNumber numberWithUnsignedChar:value.errorStateID]; + if (value.errorStateLabel.HasValue()) { + objCValue.errorStateLabel = AsString(value.errorStateLabel.Value()); + if (objCValue.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.errorStateLabel = nil; + } + if (value.errorStateDetails.HasValue()) { + objCValue.errorStateDetails = AsString(value.errorStateDetails.Value()); + if (objCValue.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.errorStateDetails = nil; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRVCOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRVCOperationalStateEventListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRVCOperationalStateEventListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRVCOperationalStateAttributeListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRVCOperationalStateAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + void MTRHEPAFilterMonitoringGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -17409,6 +17740,18 @@ DispatchSuccess(context, response); }; +void MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & data) +{ + auto * response = [MTRRVCOperationalStateClusterOperationalCommandResponseParams new]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + DispatchSuccess(context, response); +}; + void MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & data) { @@ -21480,6 +21823,106 @@ } } +void MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::RvcOperationalState::ErrorStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::RvcOperationalState::OperationalStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + void MTRHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallbackBridge::OnSuccessFn( void * context, chip::app::Clusters::HepaFilterMonitoring::ChangeIndicationEnum value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 0e06ba47e07b3f..92f35f673db378 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -281,6 +281,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAirQualityID MTR_NEWLY_AVAILABLE = 0x0000005B, MTRClusterIDTypeSmokeCOAlarmID MTR_NEWLY_AVAILABLE = 0x0000005C, MTRClusterIDTypeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000060, + MTRClusterIDTypeRVCOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000061, MTRClusterIDTypeHEPAFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000071, MTRClusterIDTypeActivatedCarbonFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000072, MTRClusterIDTypeDoorLockID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000101, @@ -3825,6 +3826,26 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster RVCOperationalState attributes + MTRAttributeIDTypeClusterRVCOperationalStateAttributePhaseListID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeCurrentPhaseID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeCountdownTimeID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalStateListID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeEventListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeAttributeListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeFeatureMapID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster HEPAFilterMonitoring attributes MTRAttributeIDTypeClusterHEPAFilterMonitoringAttributeConditionID MTR_NEWLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterHEPAFilterMonitoringAttributeDegradationDirectionID MTR_NEWLY_AVAILABLE = 0x00000001, @@ -9276,6 +9297,13 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, MTRCommandIDTypeClusterOperationalStateCommandOperationalCommandResponseID MTR_NEWLY_AVAILABLE = 0x00000004, + // Cluster RVCOperationalState commands + MTRCommandIDTypeClusterRVCOperationalStateCommandPauseID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterRVCOperationalStateCommandStopID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterRVCOperationalStateCommandStartID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterRVCOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterRVCOperationalStateCommandOperationalCommandResponseID MTR_NEWLY_AVAILABLE = 0x00000004, + // Cluster HEPAFilterMonitoring commands MTRCommandIDTypeClusterHEPAFilterMonitoringCommandResetConditionID MTR_NEWLY_AVAILABLE = 0x00000000, @@ -10425,6 +10453,10 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, MTREventIDTypeClusterOperationalStateEventOperationCompletionID MTR_NEWLY_AVAILABLE = 0x00000001, + // Cluster RVCOperationalState events + MTREventIDTypeClusterRVCOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterRVCOperationalStateEventOperationCompletionID MTR_NEWLY_AVAILABLE = 0x00000001, + // Cluster DoorLock deprecated event names MTRClusterDoorLockEventDoorLockAlarmID MTR_DEPRECATED("Please use MTREventIDTypeClusterDoorLockEventDoorLockAlarmID", 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/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index dcc4a1916f0fe1..7f62aa4280d55d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3056,6 +3056,83 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster RVC Operational State + * This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. + */ +MTR_NEWLY_AVAILABLE +@interface MTRClusterRVCOperationalState : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +- (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)pauseWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributePhaseListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeCurrentPhaseWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeCountdownTimeWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeOperationalStateListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeOperationalStateWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeOperationalErrorWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster HEPA Filter Monitoring * Attributes and commands for monitoring HEPA filters in a device diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 2f1684e89b3480..99f1566cb1bc91 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -13913,6 +13913,423 @@ - (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)par @end +@implementation MTRClusterRVCOperationalState + +- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = [endpointID unsignedShortValue]; + _device = device; + } + return self; +} + +- (void)pauseWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self pauseWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandPauseID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RvcOperationalState::Commands::Pause::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)stopWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self stopWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandStopID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RvcOperationalState::Commands::Stop::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)startWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self startWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandStartID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RvcOperationalState::Commands::Start::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)resumeWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self resumeWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandResumeID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RvcOperationalState::Commands::Resume::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (NSDictionary *)readAttributePhaseListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributePhaseListID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentPhaseWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeCurrentPhaseID) + params:params]; +} + +- (NSDictionary *)readAttributeCountdownTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeCountdownTimeID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalStateListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalStateListID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalStateID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalErrorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalErrorID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeEventListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeClusterRevisionID) + params:params]; +} + +@end + @implementation MTRClusterHEPAFilterMonitoring - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h index 8c738156db2ce6..849782b23cad83 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -226,6 +226,11 @@ @property (nonatomic, readonly) MTRDevice * device; @end +@interface MTRClusterRVCOperationalState () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + @interface MTRClusterHEPAFilterMonitoring () @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice * device; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index c8e9c13f87d418..8838c0c06e0703 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4266,6 +4266,137 @@ MTR_NEWLY_AVAILABLE error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end +MTR_NEWLY_AVAILABLE +@interface MTRRVCOperationalStateClusterPauseParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * 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_NEWLY_AVAILABLE +@interface MTRRVCOperationalStateClusterStopParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * 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_NEWLY_AVAILABLE +@interface MTRRVCOperationalStateClusterStartParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * 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_NEWLY_AVAILABLE +@interface MTRRVCOperationalStateClusterResumeParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * 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_NEWLY_AVAILABLE +@interface MTRRVCOperationalStateClusterOperationalCommandResponseParams : NSObject + +@property (nonatomic, copy) MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull commandResponseState MTR_NEWLY_AVAILABLE; + +/** + * Initialize an MTRRVCOperationalStateClusterOperationalCommandResponseParams 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_NEWLY_AVAILABLE; +@end + MTR_NEWLY_AVAILABLE @interface MTRHEPAFilterMonitoringClusterResetConditionParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 2b97a1e5560931..7e03309d57cca3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -6691,15 +6691,222 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct: { self.commandResponseState = [MTROperationalStateClusterErrorStateStruct new]; self.commandResponseState.errorStateID = - [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.commandResponseState.errorStateID)]; - if (decodableStruct.commandResponseState.errorStateLabel.IsNull()) { + [NSNumber numberWithUnsignedChar:decodableStruct.commandResponseState.errorStateID]; + if (decodableStruct.commandResponseState.errorStateLabel.HasValue()) { + self.commandResponseState.errorStateLabel = AsString(decodableStruct.commandResponseState.errorStateLabel.Value()); + if (self.commandResponseState.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { self.commandResponseState.errorStateLabel = nil; + } + if (decodableStruct.commandResponseState.errorStateDetails.HasValue()) { + self.commandResponseState.errorStateDetails = AsString(decodableStruct.commandResponseState.errorStateDetails.Value()); + if (self.commandResponseState.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } } else { + self.commandResponseState.errorStateDetails = nil; + } + } + return CHIP_NO_ERROR; +} +@end +@implementation MTRRVCOperationalStateClusterPauseParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRVCOperationalStateClusterPauseParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRVCOperationalStateClusterStopParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRVCOperationalStateClusterStopParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRVCOperationalStateClusterStartParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRVCOperationalStateClusterStartParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRVCOperationalStateClusterResumeParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRVCOperationalStateClusterResumeParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRVCOperationalStateClusterOperationalCommandResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _commandResponseState = [MTRRVCOperationalStateClusterErrorStateStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRVCOperationalStateClusterOperationalCommandResponseParams alloc] init]; + + other.commandResponseState = self.commandResponseState; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: commandResponseState:%@; >", NSStringFromClass([self class]), _commandResponseState]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::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 MTRRVCOperationalStateClusterOperationalCommandResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType &)decodableStruct +{ + { + self.commandResponseState = [MTRRVCOperationalStateClusterErrorStateStruct new]; + self.commandResponseState.errorStateID = + [NSNumber numberWithUnsignedChar:decodableStruct.commandResponseState.errorStateID]; + if (decodableStruct.commandResponseState.errorStateLabel.HasValue()) { self.commandResponseState.errorStateLabel = AsString(decodableStruct.commandResponseState.errorStateLabel.Value()); if (self.commandResponseState.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; return err; } + } else { + self.commandResponseState.errorStateLabel = nil; } if (decodableStruct.commandResponseState.errorStateDetails.HasValue()) { self.commandResponseState.errorStateDetails = AsString(decodableStruct.commandResponseState.errorStateDetails.Value()); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 28f95b18ae822e..51c8bc30950138 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -224,6 +224,13 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRRVCOperationalStateClusterOperationalCommandResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType &)decodableStruct; + +@end + @interface MTRDoorLockClusterGetWeekDayScheduleResponseParams (InternalMethods) - (CHIP_ERROR)_setFieldsFromDecodableStruct: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index d02da1d9f29b48..193a8a34012329 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1771,16 +1771,109 @@ static id _Nullable DecodeEventPayloadForOperationalStateCluster(EventId aEventI do { MTROperationalStateClusterErrorStateStruct * _Nonnull memberValue; memberValue = [MTROperationalStateClusterErrorStateStruct new]; - memberValue.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.errorState.errorStateID)]; - if (cppValue.errorState.errorStateLabel.IsNull()) { + memberValue.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorState.errorStateID]; + if (cppValue.errorState.errorStateLabel.HasValue()) { + memberValue.errorStateLabel = AsString(cppValue.errorState.errorStateLabel.Value()); + if (memberValue.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { memberValue.errorStateLabel = nil; + } + if (cppValue.errorState.errorStateDetails.HasValue()) { + memberValue.errorStateDetails = AsString(cppValue.errorState.errorStateDetails.Value()); + if (memberValue.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + memberValue.errorStateDetails = nil; + } + value.errorState = memberValue; + } while (0); + + return value; + } + case Events::OperationCompletion::Id: { + Events::OperationCompletion::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTROperationalStateClusterOperationCompletionEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:cppValue.completionErrorCode]; + value.completionErrorCode = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.totalOperationalTime.HasValue()) { + if (cppValue.totalOperationalTime.Value().IsNull()) { + memberValue = nil; + } else { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.totalOperationalTime.Value().Value()]; + } } else { + memberValue = nil; + } + value.totalOperationalTime = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.pausedTime.HasValue()) { + if (cppValue.pausedTime.Value().IsNull()) { + memberValue = nil; + } else { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.pausedTime.Value().Value()]; + } + } else { + memberValue = nil; + } + value.pausedTime = memberValue; + } while (0); + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} +static id _Nullable DecodeEventPayloadForRVCOperationalStateCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RvcOperationalState; + switch (aEventId) { + case Events::OperationalError::Id: { + Events::OperationalError::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRRVCOperationalStateClusterOperationalErrorEvent new]; + + do { + MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull memberValue; + memberValue = [MTRRVCOperationalStateClusterErrorStateStruct new]; + memberValue.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorState.errorStateID]; + if (cppValue.errorState.errorStateLabel.HasValue()) { memberValue.errorStateLabel = AsString(cppValue.errorState.errorStateLabel.Value()); if (memberValue.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; *aError = err; return nil; } + } else { + memberValue.errorStateLabel = nil; } if (cppValue.errorState.errorStateDetails.HasValue()) { memberValue.errorStateDetails = AsString(cppValue.errorState.errorStateDetails.Value()); @@ -1804,11 +1897,11 @@ static id _Nullable DecodeEventPayloadForOperationalStateCluster(EventId aEventI return nil; } - __auto_type * value = [MTROperationalStateClusterOperationCompletionEvent new]; + __auto_type * value = [MTRRVCOperationalStateClusterOperationCompletionEvent new]; do { NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.completionErrorCode)]; + memberValue = [NSNumber numberWithUnsignedChar:cppValue.completionErrorCode]; value.completionErrorCode = memberValue; } while (0); do { @@ -3050,6 +3143,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::OperationalState::Id: { return DecodeEventPayloadForOperationalStateCluster(aPath.mEventId, aReader, aError); } + case Clusters::RvcOperationalState::Id: { + return DecodeEventPayloadForRVCOperationalStateCluster(aPath.mEventId, aReader, aError); + } case Clusters::HepaFilterMonitoring::Id: { return DecodeEventPayloadForHEPAFilterMonitoringCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 2631ce6538c68c..63264e74bdead1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -687,23 +687,21 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy) NSNumber * _Nonnull stateValue API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @end -MTR_NEWLY_AVAILABLE -@interface MTRModeSelectClusterModeTagStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nullable mfgCode MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull value MTR_NEWLY_AVAILABLE; +API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) +@interface MTRModeSelectClusterSemanticTagStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull mfgCode API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +@property (nonatomic, copy) NSNumber * _Nonnull value API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @end MTR_DEPRECATED( - "Please use MTRModeSelectClusterModeTagStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) -@interface MTRModeSelectClusterSemanticTag : MTRModeSelectClusterModeTagStruct + "Please use MTRModeSelectClusterSemanticTagStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) +@interface MTRModeSelectClusterSemanticTag : MTRModeSelectClusterSemanticTagStruct @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRModeSelectClusterModeOptionStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull label API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @property (nonatomic, copy) NSNumber * _Nonnull mode API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -@property (nonatomic, copy) NSArray * _Nonnull modeTags MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSArray * _Nonnull semanticTags API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - MTR_NEWLY_DEPRECATED("Please use modeTags"); +@property (nonatomic, copy) NSArray * _Nonnull semanticTags API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @end MTR_NEWLY_AVAILABLE @@ -768,7 +766,7 @@ MTR_NEWLY_AVAILABLE MTR_NEWLY_AVAILABLE @interface MTROperationalStateClusterOperationalStateStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull operationalStateID MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSString * _Nonnull operationalStateLabel MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable operationalStateLabel MTR_NEWLY_AVAILABLE; @end MTR_NEWLY_AVAILABLE @@ -783,6 +781,31 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable pausedTime MTR_NEWLY_AVAILABLE; @end +MTR_NEWLY_AVAILABLE +@interface MTRRVCOperationalStateClusterErrorStateStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull errorStateID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable errorStateLabel MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable errorStateDetails MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRVCOperationalStateClusterOperationalStateStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull operationalStateID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable operationalStateLabel MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRVCOperationalStateClusterOperationalErrorEvent : NSObject +@property (nonatomic, copy) MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull errorState MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRVCOperationalStateClusterOperationCompletionEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull completionErrorCode MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable totalOperationalTime MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable pausedTime MTR_NEWLY_AVAILABLE; +@end + API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRDoorLockClusterCredentialStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull credentialType API_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 1cc982890290bd..17046b2bc00ffb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -2618,12 +2618,12 @@ - (NSString *)description @end -@implementation MTRModeSelectClusterModeTagStruct +@implementation MTRModeSelectClusterSemanticTagStruct - (instancetype)init { if (self = [super init]) { - _mfgCode = nil; + _mfgCode = @(0); _value = @(0); } @@ -2632,7 +2632,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRModeSelectClusterModeTagStruct alloc] init]; + auto other = [[MTRModeSelectClusterSemanticTagStruct alloc] init]; other.mfgCode = self.mfgCode; other.value = self.value; @@ -2649,7 +2649,7 @@ - (NSString *)description @end -@implementation MTRModeSelectClusterSemanticTag : MTRModeSelectClusterModeTagStruct +@implementation MTRModeSelectClusterSemanticTag : MTRModeSelectClusterSemanticTagStruct @end @implementation MTRModeSelectClusterModeOptionStruct @@ -2661,7 +2661,7 @@ - (instancetype)init _mode = @(0); - _modeTags = [NSArray array]; + _semanticTags = [NSArray array]; } return self; } @@ -2672,28 +2672,18 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.label = self.label; other.mode = self.mode; - other.modeTags = self.modeTags; + other.semanticTags = self.semanticTags; return other; } - (NSString *)description { - NSString * descriptionString = [NSString - stringWithFormat:@"<%@: label:%@; mode:%@; modeTags:%@; >", NSStringFromClass([self class]), _label, _mode, _modeTags]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: label:%@; mode:%@; semanticTags:%@; >", + NSStringFromClass([self class]), _label, _mode, _semanticTags]; return descriptionString; } -- (void)setSemanticTags:(NSArray * _Nonnull)semanticTags -{ - self.modeTags = semanticTags; -} - -- (NSArray * _Nonnull)semanticTags -{ - return self.modeTags; -} - @end @implementation MTRRefrigeratorAlarmClusterNotifyEvent @@ -3027,7 +3017,7 @@ - (instancetype)init _operationalStateID = @(0); - _operationalStateLabel = @""; + _operationalStateLabel = nil; } return self; } @@ -3114,6 +3104,134 @@ - (NSString *)description @end +@implementation MTRRVCOperationalStateClusterErrorStateStruct +- (instancetype)init +{ + if (self = [super init]) { + + _errorStateID = @(0); + + _errorStateLabel = nil; + + _errorStateDetails = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRVCOperationalStateClusterErrorStateStruct alloc] init]; + + other.errorStateID = self.errorStateID; + other.errorStateLabel = self.errorStateLabel; + other.errorStateDetails = self.errorStateDetails; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: errorStateID:%@; errorStateLabel:%@; errorStateDetails:%@; >", + NSStringFromClass([self class]), _errorStateID, _errorStateLabel, _errorStateDetails]; + return descriptionString; +} + +@end + +@implementation MTRRVCOperationalStateClusterOperationalStateStruct +- (instancetype)init +{ + if (self = [super init]) { + + _operationalStateID = @(0); + + _operationalStateLabel = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRVCOperationalStateClusterOperationalStateStruct alloc] init]; + + other.operationalStateID = self.operationalStateID; + other.operationalStateLabel = self.operationalStateLabel; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: operationalStateID:%@; operationalStateLabel:%@; >", + NSStringFromClass([self class]), _operationalStateID, _operationalStateLabel]; + return descriptionString; +} + +@end + +@implementation MTRRVCOperationalStateClusterOperationalErrorEvent +- (instancetype)init +{ + if (self = [super init]) { + + _errorState = [MTRRVCOperationalStateClusterErrorStateStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRVCOperationalStateClusterOperationalErrorEvent alloc] init]; + + other.errorState = self.errorState; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: errorState:%@; >", NSStringFromClass([self class]), _errorState]; + return descriptionString; +} + +@end + +@implementation MTRRVCOperationalStateClusterOperationCompletionEvent +- (instancetype)init +{ + if (self = [super init]) { + + _completionErrorCode = @(0); + + _totalOperationalTime = nil; + + _pausedTime = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRVCOperationalStateClusterOperationCompletionEvent alloc] init]; + + other.completionErrorCode = self.completionErrorCode; + other.totalOperationalTime = self.totalOperationalTime; + other.pausedTime = self.pausedTime; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: completionErrorCode:%@; totalOperationalTime:%@; pausedTime:%@; >", + NSStringFromClass([self class]), _completionErrorCode, _totalOperationalTime, _pausedTime]; + return descriptionString; +} + +@end + @implementation MTRDoorLockClusterCredentialStruct - (instancetype)init { diff --git a/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m b/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m index 8b5b0f7c9dcf97..7a7b943e739d6a 100644 --- a/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m +++ b/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m @@ -26,6 +26,13 @@ // system dependencies #import +// TODO: Disable test005_DoBDXTransferAllowUpdateRequest until PR #26040 is merged. +// Currently the poll interval causes delays in the BDX transfer and +// results in the test taking a long time. +#ifdef ENABLE_TEST_005 +#undef ENABLE_TEST_005 +#endif + static const uint16_t kPairingTimeoutInSeconds = 10; static const uint16_t kTimeoutInSeconds = 3; static const uint16_t kTimeoutWithUpdateInSeconds = 10; @@ -48,6 +55,12 @@ // Keys we can use to restart the controller. static MTRTestKeys * sTestKeys = nil; +static NSString * kOtaDownloadedFilePath1 = @"/tmp/chip-ota-requestor-downloaded-image1"; + +static NSNumber * kUpdatedSoftwareVersion = @5; + +static NSString * kUpdatedSoftwareVersionString = @"5.0"; + @interface MTROTAProviderTestControllerDelegate : NSObject @property (nonatomic, readonly) XCTestExpectation * expectation; @property (nonatomic, readonly) NSNumber * commissioneeNodeID; @@ -229,8 +242,8 @@ - (void)respondAvailableWithDelay:(NSNumber *)delay responseParams.imageURI = uri; // TODO: Figure out whether we need better // SoftwareVersion/SoftwareVersionString/UpdateToken bits. - responseParams.softwareVersion = @(18); - responseParams.softwareVersionString = @"18"; + responseParams.softwareVersion = kUpdatedSoftwareVersion; + responseParams.softwareVersionString = kUpdatedSoftwareVersionString; responseParams.updateToken = updateToken; completion(responseParams, nil); } @@ -250,6 +263,14 @@ - (void)respondWithDiscontinueToApplyUpdateRequestWithCompletion:(ApplyUpdateReq completion(params, nil); } +- (void)respondWithProceedToApplyUpdateRequestWithCompletion:(ApplyUpdateRequestCompletion)completion +{ + __auto_type * params = [[MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams alloc] init]; + params.action = @(MTROTASoftwareUpdateProviderOTAApplyUpdateActionProceed); + params.delayedActionTime = @(0); + completion(params, nil); +} + - (void)respondErrorWithCompletion:(MTRStatusCompletion)completion { [self respondErrorWithCode:MTRErrorCodeGeneralError completion:completion]; @@ -622,8 +643,8 @@ - (void)test004_DoBDXTransferDenyUpdateRequest while (fakeImage.length < rawImageSize) { [fakeImage appendData:rawImagePiece]; } - NSString * rawImagePath = @"/tmp/test004-raw-image"; - NSString * imagePath = @"/tmp/test004-image"; + NSString * rawImagePath = @"/tmp/ota-test004-raw-image"; + NSString * imagePath = @"/tmp/ota-test004-image"; [[NSFileManager defaultManager] createFileAtPath:rawImagePath contents:fakeImage attributes:nil]; @@ -637,7 +658,8 @@ - (void)test004_DoBDXTransferDenyUpdateRequest NSTask * task = [[NSTask alloc] init]; [task setLaunchPath:imageToolPath]; [task setArguments:@[ - @"create", @"-v", @"0xFFF1", @"-p", @"0x8001", @"-vn", @"2", @"-vs", @"2.0", @"-da", @"sha256", rawImagePath, imagePath + @"create", @"-v", @"0xFFF1", @"-p", @"0x8001", @"-vn", [kUpdatedSoftwareVersion stringValue], @"-vs", + kUpdatedSoftwareVersionString, @"-da", @"sha256", rawImagePath, imagePath ]]; NSError * launchError = nil; [task launchAndReturnError:&launchError]; @@ -735,10 +757,9 @@ - (void)test004_DoBDXTransferDenyUpdateRequest XCTAssertEqualObjects(nodeID, @(kDeviceId1)); XCTAssertEqual(controller, sController); XCTAssertEqualObjects(params.updateToken, updateToken); - XCTAssertEqualObjects(params.newVersion, @(18)); // TODO: Factor this out better! + XCTAssertEqualObjects(params.newVersion, kUpdatedSoftwareVersion); // TODO: Factor this out better! - XCTAssertTrue([[NSFileManager defaultManager] contentsEqualAtPath:rawImagePath - andPath:@"/tmp/chip-ota-requestor-downloaded-image1"]); + XCTAssertTrue([[NSFileManager defaultManager] contentsEqualAtPath:rawImagePath andPath:kOtaDownloadedFilePath1]); sOTAProviderDelegate.applyUpdateRequestHandler = nil; [sOTAProviderDelegate respondWithDiscontinueToApplyUpdateRequestWithCompletion:completion]; @@ -761,6 +782,175 @@ - (void)test004_DoBDXTransferDenyUpdateRequest timeout:kTimeoutInSeconds]; } +// TODO: Enable this test when PR #26040 is merged. Currently the poll interval causes delays in the BDX transfer and +// results in the test taking a long time. With PR #26040 we eliminate the poll interval completely and hence the test +// can run in a short time. +#ifdef ENABLE_TEST_005 +- (void)test005_DoBDXTransferAllowUpdateRequest +{ + // In this test we do the following: + // + // 1) Check if the ota image file and raw image file required for this test exist. + // 2) Advertise ourselves to device. + // 3) When device queries for an image, pass the image path for the ota file generated beforehand as a pre-requisite + // 4) When device tries to start a bdx transfer, respond with success. + // 5) Send the data as the BDX transfer proceeds. + // 6) Confirm the downloaded ota image matches the raw image file that was generated before the test was run as a pre-requisite + // 7) When device invokes ApplyUpdateRequest, respond with Proceed so that the update proceeds + // 8) Wait for the app to restart and wait for the NotifyUpdateApplied message to confirm the app has updated to the new version + + // These are the paths where the raw ota image file and the raw image file will be generated + // as a pre-requisite to running the test. + NSString * otaRawImagePath = @"/tmp/ota-test005-raw-image"; + NSString * otaImagePath = @"/tmp/ota-test005-image"; + + // Check if the ota raw image exists at kOtaRawImagePath + XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:otaRawImagePath]); + + // Check if the ota image file is created at kOtaImagePath. + XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:otaImagePath]); + + __auto_type * device = sConnectedDevice1; + + XCTestExpectation * queryExpectation = [self expectationWithDescription:@"handleQueryImageForNodeID called"]; + XCTestExpectation * bdxBeginExpectation = [self expectationWithDescription:@"handleBDXTransferSessionBeginForNodeID called"]; + XCTestExpectation * bdxQueryExpectation = [self expectationWithDescription:@"handleBDXQueryForNodeID called"]; + XCTestExpectation * bdxEndExpectation = [self expectationWithDescription:@"handleBDXTransferSessionEndForNodeID called"]; + XCTestExpectation * applyUpdateRequestExpectation = + [self expectationWithDescription:@"handleApplyUpdateRequestForNodeID called"]; + XCTestExpectation * notifyUpdateAppliedExpectation = + [self expectationWithDescription:@"handleNotifyUpdateAppliedForNodeID called"]; + + NSData * updateToken = [sOTAProviderDelegate generateUpdateToken]; + + __block NSFileHandle * readHandle; + __block uint64_t imageSize; + __block uint32_t lastBlockIndex = UINT32_MAX; + + // TODO: Maybe we should move more of this logic into sOTAProviderDelegate + // or some other helper, once we have multiple tests sending images? For + // example, we could have something where you can do one of two things: + // + // 1) register a "raw image" with it, and it generates the + // image-with header. + // 2) register a pre-generated image with it and it uses "ota_image_tool.py + // extract" to extract the raw image. + // + // Once that's done the helper could track the transfer state for a + // particular image, etc, with us just forwarding our notifications to it. + sOTAProviderDelegate.queryImageHandler = ^(NSNumber * nodeID, MTRDeviceController * controller, + MTROTASoftwareUpdateProviderClusterQueryImageParams * params, QueryImageCompletion completion) { + XCTAssertEqualObjects(nodeID, @(kDeviceId1)); + XCTAssertEqual(controller, sController); + + sOTAProviderDelegate.queryImageHandler = nil; + [sOTAProviderDelegate respondAvailableWithDelay:@(0) uri:otaImagePath updateToken:updateToken completion:completion]; + [queryExpectation fulfill]; + }; + sOTAProviderDelegate.transferBeginHandler = ^(NSNumber * nodeID, MTRDeviceController * controller, NSString * fileDesignator, + NSNumber * offset, MTRStatusCompletion completion) { + XCTAssertEqualObjects(nodeID, @(kDeviceId1)); + XCTAssertEqual(controller, sController); + XCTAssertEqualObjects(fileDesignator, otaImagePath); + XCTAssertEqualObjects(offset, @(0)); + + readHandle = [NSFileHandle fileHandleForReadingAtPath:fileDesignator]; + XCTAssertNotNil(readHandle); + + NSError * endSeekError; + XCTAssertTrue([readHandle seekToEndReturningOffset:&imageSize error:&endSeekError]); + XCTAssertNil(endSeekError); + + sOTAProviderDelegate.transferBeginHandler = nil; + [sOTAProviderDelegate respondSuccess:completion]; + [bdxBeginExpectation fulfill]; + }; + sOTAProviderDelegate.blockQueryHandler = ^(NSNumber * nodeID, MTRDeviceController * controller, NSNumber * blockSize, + NSNumber * blockIndex, NSNumber * bytesToSkip, BlockQueryCompletion completion) { + XCTAssertEqualObjects(nodeID, @(kDeviceId1)); + XCTAssertEqual(controller, sController); + XCTAssertEqualObjects(blockSize, @(1024)); // Seems to always be 1024. + XCTAssertEqualObjects(blockIndex, @(lastBlockIndex + 1)); + XCTAssertEqualObjects(bytesToSkip, @(0)); // Don't expect to see skips here. + + XCTAssertNotNil(readHandle); + uint64_t offset = blockSize.unsignedLongLongValue * blockIndex.unsignedLongLongValue; + NSError * seekError = nil; + [readHandle seekToOffset:offset error:&seekError]; + XCTAssertNil(seekError); + + NSError * readError = nil; + NSData * data = [readHandle readDataUpToLength:blockSize.unsignedLongValue error:&readError]; + XCTAssertNil(readError); + XCTAssertNotNil(data); + + BOOL isEOF = offset + blockSize.unsignedLongValue >= imageSize; + + ++lastBlockIndex; + + if (isEOF) { + sOTAProviderDelegate.blockQueryHandler = nil; + } + + completion(data, isEOF); + + if (isEOF) { + [bdxQueryExpectation fulfill]; + } + }; + sOTAProviderDelegate.transferEndHandler = ^(NSNumber * nodeID, MTRDeviceController * controller, NSError * _Nullable error) { + XCTAssertEqualObjects(nodeID, @(kDeviceId1)); + XCTAssertEqual(controller, sController); + XCTAssertNil(error); + + sOTAProviderDelegate.transferEndHandler = nil; + [bdxEndExpectation fulfill]; + }; + sOTAProviderDelegate.applyUpdateRequestHandler = ^(NSNumber * nodeID, MTRDeviceController * controller, + MTROTASoftwareUpdateProviderClusterApplyUpdateRequestParams * params, ApplyUpdateRequestCompletion completion) { + XCTAssertEqualObjects(nodeID, @(kDeviceId1)); + XCTAssertEqual(controller, sController); + XCTAssertEqualObjects(params.updateToken, updateToken); + XCTAssertEqualObjects(params.newVersion, kUpdatedSoftwareVersion); // TODO: Factor this out better! + + XCTAssertTrue([[NSFileManager defaultManager] contentsEqualAtPath:otaRawImagePath andPath:kOtaDownloadedFilePath1]); + + sOTAProviderDelegate.applyUpdateRequestHandler = nil; + [sOTAProviderDelegate respondWithProceedToApplyUpdateRequestWithCompletion:completion]; + [applyUpdateRequestExpectation fulfill]; + }; + sOTAProviderDelegate.notifyUpdateAppliedHandler = ^(NSNumber * nodeID, MTRDeviceController * controller, + MTROTASoftwareUpdateProviderClusterNotifyUpdateAppliedParams * params, MTRStatusCompletion completion) { + XCTAssertEqualObjects(nodeID, @(kDeviceId1)); + XCTAssertEqual(controller, sController); + XCTAssertEqualObjects(params.updateToken, updateToken); + XCTAssertEqualObjects(params.softwareVersion, kUpdatedSoftwareVersion); + + sOTAProviderDelegate.notifyUpdateAppliedHandler = nil; + [sOTAProviderDelegate respondSuccess:completion]; + [notifyUpdateAppliedExpectation fulfill]; + }; + + // Advertise ourselves as an OTA provider. + XCTestExpectation * announceResponseExpectation = [self announceProviderToDevice:device]; + + // Make sure we get our callbacks in order. Give it a bit more time, because + // we want to allow time for the BDX download. + [self waitForExpectations:@[ queryExpectation, bdxBeginExpectation, bdxQueryExpectation, bdxEndExpectation ] + timeout:(kTimeoutWithUpdateInSeconds) enforceOrder:YES]; + + // Nothing really defines the ordering of bdxEndExpectation and + // applyUpdateRequestExpectation with respect to each other. + [self waitForExpectations:@[ applyUpdateRequestExpectation, notifyUpdateAppliedExpectation ] + timeout:kTimeoutInSeconds + enforceOrder:YES]; + + // Nothing defines the ordering of announceResponseExpectation with respect + // to _any_ of the above expectations. + [self waitForExpectations:@[ announceResponseExpectation ] timeout:kTimeoutInSeconds]; +} +#endif // ENABLE_TEST_005 + - (void)test999_TearDown { __auto_type * device = [MTRBaseDevice deviceWithNodeID:@(kDeviceId1) controller:sController]; diff --git a/src/darwin/Framework/CHIPTests/MTRPairingTests.m b/src/darwin/Framework/CHIPTests/MTRPairingTests.m index b9d012776a0d2a..5043744286486a 100644 --- a/src/darwin/Framework/CHIPTests/MTRPairingTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPairingTests.m @@ -64,6 +64,11 @@ - (void)deviceAttestationCompletedForController:(MTRDeviceController *)controlle error:(NSError * _Nullable)error { [self.expectation fulfill]; + // Hard-coded to what our example server app uses for now. + // TODO: Build an example that uses the "origin" bits that allow a DAC and + // CD to have different vendor IDs, and verify things here. + XCTAssertEqualObjects(attestationDeviceInfo.basicInformationVendorID, @(0xFFF1)); + XCTAssertEqualObjects(attestationDeviceInfo.basicInformationProductID, @(0x8001)); [controller continueCommissioningDevice:opaqueDeviceHandle ignoreAttestationFailure:NO error:nil]; } diff --git a/src/inet/IPAddress.cpp b/src/inet/IPAddress.cpp index 19da2acaee94f7..3546df5acb0657 100644 --- a/src/inet/IPAddress.cpp +++ b/src/inet/IPAddress.cpp @@ -508,5 +508,28 @@ IPAddress IPAddress::MakeIPv4Broadcast() return ipAddr; } +IPAddress IPAddress::Loopback(IPAddressType type) +{ + IPAddress address; +#if INET_CONFIG_ENABLE_IPV4 + if (type == IPAddressType::kIPv4) + { + address.Addr[0] = 0; + address.Addr[1] = 0; + address.Addr[2] = htonl(0xFFFF); + address.Addr[3] = htonl(0x7F000001); + } + else +#endif + { + address.Addr[0] = 0; + address.Addr[1] = 0; + address.Addr[2] = 0; + address.Addr[3] = htonl(1); + } + + return address; +} + } // namespace Inet } // namespace chip diff --git a/src/inet/IPAddress.h b/src/inet/IPAddress.h index c97f25de752d44..2b756ef5561b99 100644 --- a/src/inet/IPAddress.h +++ b/src/inet/IPAddress.h @@ -698,6 +698,14 @@ class DLL_EXPORT IPAddress * not be modified by users of the CHIP Inet Layer. */ static IPAddress Any; + + /** + * Creates a loopback of the specified type. Type MUST be IPv6/v4. + * + * If type is anything else (or IPv4 is not available) an IPv6 + * loopback will be created. + */ + static IPAddress Loopback(IPAddressType type); }; static_assert(std::is_trivial::value, "IPAddress is not trivial"); diff --git a/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp b/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp index b2f1a0b98f69b5..c3817ce4c3811a 100644 --- a/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp +++ b/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp @@ -206,10 +206,6 @@ class AdvertiserMinMdns : public ServiceAdvertiser, /// removes all records by advertising a 0 TTL) void AdvertiseRecords(BroadcastAdvertiseType type); - /// Determine if advertisement on the specified interface/address is ok given the - /// interfaces on which the mDNS server is listening - bool ShouldAdvertiseOn(const chip::Inet::InterfaceId id, const chip::Inet::IPAddress & addr); - FullQName GetCommissioningTxtEntries(const CommissionAdvertisingParameters & params); FullQName GetOperationalTxtEntries(OperationalQueryAllocator::Allocator * allocator, const OperationalAdvertisingParameters & params); @@ -856,35 +852,6 @@ FullQName AdvertiserMinMdns::GetCommissioningTxtEntries(const CommissionAdvertis return allocator->AllocateQNameFromArray(txtFields, numTxtFields); } -bool AdvertiserMinMdns::ShouldAdvertiseOn(const chip::Inet::InterfaceId id, const chip::Inet::IPAddress & addr) -{ - auto & server = GlobalMinimalMdnsServer::Server(); - - bool result = false; - - server.ForEachEndPoints([&](auto * info) { - if (info->mListenUdp == nullptr) - { - return chip::Loop::Continue; - } - - if (info->mInterfaceId != id) - { - return chip::Loop::Continue; - } - - if (info->mAddressType != addr.Type()) - { - return chip::Loop::Continue; - } - - result = true; - return chip::Loop::Break; - }); - - return result; -} - void AdvertiserMinMdns::AdvertiseRecords(BroadcastAdvertiseType type) { ResponseConfiguration responseConfiguration; @@ -905,60 +872,54 @@ void AdvertiserMinMdns::AdvertiseRecords(BroadcastAdvertiseType type) UniquePtr allIps = GetAddressPolicy()->GetIpAddressesForEndpoint(interfaceId, addressType); VerifyOrDieWithMsg(allIps != nullptr, Discovery, "Failed to allocate memory for ip addresses."); - Inet::IPAddress ipAddress; - while (allIps->Next(ipAddress)) + chip::Inet::IPPacketInfo packetInfo; + + packetInfo.Clear(); + + // advertising on every interface requires a valid IP address + // since we use "BROADCAST" (unicast is false), we do not actually care about + // the source IP address value, just that it has the right "type" + // + // NOTE: cannot use Broadcast address as the source as they have the type kAny. + // + // TODO: ideally we may want to have a destination that is explicit as "unicast/destIp" + // vs "multicast/addressType". Such a change requires larger code updates. + packetInfo.SrcAddress = chip::Inet::IPAddress::Loopback(addressType); + packetInfo.DestAddress = BroadcastIpAddresses::Get(addressType); + packetInfo.SrcPort = kMdnsPort; + packetInfo.DestPort = kMdnsPort; + packetInfo.Interface = interfaceId; + + // Advertise all records + // + // TODO: Consider advertising delta changes. + // + // Current advertisement does not have a concept of "delta" to only + // advertise changes. Current implementation is to always + // 1. advertise TTL=0 (clear all caches) + // 2. advertise available records (with longer TTL) + // + // It would be nice if we could selectively advertise what changes, like + // send TTL=0 for anything removed/about to be removed (and only those), + // then only advertise new items added. + // + // This optimization likely will take more logic and state storage, so + // for now it is not done. + QueryData queryData(QType::PTR, QClass::IN, false /* unicast */); + queryData.SetIsAnnounceBroadcast(true); + + for (auto & it : mOperationalResponders) { - if (!ShouldAdvertiseOn(interfaceId, ipAddress)) - { - continue; - } + it.GetAllocator()->GetQueryResponder()->ClearBroadcastThrottle(); + } + mQueryResponderAllocatorCommissionable.GetQueryResponder()->ClearBroadcastThrottle(); + mQueryResponderAllocatorCommissioner.GetQueryResponder()->ClearBroadcastThrottle(); - chip::Inet::IPPacketInfo packetInfo; + CHIP_ERROR err = mResponseSender.Respond(0, queryData, &packetInfo, responseConfiguration); - packetInfo.Clear(); - packetInfo.SrcAddress = ipAddress; - if (ipAddress.IsIPv4()) - { - BroadcastIpAddresses::GetIpv4Into(packetInfo.DestAddress); - } - else - { - BroadcastIpAddresses::GetIpv6Into(packetInfo.DestAddress); - } - packetInfo.SrcPort = kMdnsPort; - packetInfo.DestPort = kMdnsPort; - packetInfo.Interface = interfaceId; - - // Advertise all records - // - // TODO: Consider advertising delta changes. - // - // Current advertisement does not have a concept of "delta" to only - // advertise changes. Current implementation is to always - // 1. advertise TTL=0 (clear all caches) - // 2. advertise available records (with longer TTL) - // - // It would be nice if we could selectively advertise what changes, like - // send TTL=0 for anything removed/about to be removed (and only those), - // then only advertise new items added. - // - // This optimization likely will take more logic and state storage, so - // for now it is not done. - QueryData queryData(QType::PTR, QClass::IN, false /* unicast */); - queryData.SetIsAnnounceBroadcast(true); - - for (auto & it : mOperationalResponders) - { - it.GetAllocator()->GetQueryResponder()->ClearBroadcastThrottle(); - } - mQueryResponderAllocatorCommissionable.GetQueryResponder()->ClearBroadcastThrottle(); - mQueryResponderAllocatorCommissioner.GetQueryResponder()->ClearBroadcastThrottle(); - - CHIP_ERROR err = mResponseSender.Respond(0, queryData, &packetInfo, responseConfiguration); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Discovery, "Failed to advertise records: %" CHIP_ERROR_FORMAT, err.Format()); - } + if (err != CHIP_NO_ERROR) + { + ChipLogError(Discovery, "Failed to advertise records: %" CHIP_ERROR_FORMAT, err.Format()); } } diff --git a/src/lib/dnssd/minimal_mdns/Server.cpp b/src/lib/dnssd/minimal_mdns/Server.cpp index ccf041eb605d7c..f8a0971f5710e5 100644 --- a/src/lib/dnssd/minimal_mdns/Server.cpp +++ b/src/lib/dnssd/minimal_mdns/Server.cpp @@ -121,51 +121,26 @@ class InterfaceTypeFilterDelegate : public ServerBase::BroadcastSendDelegate namespace BroadcastIpAddresses { // Get standard mDNS Broadcast addresses - -void GetIpv6Into(chip::Inet::IPAddress & dest) +chip::Inet::IPAddress Get(chip::Inet::IPAddressType addressType) { - if (!chip::Inet::IPAddress::FromString("FF02::FB", dest)) + chip::Inet::IPAddress address; +#if INET_CONFIG_ENABLE_IPV4 + if (addressType == chip::Inet::IPAddressType::kIPv4) { - ChipLogError(Discovery, "Failed to parse standard IPv6 broadcast address"); + VerifyOrDie(chip::Inet::IPAddress::FromString("224.0.0.251", address)); } -} - -void GetIpv4Into(chip::Inet::IPAddress & dest) -{ - if (!chip::Inet::IPAddress::FromString("224.0.0.251", dest)) + else +#endif { - ChipLogError(Discovery, "Failed to parse standard IPv4 broadcast address"); + VerifyOrDie(chip::Inet::IPAddress::FromString("FF02::FB", address)); } + return address; } } // namespace BroadcastIpAddresses namespace { -CHIP_ERROR JoinMulticastGroup(chip::Inet::InterfaceId interfaceId, chip::Inet::UDPEndPoint * endpoint, - chip::Inet::IPAddressType addressType) -{ - - chip::Inet::IPAddress address; - - if (addressType == chip::Inet::IPAddressType::kIPv6) - { - BroadcastIpAddresses::GetIpv6Into(address); -#if INET_CONFIG_ENABLE_IPV4 - } - else if (addressType == chip::Inet::IPAddressType::kIPv4) - { - BroadcastIpAddresses::GetIpv4Into(address); -#endif // INET_CONFIG_ENABLE_IPV4 - } - else - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - return endpoint->JoinMulticastGroup(interfaceId, address); -} - #if CHIP_ERROR_LOGGING const char * AddressTypeStr(chip::Inet::IPAddressType addressType) { @@ -240,7 +215,8 @@ CHIP_ERROR ServerBase::Listen(chip::Inet::EndPointManagerListen(OnUdpPacketReceived, nullptr /*OnReceiveError*/, this)); - CHIP_ERROR err = JoinMulticastGroup(interfaceId, listenUdp, addressType); + CHIP_ERROR err = listenUdp->JoinMulticastGroup(interfaceId, BroadcastIpAddresses::Get(addressType)); + if (err != CHIP_NO_ERROR) { char interfaceName[chip::Inet::InterfaceId::kMaxIfNameLength]; diff --git a/src/lib/dnssd/minimal_mdns/Server.h b/src/lib/dnssd/minimal_mdns/Server.h index 150a5e44dc8e69..39e9ff2a06b345 100644 --- a/src/lib/dnssd/minimal_mdns/Server.h +++ b/src/lib/dnssd/minimal_mdns/Server.h @@ -32,9 +32,7 @@ namespace Minimal { namespace BroadcastIpAddresses { // Get standard mDNS Broadcast addresses - -void GetIpv6Into(chip::Inet::IPAddress & dest); -void GetIpv4Into(chip::Inet::IPAddress & dest); +chip::Inet::IPAddress Get(chip::Inet::IPAddressType addressType); } // namespace BroadcastIpAddresses @@ -130,10 +128,9 @@ class ServerBase ServerBase(EndpointInfoPoolType & pool) : mEndpoints(pool) { - BroadcastIpAddresses::GetIpv6Into(mIpv6BroadcastAddress); - + mIpv6BroadcastAddress = BroadcastIpAddresses::Get(chip::Inet::IPAddressType::kIPv6); #if INET_CONFIG_ENABLE_IPV4 - BroadcastIpAddresses::GetIpv4Into(mIpv4BroadcastAddress); + mIpv4BroadcastAddress = BroadcastIpAddresses::Get(chip::Inet::IPAddressType::kIPv4); #endif } virtual ~ServerBase(); @@ -178,13 +175,6 @@ class ServerBase return *this; } - /// Iterator through all Endpoints - template - chip::Loop ForEachEndPoints(Function && function) - { - return mEndpoints.ForEachActiveObject(std::forward(function)); - } - /// A server is considered listening if any UDP endpoint is active. /// /// This is expected to return false after any Shutdown() and will diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 7f18adc631cb73..33744932a68048 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -63,9 +63,18 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { # Indication that the CHIP data model is included chip_enable_data_model = false - # The string of device software version was built. + # Device software version as an integer. e.g. chip_device_config_device_software_version=7 + chip_device_config_device_software_version = "" + + # Device software version string as a string having the format "x.y" e.g. chip_device_config_device_software_version="7.0" (but make sure to escape it from the shell!) chip_device_config_device_software_version_string = "" + # Device vendor id as a decimal integer. Configurable vendor ids allowed are 65521 (0xFFF1), 65522 (0xFFF2), 655223 (0xFFF3). + chip_device_config_device_vendor_id = "" + + # Device product id as a decimal integer. Configurable product ids allowed are in the range 32768 (0x8000) - 32867 (0x8063) + chip_device_config_device_product_id = "" + # Define the default number of ip addresses to discover chip_max_discovered_ip_addresses = 5 } @@ -301,10 +310,22 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { ] } + if (chip_device_config_device_software_version != "") { + defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${chip_device_config_device_software_version}" ] + } + if (chip_device_config_device_software_version_string != "") { defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${chip_device_config_device_software_version_string}\"" ] } + if (chip_device_config_device_vendor_id != "") { + defines += [ "CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID=${chip_device_config_device_vendor_id}" ] + } + + if (chip_device_config_device_product_id != "") { + defines += [ "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${chip_device_config_device_product_id}" ] + } + defines += [ "CHIP_DEVICE_CONFIG_MAX_DISCOVERED_IP_ADDRESSES=${chip_max_discovered_ip_addresses}" ] } } else if (chip_device_platform == "none") { diff --git a/src/platform/ESP32/ESP32Config.h b/src/platform/ESP32/ESP32Config.h index fbcef1126be177..e07d98eba27594 100644 --- a/src/platform/ESP32/ESP32Config.h +++ b/src/platform/ESP32/ESP32Config.h @@ -198,17 +198,17 @@ class ESP32Config::KeyAllocator VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); return snprintf(key, size, "sm-mode/%x/%x", endpoint, index) > 0 ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; } - static CHIP_ERROR ModeTagsCount(char * key, size_t size, uint16_t endpoint, uint16_t index) + static CHIP_ERROR SemanticTagsCount(char * key, size_t size, uint16_t endpoint, uint16_t index) { VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); return snprintf(key, size, "sm-st-sz/%x/%x", endpoint, index) > 0 ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; } - static CHIP_ERROR ModeTagValue(char * key, size_t size, uint16_t endpoint, uint16_t index, uint16_t ind) + static CHIP_ERROR SemanticTagValue(char * key, size_t size, uint16_t endpoint, uint16_t index, uint16_t ind) { VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); return snprintf(key, size, "st-v/%x/%x/%x", endpoint, index, ind) > 0 ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; } - static CHIP_ERROR ModeTagMfgCode(char * key, size_t size, uint16_t endpoint, uint16_t index, uint16_t ind) + static CHIP_ERROR SemanticTagMfgCode(char * key, size_t size, uint16_t endpoint, uint16_t index, uint16_t ind) { VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); return snprintf(key, size, "st-mfg/%x/%x/%x", endpoint, index, ind) > 0 ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; diff --git a/src/platform/ESP32/NetworkCommissioningDriver.cpp b/src/platform/ESP32/NetworkCommissioningDriver.cpp index 148704eeeeef2a..7e080f5246256e 100644 --- a/src/platform/ESP32/NetworkCommissioningDriver.cpp +++ b/src/platform/ESP32/NetworkCommissioningDriver.cpp @@ -297,27 +297,26 @@ CHIP_ERROR ESPWiFiDriver::StartScanWiFiNetworks(ByteSpan ssid) void ESPWiFiDriver::OnScanWiFiNetworkDone() { + if (!mpScanCallback) + { + ChipLogProgress(DeviceLayer, "No scan callback"); + return; + } uint16_t ap_number; esp_wifi_scan_get_ap_num(&ap_number); if (!ap_number) { ChipLogProgress(DeviceLayer, "No AP found"); - if (mpScanCallback != nullptr) - { - mpScanCallback->OnFinished(Status::kSuccess, CharSpan(), nullptr); - mpScanCallback = nullptr; - } + mpScanCallback->OnFinished(Status::kSuccess, CharSpan(), nullptr); + mpScanCallback = nullptr; return; } std::unique_ptr ap_buffer_ptr(new wifi_ap_record_t[ap_number]); if (ap_buffer_ptr == NULL) { ChipLogError(DeviceLayer, "can't malloc memory for ap_list_buffer"); - if (mpScanCallback) - { - mpScanCallback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); - mpScanCallback = nullptr; - } + mpScanCallback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); + mpScanCallback = nullptr; return; } wifi_ap_record_t * ap_list_buffer = ap_buffer_ptr.get(); @@ -339,16 +338,19 @@ void ESPWiFiDriver::OnScanWiFiNetworkDone() { ap_buffer_ptr.release(); } - } - else - { - ChipLogError(DeviceLayer, "can't get ap_records "); - if (mpScanCallback) + else { + ChipLogError(DeviceLayer, "can't schedule the scan result processing"); mpScanCallback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); mpScanCallback = nullptr; } } + else + { + ChipLogError(DeviceLayer, "can't get ap_records "); + mpScanCallback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); + mpScanCallback = nullptr; + } } void ESPWiFiDriver::OnNetworkStatusChange() diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py new file mode 100644 index 00000000000000..2e175d6ffc409d --- /dev/null +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -0,0 +1,395 @@ +# +# 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. +# + +import base64 +import copy +import json +import logging +import pathlib +import sys +from dataclasses import dataclass +from pprint import pprint +from typing import Any, Callable, Optional + +import chip.clusters as Clusters +import chip.tlv +from chip import discovery +from chip.clusters.Attribute import ValueDecodeFailure +from chip.exceptions import ChipStackError +from chip.setup_payload import SetupPayload +from matter_testing_support import AttributePathLocation, MatterBaseTest, async_test_body, default_matter_test_main +from mobly import asserts + + +def MatterTlvToJson(tlv_data: dict[int, Any]) -> dict[str, Any]: + """Given TLV data for a specific cluster instance, convert to the Matter JSON format.""" + + matter_json_dict = {} + + key_type_mappings = { + chip.tlv.uint: "UINT", + int: "INT", + bool: "BOOL", + list: "ARRAY", + dict: "STRUCT", + chip.tlv.float32: "FLOAT", + float: "DOUBLE", + bytes: "BYTES", + str: "STRING", + ValueDecodeFailure: "ERROR", + type(None): "NULL", + } + + def ConvertValue(value) -> Any: + if isinstance(value, ValueDecodeFailure): + raise ValueError(f"Bad Value: {str(value)}") + + if isinstance(value, bytes): + return base64.b64encode(value).decode("UTF-8") + elif isinstance(value, list): + value = [ConvertValue(item) for item in value] + elif isinstance(value, dict): + value = MatterTlvToJson(value) + + return value + + for key in tlv_data: + value_type = type(tlv_data[key]) + value = copy.deepcopy(tlv_data[key]) + + element_type: str = key_type_mappings[value_type] + sub_element_type = "" + + try: + new_value = ConvertValue(value) + except ValueError as e: + new_value = str(e) + + if element_type: + if element_type == "ARRAY": + if len(new_value): + sub_element_type = key_type_mappings[type(tlv_data[key][0])] + else: + sub_element_type = "?" + + new_key = "" + if element_type: + if sub_element_type: + new_key = f"{str(key)}:{element_type}-{sub_element_type}" + else: + new_key = f"{str(key)}:{element_type}" + else: + new_key = str(key) + + matter_json_dict[new_key] = new_value + + return matter_json_dict + + +def check_int_in_range(min_value: int, max_value: int, allow_null: bool = False) -> Callable: + """Returns a checker for whether `obj` is an int that fits in a range.""" + def int_in_range_checker(obj: Any): + """Inner checker logic for check_int_in_range + + Checker validates that `obj` must have decoded as an integral value in range [min_value, max_value]. + + On failure, a ValueError is raised with a diagnostic message. + """ + if obj is None and allow_null: + return + + if not isinstance(obj, int) and not isinstance(obj, chip.tlv.uint): + raise ValueError(f"Value {str(obj)} is not an integer or uint (decoded type: {type(obj)})") + int_val = int(obj) + if (int_val < min_value) or (int_val > max_value): + raise ValueError( + f"Value {int_val} (0x{int_val:X}) not in range [{min_value}, {max_value}] ([0x{min_value:X}, 0x{max_value:X}])") + + return int_in_range_checker + + +def check_list_of_ints_in_range(min_value: int, max_value: int, min_size: int = 0, max_size: int = 65535, allow_null: bool = False) -> Callable: + """Returns a checker for whether `obj` is a list of ints that fit in a range.""" + def list_of_ints_in_range_checker(obj: Any): + """Inner checker for check_list_of_ints_in_range. + + Checker validates that `obj` must have decoded as a list of integral values in range [min_value, max_value]. + The length of the list must be between [min_size, max_size]. + + On failure, a ValueError is raised with a diagnostic message. + """ + if obj is None and allow_null: + return + + if not isinstance(obj, list): + raise ValueError(f"Value {str(obj)} is not a list, but a list was expected (decoded type: {type(obj)})") + + if len(obj) < min_size or len(obj) > max_size: + raise ValueError( + f"Value {str(obj)} is a list of size {len(obj)}, but expected a list with size in range [{min_size}, {max_size}]") + + for val_idx, val in enumerate(obj): + if not isinstance(val, int) and not isinstance(val, chip.tlv.uint): + raise ValueError( + f"At index {val_idx} in {str(obj)}, value {val} is not an int/uint, but an int/uint was expected (decoded type: {type(val)})") + + int_val = int(val) + if not ((int_val >= min_value) and (int_val <= max_value)): + raise ValueError( + f"At index {val_idx} in {str(obj)}, value {int_val} (0x{int_val:X}) not in range [{min_value}, {max_value}] ([0x{min_value:X}, 0x{max_value:X}])") + + return list_of_ints_in_range_checker + + +def check_non_empty_list_of_ints_in_range(min_value: int, max_value: int, max_size: int = 65535, allow_null: bool = False) -> Callable: + """Returns a checker for whether `obj` is a non-empty list of ints that fit in a range.""" + return check_list_of_ints_in_range(min_value, max_value, min_size=1, max_size=max_size, allow_null=allow_null) + + +class TC_DeviceBasicComposition(MatterBaseTest): + @async_test_body + async def setup_class(self): + super().setup_class() + dev_ctrl = self.default_controller + self.problems = [] + + # TODO: Handle already commissioned devices and add argument to specify "let's do PASE" + do_test_over_pase = self.user_params.get("use_pase_only", True) + dump_device_composition_path: Optional[str] = self.user_params.get("dump_device_composition_path", None) + + if do_test_over_pase: + if self.matter_test_config.qr_code_content is not None: + qr_code = self.matter_test_config.qr_code_content + try: + setup_payload = SetupPayload().ParseQrCode(qr_code) + except ChipStackError: + asserts.fail(f"QR code '{qr_code} failed to parse properly as a Matter setup code.") + + elif self.matter_test_config.manual_code is not None: + manual_code = self.matter_test_config.manual_code + try: + setup_payload = SetupPayload().ParseManualPairingCode(manual_code) + except ChipStackError: + asserts.fail( + f"Manual code code '{manual_code}' failed to parse properly as a Matter setup code. Check that all digits are correct and length is 11 or 21 characters.") + else: + asserts.fail("Require either --qr-code or --manual-code to proceed with PASE needed for test.") + + if setup_payload.short_discriminator is not None: + filter_type = discovery.FilterType.SHORT_DISCRIMINATOR + filter_value = setup_payload.short_discriminator + else: + filter_type = discovery.FilterType.LONG_DISCRIMINATOR + filter_value = setup_payload.long_discriminator + + commissionable_nodes = dev_ctrl.DiscoverCommissionableNodes( + filter_type, filter_value, stopOnFirst=True, timeoutSecond=15) + logging.info(f"Commissionable nodes: {commissionable_nodes}") + # TODO: Support BLE + if commissionable_nodes is not None and len(commissionable_nodes) > 0: + commissionable_node = commissionable_nodes[0] + instance_name = f"{commissionable_node.instanceName}._matterc._udp.local" + vid = f"{commissionable_node.vendorId}" + pid = f"{commissionable_node.productId}" + address = f"{commissionable_node.addresses[0]}" + logging.info(f"Found instance {instance_name}, VID={vid}, PID={pid}, Address={address}") + + node_id = 1 + dev_ctrl.EstablishPASESessionIP(address, setup_payload.setup_passcode, node_id) + else: + asserts.fail("Failed to find the DUT according to command line arguments.") + else: + asserts.fail("TODO: Support testing on already commissioned devices") + + wildcard_read = (await dev_ctrl.Read(node_id, [()])) + endpoints_tlv = wildcard_read.tlvAttributes + + node_dump_dict = {endpoint_id: MatterTlvToJson(endpoints_tlv[endpoint_id]) for endpoint_id in endpoints_tlv} + logging.info(f"Raw TLV contents of Node: {json.dumps(node_dump_dict, indent=2)}") + + if dump_device_composition_path is not None: + with open(pathlib.Path(dump_device_composition_path).with_suffix(".json"), "wt+") as outfile: + json.dump(node_dump_dict, outfile, indent=2) + with open(pathlib.Path(dump_device_composition_path).with_suffix(".txt"), "wt+") as outfile: + pprint(wildcard_read.attributes, outfile, indent=1, width=200, compact=True) + + logging.info("###########################################################") + logging.info("Start of actual tests") + logging.info("###########################################################") + + # ======= State kept for use by all tests ======= + + # All endpoints in "full object" indexing format + self.endpoints = wildcard_read.attributes + + # All endpoints in raw TLV format + self.endpoints_tlv = wildcard_read.tlvAttributes + + def get_test_name(self) -> str: + """Return the function name of the caller. Used to create logging entries.""" + return sys._getframe().f_back.f_code.co_name + + def fail_current_test(self, msg: Optional[str] = None): + if not msg: + # Without a message, just log the last problem seen + asserts.fail(msg=self.problems[-1].problem) + else: + asserts.fail(msg) + + # ======= START OF ACTUAL TESTS ======= + def test_endpoint_zero_present(self): + logging.info("Validating that the Root Node endpoint is present (EP0)") + if 0 not in self.endpoints: + self.record_error(self.get_test_name(), location=AttributePathLocation(endpoint_id=0), + problem="Did not find Endpoint 0.", spec_location="Endpoint Composition") + self.fail_current_test() + + def test_descriptor_present_on_each_endpoint(self): + logging.info("Validating each endpoint has a descriptor cluster") + + success = True + for endpoint_id, endpoint in self.endpoints.items(): + has_descriptor = (Clusters.Descriptor in endpoint) + logging.info(f"Checking descriptor on Endpoint {endpoint_id}: {'found' if has_descriptor else 'not_found'}") + if not has_descriptor: + self.record_error(self.get_test_name(), location=AttributePathLocation(endpoint_id=endpoint_id, cluster_id=Clusters.Descriptor.id), + problem=f"Did not find a descriptor on endpoint {endpoint_id}", spec_location="Base Cluster Requirements for Matter") + success = False + + if not success: + self.fail_current_test("At least one endpoint was missing the descriptor cluster.") + + def test_global_attributes_present_on_each_cluster(self): + logging.info("Validating each cluster has the mandatory global attributes") + + @dataclass + class RequiredMandatoryAttribute: + id: int + name: str + validator: Callable + + ATTRIBUTE_LIST_ID = 0xFFFB + + ATTRIBUTES_TO_CHECK = [ + RequiredMandatoryAttribute(id=0xFFFD, name="ClusterRevision", validator=check_int_in_range(1, 0xFFFF)), + RequiredMandatoryAttribute(id=0xFFFC, name="FeatureMap", validator=check_int_in_range(0, 0xFFFF_FFFF)), + RequiredMandatoryAttribute(id=0xFFFB, name="AttributeList", + validator=check_non_empty_list_of_ints_in_range(0, 0xFFFF_FFFF)), + # TODO: Check for EventList + # RequiredMandatoryAttribute(id=0xFFFA, name="EventList", validator=check_list_of_ints_in_range(0, 0xFFFF_FFFF)), + RequiredMandatoryAttribute(id=0xFFF9, name="AcceptedCommandList", + validator=check_list_of_ints_in_range(0, 0xFFFF_FFFF)), + RequiredMandatoryAttribute(id=0xFFF8, name="GeneratedCommandList", + validator=check_list_of_ints_in_range(0, 0xFFFF_FFFF)), + ] + + success = True + for endpoint_id, endpoint in self.endpoints_tlv.items(): + for cluster_id, cluster in endpoint.items(): + for req_attribute in ATTRIBUTES_TO_CHECK: + attribute_string = self.cluster_mapper.get_attribute_string(cluster_id, req_attribute.id) + + has_attribute = (req_attribute.id in cluster) + location = AttributePathLocation(endpoint_id, cluster_id, req_attribute.id) + logging.info( + f"Checking for mandatory global {attribute_string} on {location.as_cluster_string(self.cluster_mapper)}: {'found' if has_attribute else 'not_found'}") + + # Check attribute is actually present + if not has_attribute: + self.record_error(self.get_test_name(), location=location, + problem=f"Did not find mandatory global {attribute_string} on {location.as_cluster_string(self.cluster_mapper)}", spec_location="Global Elements") + success = False + continue + + # Validate attribute value based on the provided validator. + try: + req_attribute.validator(cluster[req_attribute.id]) + except ValueError as e: + self.record_error(self.get_test_name(), location=location, + problem=f"Failed validation of value on {location.as_string(self.cluster_mapper)}: {str(e)}", spec_location="Global Elements") + success = False + continue + + # Validate presence of claimed attributes + if success: + # TODO: Also check the reverse: that each attribute appears in the AttributeList. + logging.info( + "Validating that a wildcard read on each cluster provided all attributes claimed in AttributeList mandatory global attribute") + + for endpoint_id, endpoint in self.endpoints_tlv.items(): + for cluster_id, cluster in endpoint.items(): + attribute_list = cluster[ATTRIBUTE_LIST_ID] + for attribute_id in attribute_list: + location = AttributePathLocation(endpoint_id, cluster_id, attribute_id) + has_attribute = attribute_id in cluster + + attribute_string = self.cluster_mapper.get_attribute_string(cluster_id, attribute_id) + logging.info( + f"Checking presence of claimed supported {attribute_string} on {location.as_cluster_string(self.cluster_mapper)}: {'found' if has_attribute else 'not_found'}") + + # Check attribute is actually present. + if not has_attribute: + # TODO: Handle detecting write-only attributes from schema. + if "WriteOnly" in attribute_string: + continue + + self.record_error(self.get_test_name(), location=location, + problem=f"Did not find {attribute_string} on {location.as_cluster_string(self.cluster_mapper)} when it was claimed in AttributeList ({attribute_list})", spec_location="AttributeList Attribute") + success = False + continue + + attribute_value = cluster[attribute_id] + if isinstance(attribute_value, ValueDecodeFailure): + self.record_warning(self.get_test_name(), location=location, + problem=f"Found a failure to read/decode {attribute_string} on {location.as_cluster_string(self.cluster_mapper)} when it was claimed as supported in AttributeList ({attribute_list}): {str(attribute_value)}", spec_location="AttributeList Attribute") + # Warn only for now + # TODO: Fail in the future + continue + + if not success: + self.fail_current_test( + "At least one cluster was missing a mandatory global attribute or had differences between claimed attributes supported and actual.") + + def test_all_attribute_strings_valid(self): + asserts.skip("TODO: Validate every string in the attribute tree is valid UTF-8 and has no nulls") + + def test_all_event_strings_valid(self): + asserts.skip("TODO: Validate every string in the read events is valid UTF-8 and has no nulls") + + def test_all_schema_scalars(self): + asserts.skip("TODO: Validate all int/uint are in range of the schema (or null if nullable) for known attributes") + + def test_all_commands_reported_are_executable(self): + asserts.skip("TODO: Validate all commands reported in AcceptedCommandList are actually executable") + + def test_dump_all_pics_for_all_endpoints(self): + asserts.skip("TODO: Make a test that generates the basic PICS list for each endpoint based on actually reported contents") + + def test_all_schema_mandatory_elements_present(self): + asserts.skip( + "TODO: Make a test that ensures every known cluster has the mandatory elements present (commands, attributes) based on features") + + def test_all_endpoints_have_valid_composition(self): + asserts.skip( + "TODO: Make a test that verifies each endpoint has valid set of device types, and that the device type conformance is respected for each") + + def test_topology_is_valid(self): + asserts.skip("TODO: Make a test that verifies each endpoint only lists direct descendants, except Root Node and Aggregator endpoints that list all their descendants") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/matter_testing_support.py b/src/python_testing/matter_testing_support.py index 4c1e24e8eb8a21..b9a9add64bc46e 100644 --- a/src/python_testing/matter_testing_support.py +++ b/src/python_testing/matter_testing_support.py @@ -30,7 +30,8 @@ from dataclasses import asdict as dataclass_asdict from dataclasses import dataclass, field from datetime import datetime, timedelta, timezone -from typing import List, Optional, Tuple +from enum import Enum +from typing import List, Optional, Tuple, Union from chip.tlv import float32, uint @@ -239,6 +240,87 @@ class MatterTestConfig: chip_tool_credentials_path: Optional[pathlib.Path] = None +class ClusterMapper: + """Describe clusters/attributes using schema names.""" + + def __init__(self, legacy_cluster_mapping) -> None: + self._mapping = legacy_cluster_mapping + + def get_cluster_string(self, cluster_id: int) -> str: + mapping = self._mapping._CLUSTER_ID_DICT.get(cluster_id, None) + if not mapping: + return f"Cluster Unknown ({cluster_id}, 0x{cluster_id:08X})" + else: + name = mapping["clusterName"] + return f"Cluster {name} ({cluster_id}, 0x{cluster_id:04X})" + + def get_attribute_string(self, cluster_id: int, attribute_id) -> str: + mapping = self._mapping._CLUSTER_ID_DICT.get(cluster_id, None) + if not mapping: + return f"Attribute Unknown ({attribute_id}, 0x{attribute_id:08X})" + else: + attribute_mapping = mapping["attributes"].get(attribute_id, None) + + if not attribute_mapping: + return f"Attribute Unknown ({attribute_id}, 0x{attribute_id:08X})" + else: + attribute_name = attribute_mapping["attributeName"] + return f"Attribute {attribute_name} ({attribute_id}, 0x{attribute_id:04X})" + + +@dataclass +class AttributePathLocation: + endpoint_id: int + cluster_id: Optional[int] = None + attribute_id: Optional[int] = None + + def as_cluster_string(self, mapper: ClusterMapper): + desc = f"Endpoint {self.endpoint_id}" + if self.cluster_id is not None: + desc += f", {mapper.get_cluster_string(self.cluster_id)}" + return desc + + def as_string(self, mapper: ClusterMapper): + desc = self.as_cluster_string(mapper) + if self.cluster_id is not None and self.attribute_id is not None: + desc += f", {mapper.get_attribute_string(self.cluster_id, self.attribute_id)}" + + return desc + + +@dataclass +class EventPathLocation: + endpoint_id: int + cluster_id: int + event_id: int + + +@dataclass +class CommandPathLocation: + endpoint_id: int + cluster_id: int + command_id: int + +# ProblemSeverity is not using StrEnum, but rather Enum, since StrEnum only +# appeared in 3.11. To make it JSON serializable easily, multiple inheritance +# from `str` is used. See https://stackoverflow.com/a/51976841. + + +class ProblemSeverity(str, Enum): + NOTE = "NOTE" + WARNING = "WARNING" + ERROR = "ERROR" + + +@dataclass +class ProblemNotice: + test_name: str + location: Union[AttributePathLocation, EventPathLocation, CommandPathLocation] + severity: ProblemSeverity + problem: str + spec_location: str = "" + + class MatterStackState: def __init__(self, config: MatterTestConfig): self._logger = logger @@ -325,6 +407,9 @@ class MatterBaseTest(base_test.BaseTestClass): def __init__(self, *args): super().__init__(*args) + # List of accumulated problems across all tests + self.problems = [] + @property def matter_test_config(self) -> MatterTestConfig: return unstash_globally(self.user_params.get("matter_test_config")) @@ -345,6 +430,27 @@ def certificate_authority_manager(self) -> chip.CertificateAuthority.Certificate def dut_node_id(self) -> int: return self.matter_test_config.dut_node_ids[0] + def setup_class(self): + super().setup_class() + + # Mappings of cluster IDs to names and metadata. + # TODO: Move to using non-generated code and rather use data model description (.matter or .xml) + self.cluster_mapper = ClusterMapper(self.default_controller._Cluster) + + def teardown_class(self): + """Final teardown after all tests: log all problems""" + if len(self.problems) == 0: + return + + logging.info("###########################################################") + logging.info("Problems found:") + logging.info("===============") + for problem in self.problems: + logging.info(f"- {json.dumps(dataclass_asdict(problem))}") + logging.info("###########################################################") + + super().teardown_class() + def check_pics(self, pics_key: str) -> bool: picsd = self.matter_test_config.pics pics_key = pics_key.strip().upper() @@ -406,6 +512,15 @@ async def send_single_cmd( def print_step(self, stepnum: int, title: str) -> None: logging.info('***** Test Step %d : %s', stepnum, title) + def record_error(self, test_name: str, location: Union[AttributePathLocation, EventPathLocation, CommandPathLocation], problem: str, spec_location: str = ""): + self.problems.append(ProblemNotice(test_name, location, ProblemSeverity.ERROR, problem, spec_location)) + + def record_warning(self, test_name: str, location: Union[AttributePathLocation, EventPathLocation, CommandPathLocation], problem: str, spec_location: str = ""): + self.problems.append(ProblemNotice(test_name, location, ProblemSeverity.WARNING, problem, spec_location)) + + def record_note(self, test_name: str, location: Union[AttributePathLocation, EventPathLocation, CommandPathLocation], problem: str, spec_location: str = ""): + self.problems.append(ProblemNotice(test_name, location, ProblemSeverity.NOTE, problem, spec_location)) + def generate_mobly_test_config(matter_test_config: MatterTestConfig): test_run_config = TestRunConfig() diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index e3c424fee20dc0..1aba11a75764db 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -389,7 +389,6 @@ CHIP_ERROR SessionManager::SendPreparedMessage(const SessionHandle & sessionHand destination = &(multicastAddress.SetInterface(interfaceId)); if (mTransportMgr != nullptr) { - CHIP_TRACE_PREPARED_MESSAGE_SENT(destination, &tempBuf); if (CHIP_NO_ERROR != mTransportMgr->SendMessage(*destination, std::move(tempBuf))) { ChipLogError(Inet, "Failed to send Multicast message on interface %s", name); @@ -418,7 +417,6 @@ CHIP_ERROR SessionManager::SendPreparedMessage(const SessionHandle & sessionHand if (mTransportMgr != nullptr) { - CHIP_TRACE_PREPARED_MESSAGE_SENT(destination, &msgBuf); return mTransportMgr->SendMessage(*destination, std::move(msgBuf)); } @@ -543,7 +541,6 @@ CHIP_ERROR SessionManager::InjectCaseSessionWithTestKey(SessionHolder & sessionH void SessionManager::OnMessageReceived(const PeerAddress & peerAddress, System::PacketBufferHandle && msg) { - CHIP_TRACE_PREPARED_MESSAGE_RECEIVED(&peerAddress, &msg); PacketHeader partialPacketHeader; CHIP_ERROR err = partialPacketHeader.DecodeFixed(msg); diff --git a/src/transport/TraceMessage.h b/src/transport/TraceMessage.h index f7d23697296091..b8c5f87f7c8c1a 100644 --- a/src/transport/TraceMessage.h +++ b/src/transport/TraceMessage.h @@ -57,22 +57,6 @@ sizeof(_trace_data)); \ } while (0) -#define CHIP_TRACE_PREPARED_MESSAGE_SENT(destination, packetBuffer) \ - do \ - { \ - const ::chip::trace::TracePreparedSecureMessageData _trace_data{ destination, packetBuffer }; \ - _CHIP_TRACE_MESSAGE_INTERNAL(::chip::trace::kTracePreparedMessageSentDataFormat, \ - reinterpret_cast(&_trace_data), sizeof(_trace_data)); \ - } while (0) - -#define CHIP_TRACE_PREPARED_MESSAGE_RECEIVED(source, packetBuffer) \ - do \ - { \ - const ::chip::trace::TracePreparedSecureMessageData _trace_data{ source, packetBuffer }; \ - _CHIP_TRACE_MESSAGE_INTERNAL(::chip::trace::kTracePreparedMessageReceivedDataFormat, \ - reinterpret_cast(&_trace_data), sizeof(_trace_data)); \ - } while (0) - #else // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED || CHIP_CONFIG_TRANSPORT_PW_TRACE_ENABLED #define CHIP_TRACE_MESSAGE_SENT(payloadHeader, packetHeader, data, dataLen) \ do \ @@ -84,25 +68,14 @@ { \ } while (0) -#define CHIP_TRACE_PREPARED_MESSAGE_SENT(destination, packetBuffer) \ - do \ - { \ - } while (0) - -#define CHIP_TRACE_PREPARED_MESSAGE_RECEIVED(source, packetBuffer) \ - do \ - { \ - } while (0) #endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED || CHIP_CONFIG_TRANSPORT_PW_TRACE_ENABLED namespace chip { namespace trace { -constexpr const char * kTraceMessageEvent = "SecureMsg"; -constexpr const char * kTraceMessageSentDataFormat = "SecMsgSent"; -constexpr const char * kTraceMessageReceivedDataFormat = "SecMsgReceived"; -constexpr const char * kTracePreparedMessageSentDataFormat = "PreparedMsgSent"; -constexpr const char * kTracePreparedMessageReceivedDataFormat = "PreparedMsgReceived"; +constexpr const char * kTraceMessageEvent = "SecureMsg"; +constexpr const char * kTraceMessageSentDataFormat = "SecMsgSent"; +constexpr const char * kTraceMessageReceivedDataFormat = "SecMsgReceived"; struct TraceSecureMessageSentData { @@ -122,12 +95,6 @@ struct TraceSecureMessageReceivedData size_t packetSize; }; -struct TracePreparedSecureMessageData -{ - const Transport::PeerAddress * peerAddress; - const System::PacketBufferHandle * packetBuffer; -}; - #if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED typedef void (*TransportTraceHandler)(const char * type, const void * data, size_t size); diff --git a/third_party/silabs/slc_gen/run_slc.py b/third_party/silabs/slc_gen/run_slc.py index 5083948e3e7eb1..87a481ea3c9a80 100644 --- a/third_party/silabs/slc_gen/run_slc.py +++ b/third_party/silabs/slc_gen/run_slc.py @@ -4,7 +4,7 @@ import subprocess import sys -if len(sys.argv) != 7: +if len(sys.argv) != 8: print("wrong number of arguments") sys.exit(1) @@ -13,12 +13,20 @@ def asBoolean(valueToTest): return ("true" == valueToTest) +def isMG24(partnumber): + if "EFR32MG24" in partnumber or "MGM240" in partnumber: + return True + else: + return False + + root_path = sys.argv[1] silabs_board = str(sys.argv[2]).lower() disable_lcd = asBoolean(sys.argv[3]) use_wstk_buttons = asBoolean(sys.argv[4]) use_wstk_leds = asBoolean(sys.argv[5]) use_external_flash = asBoolean(sys.argv[6]) +silabs_mcu = str(sys.argv[7]) slcp_file_path = os.path.join(root_path, "examples/platform/silabs/matter-platform.slcp") template_path = os.path.join(root_path, "third_party/silabs/slc_gen/") @@ -26,6 +34,12 @@ def asBoolean(valueToTest): slc_arguments = "" +# Add Familly specific component +if isMG24(silabs_mcu): + slc_arguments += "uartdrv_eusart:vcom," +else: + slc_arguments += "uartdrv_usart:vcom," + # Translate GN arguments in SLC arguments if not disable_lcd: slc_arguments += "memlcd_usart,dmd_memlcd," 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 7d95541b504db2..ef50827f38f950 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 @@ -7234,40 +7234,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Attributes { -namespace Description { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) -{ - uint8_t zclString[64 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 64); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) -{ - static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[64 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) @@ -7275,7 +7244,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7294,7 +7263,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentMode @@ -7306,7 +7275,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -7328,7 +7297,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -7337,7 +7306,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -7359,7 +7328,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -7381,7 +7350,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -7390,7 +7359,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -7412,7 +7381,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7431,7 +7400,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -7443,7 +7412,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7462,59 +7431,26 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace LaundryWasherModeSelect +} // namespace LaundryWasherMode -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Attributes { -namespace Description { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) -{ - uint8_t zclString[64 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 64); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) -{ - static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[64 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, zclString, - ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7533,7 +7469,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7545,9 +7481,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -7569,7 +7505,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7579,7 +7515,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7601,9 +7537,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -7625,7 +7561,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7635,7 +7571,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7657,9 +7593,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7678,7 +7614,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -7690,9 +7626,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7711,14 +7647,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { namespace Attributes { @@ -7925,40 +7861,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Attributes { -namespace Description { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) -{ - uint8_t zclString[64 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 64); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) -{ - static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[64 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) @@ -7966,7 +7871,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7985,7 +7890,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentMode @@ -7997,7 +7902,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8019,7 +7924,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8028,7 +7933,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8050,7 +7955,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8072,7 +7977,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8081,7 +7986,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8103,7 +8008,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8122,7 +8027,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -8134,7 +8039,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8153,48 +8058,17 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcRunModeSelect +} // namespace RvcRunMode -namespace RvcCleanModeSelect { +namespace RvcCleanMode { namespace Attributes { -namespace Description { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) -{ - uint8_t zclString[64 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 64); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) -{ - static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[64 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) @@ -8202,7 +8076,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8221,7 +8095,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentMode @@ -8233,7 +8107,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8255,7 +8129,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8264,7 +8138,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8286,7 +8160,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8308,7 +8182,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8317,7 +8191,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8339,7 +8213,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8358,7 +8232,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -8370,7 +8244,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8389,13 +8263,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Attributes { @@ -8750,40 +8624,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Attributes { -namespace Description { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) -{ - uint8_t zclString[64 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 64); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) -{ - static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[64 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) @@ -8791,7 +8634,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8810,7 +8653,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentMode @@ -8822,7 +8665,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8844,7 +8687,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8853,7 +8696,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8875,7 +8718,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8897,7 +8740,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8906,7 +8749,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8928,7 +8771,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8947,7 +8790,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -8959,7 +8802,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8978,13 +8821,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { namespace Attributes { @@ -9699,6 +9542,180 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace OperationalState +namespace RvcOperationalState { +namespace Attributes { + +namespace CurrentPhase { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace CurrentPhase + +namespace CountdownTime { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace CountdownTime + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RvcOperationalState + namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 43bbc64c943f50..dd71aa3fea6314 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 @@ -1382,14 +1382,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Attributes { -namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); @@ -1420,16 +1415,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace LaundryWasherModeSelect +} // namespace LaundryWasherMode -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Attributes { -namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); @@ -1460,7 +1450,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { namespace Attributes { @@ -1497,14 +1487,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Attributes { -namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); @@ -1535,16 +1520,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcRunModeSelect +} // namespace RvcRunMode -namespace RvcCleanModeSelect { +namespace RvcCleanMode { namespace Attributes { -namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); @@ -1575,7 +1555,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Attributes { @@ -1644,14 +1624,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Attributes { -namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); @@ -1682,7 +1657,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { namespace Attributes { @@ -1812,6 +1787,36 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace OperationalState +namespace RvcOperationalState { +namespace Attributes { + +namespace CurrentPhase { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace CurrentPhase + +namespace CountdownTime { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // elapsed_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace CountdownTime + +namespace FeatureMap { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace FeatureMap + +namespace ClusterRevision { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RvcOperationalState + namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 5df828f260f298..8a1dc67b15eeef 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -369,21 +369,21 @@ void emberAfIcdManagementClusterInitCallback(chip::EndpointId endpoint); */ void emberAfModeSelectClusterInitCallback(chip::EndpointId endpoint); -/** @brief Laundry Washer Mode Select Cluster Init +/** @brief Laundry Washer Mode Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfLaundryWasherModeSelectClusterInitCallback(chip::EndpointId endpoint); +void emberAfLaundryWasherModeClusterInitCallback(chip::EndpointId endpoint); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Init +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterInitCallback(chip::EndpointId endpoint); +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterInitCallback(chip::EndpointId endpoint); /** @brief Washer Controls Cluster Init * @@ -393,21 +393,21 @@ void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterInitCall */ void emberAfWasherControlsClusterInitCallback(chip::EndpointId endpoint); -/** @brief RVC Run Mode Select Cluster Init +/** @brief RVC Run Mode Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcRunModeSelectClusterInitCallback(chip::EndpointId endpoint); +void emberAfRvcRunModeClusterInitCallback(chip::EndpointId endpoint); -/** @brief RVC Clean Mode Select Cluster Init +/** @brief RVC Clean Mode Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcCleanModeSelectClusterInitCallback(chip::EndpointId endpoint); +void emberAfRvcCleanModeClusterInitCallback(chip::EndpointId endpoint); /** @brief Temperature Control Cluster Init * @@ -425,13 +425,13 @@ void emberAfTemperatureControlClusterInitCallback(chip::EndpointId endpoint); */ void emberAfRefrigeratorAlarmClusterInitCallback(chip::EndpointId endpoint); -/** @brief Dishwasher Mode Select Cluster Init +/** @brief Dishwasher Mode Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfDishwasherModeSelectClusterInitCallback(chip::EndpointId endpoint); +void emberAfDishwasherModeClusterInitCallback(chip::EndpointId endpoint); /** @brief Air Quality Cluster Init * @@ -457,6 +457,14 @@ void emberAfSmokeCoAlarmClusterInitCallback(chip::EndpointId endpoint); */ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpoint); +/** @brief RVC Operational State Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRvcOperationalStateClusterInitCallback(chip::EndpointId endpoint); + /** @brief HEPA Filter Monitoring Cluster Init * * Cluster Init @@ -4321,42 +4329,42 @@ void emberAfModeSelectClusterServerTickCallback(chip::EndpointId endpoint); void emberAfModeSelectClusterClientTickCallback(chip::EndpointId endpoint); // -// Laundry Washer Mode Select Cluster +// Laundry Washer Mode Cluster // -/** @brief Laundry Washer Mode Select Cluster Server Init +/** @brief Laundry Washer Mode Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfLaundryWasherModeSelectClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfLaundryWasherModeClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Laundry Washer Mode Select Cluster Server Shutdown +/** @brief Laundry Washer Mode Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterLaundryWasherModeSelectClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterLaundryWasherModeClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief Laundry Washer Mode Select Cluster Client Init +/** @brief Laundry Washer Mode Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfLaundryWasherModeSelectClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfLaundryWasherModeClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief Laundry Washer Mode Select Cluster Server Attribute Changed +/** @brief Laundry Washer Mode Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterLaundryWasherModeSelectClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); +void MatterLaundryWasherModeClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief Laundry Washer Mode Select Cluster Server Pre Attribute Changed +/** @brief Laundry Washer Mode Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -4365,10 +4373,11 @@ void MatterLaundryWasherModeSelectClusterServerAttributeChangedCallback(const ch * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterLaundryWasherModeSelectClusterServerPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterLaundryWasherModeClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Laundry Washer Mode Select Cluster Client Pre Attribute Changed +/** @brief Laundry Washer Mode Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -4377,63 +4386,64 @@ chip::Protocols::InteractionModel::Status MatterLaundryWasherModeSelectClusterSe * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterLaundryWasherModeSelectClusterClientPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterLaundryWasherModeClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Laundry Washer Mode Select Cluster Server Tick +/** @brief Laundry Washer Mode Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfLaundryWasherModeSelectClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfLaundryWasherModeClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief Laundry Washer Mode Select Cluster Client Tick +/** @brief Laundry Washer Mode Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfLaundryWasherModeSelectClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfLaundryWasherModeClusterClientTickCallback(chip::EndpointId endpoint); // -// Refrigerator And Temperature Controlled Cabinet Mode Select Cluster +// Refrigerator And Temperature Controlled Cabinet Mode Cluster // -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Server Init +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Server Shutdown +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterRefrigeratorAndTemperatureControlledCabinetModeClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Client Init +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Server Attribute Changed +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerAttributeChangedCallback( +void MatterRefrigeratorAndTemperatureControlledCabinetModeClusterServerAttributeChangedCallback( const chip::app::ConcreteAttributePath & attributePath); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Server Pre Attribute Changed +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -4443,10 +4453,10 @@ void MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerAtt * @param value Attribute value */ chip::Protocols::InteractionModel::Status -MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerPreAttributeChangedCallback( +MatterRefrigeratorAndTemperatureControlledCabinetModeClusterServerPreAttributeChangedCallback( const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Client Pre Attribute Changed +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -4456,24 +4466,24 @@ MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerPreAttri * @param value Attribute value */ chip::Protocols::InteractionModel::Status -MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterClientPreAttributeChangedCallback( +MatterRefrigeratorAndTemperatureControlledCabinetModeClusterClientPreAttributeChangedCallback( const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Server Tick +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Client Tick +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterClientTickCallback(chip::EndpointId endpoint); // // Washer Controls Cluster @@ -4554,42 +4564,42 @@ void emberAfWasherControlsClusterServerTickCallback(chip::EndpointId endpoint); void emberAfWasherControlsClusterClientTickCallback(chip::EndpointId endpoint); // -// RVC Run Mode Select Cluster +// RVC Run Mode Cluster // -/** @brief RVC Run Mode Select Cluster Server Init +/** @brief RVC Run Mode Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcRunModeSelectClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfRvcRunModeClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief RVC Run Mode Select Cluster Server Shutdown +/** @brief RVC Run Mode Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterRvcRunModeSelectClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterRvcRunModeClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief RVC Run Mode Select Cluster Client Init +/** @brief RVC Run Mode Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcRunModeSelectClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfRvcRunModeClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief RVC Run Mode Select Cluster Server Attribute Changed +/** @brief RVC Run Mode Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterRvcRunModeSelectClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); +void MatterRvcRunModeClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief RVC Run Mode Select Cluster Server Pre Attribute Changed +/** @brief RVC Run Mode Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -4599,10 +4609,10 @@ void MatterRvcRunModeSelectClusterServerAttributeChangedCallback(const chip::app * @param value Attribute value */ chip::Protocols::InteractionModel::Status -MatterRvcRunModeSelectClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +MatterRvcRunModeClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief RVC Run Mode Select Cluster Client Pre Attribute Changed +/** @brief RVC Run Mode Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -4612,62 +4622,62 @@ MatterRvcRunModeSelectClusterServerPreAttributeChangedCallback(const chip::app:: * @param value Attribute value */ chip::Protocols::InteractionModel::Status -MatterRvcRunModeSelectClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +MatterRvcRunModeClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief RVC Run Mode Select Cluster Server Tick +/** @brief RVC Run Mode Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfRvcRunModeSelectClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfRvcRunModeClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief RVC Run Mode Select Cluster Client Tick +/** @brief RVC Run Mode Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfRvcRunModeSelectClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfRvcRunModeClusterClientTickCallback(chip::EndpointId endpoint); // -// RVC Clean Mode Select Cluster +// RVC Clean Mode Cluster // -/** @brief RVC Clean Mode Select Cluster Server Init +/** @brief RVC Clean Mode Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcCleanModeSelectClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfRvcCleanModeClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief RVC Clean Mode Select Cluster Server Shutdown +/** @brief RVC Clean Mode Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterRvcCleanModeSelectClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterRvcCleanModeClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief RVC Clean Mode Select Cluster Client Init +/** @brief RVC Clean Mode Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcCleanModeSelectClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfRvcCleanModeClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief RVC Clean Mode Select Cluster Server Attribute Changed +/** @brief RVC Clean Mode Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterRvcCleanModeSelectClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); +void MatterRvcCleanModeClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief RVC Clean Mode Select Cluster Server Pre Attribute Changed +/** @brief RVC Clean Mode Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -4676,10 +4686,11 @@ void MatterRvcCleanModeSelectClusterServerAttributeChangedCallback(const chip::a * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterRvcCleanModeSelectClusterServerPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterRvcCleanModeClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief RVC Clean Mode Select Cluster Client Pre Attribute Changed +/** @brief RVC Clean Mode Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -4688,24 +4699,25 @@ chip::Protocols::InteractionModel::Status MatterRvcCleanModeSelectClusterServerP * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterRvcCleanModeSelectClusterClientPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterRvcCleanModeClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief RVC Clean Mode Select Cluster Server Tick +/** @brief RVC Clean Mode Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfRvcCleanModeSelectClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfRvcCleanModeClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief RVC Clean Mode Select Cluster Client Tick +/** @brief RVC Clean Mode Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfRvcCleanModeSelectClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfRvcCleanModeClusterClientTickCallback(chip::EndpointId endpoint); // // Temperature Control Cluster @@ -4862,42 +4874,42 @@ void emberAfRefrigeratorAlarmClusterServerTickCallback(chip::EndpointId endpoint void emberAfRefrigeratorAlarmClusterClientTickCallback(chip::EndpointId endpoint); // -// Dishwasher Mode Select Cluster +// Dishwasher Mode Cluster // -/** @brief Dishwasher Mode Select Cluster Server Init +/** @brief Dishwasher Mode Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfDishwasherModeSelectClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfDishwasherModeClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Dishwasher Mode Select Cluster Server Shutdown +/** @brief Dishwasher Mode Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterDishwasherModeSelectClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterDishwasherModeClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief Dishwasher Mode Select Cluster Client Init +/** @brief Dishwasher Mode Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfDishwasherModeSelectClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfDishwasherModeClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief Dishwasher Mode Select Cluster Server Attribute Changed +/** @brief Dishwasher Mode Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterDishwasherModeSelectClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); +void MatterDishwasherModeClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief Dishwasher Mode Select Cluster Server Pre Attribute Changed +/** @brief Dishwasher Mode Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -4906,10 +4918,11 @@ void MatterDishwasherModeSelectClusterServerAttributeChangedCallback(const chip: * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterDishwasherModeSelectClusterServerPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterDishwasherModeClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Dishwasher Mode Select Cluster Client Pre Attribute Changed +/** @brief Dishwasher Mode Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -4918,24 +4931,25 @@ chip::Protocols::InteractionModel::Status MatterDishwasherModeSelectClusterServe * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterDishwasherModeSelectClusterClientPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterDishwasherModeClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Dishwasher Mode Select Cluster Server Tick +/** @brief Dishwasher Mode Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfDishwasherModeSelectClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfDishwasherModeClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief Dishwasher Mode Select Cluster Client Tick +/** @brief Dishwasher Mode Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfDishwasherModeSelectClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfDishwasherModeClusterClientTickCallback(chip::EndpointId endpoint); // // Air Quality Cluster @@ -5171,6 +5185,82 @@ void emberAfOperationalStateClusterServerTickCallback(chip::EndpointId endpoint) */ void emberAfOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); +// +// RVC Operational State Cluster +// + +/** @brief RVC Operational State Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRvcOperationalStateClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief RVC Operational State Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterRvcOperationalStateClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief RVC Operational State Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRvcOperationalStateClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief RVC Operational State Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterRvcOperationalStateClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief RVC Operational State Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterRvcOperationalStateClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief RVC Operational State Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterRvcOperationalStateClusterClientPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief RVC Operational State Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfRvcOperationalStateClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief RVC Operational State Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfRvcOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); + // // HEPA Filter Monitoring Cluster // @@ -11627,61 +11717,30 @@ bool emberAfModeSelectClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ModeSelect::Commands::ChangeToMode::DecodableType & commandData); /** - * @brief Mode Select Cluster ChangeToModeWithStatus Command callback (from client) - */ -bool emberAfModeSelectClusterChangeToModeWithStatusCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ModeSelect::Commands::ChangeToModeWithStatus::DecodableType & commandData); -/** - * @brief Laundry Washer Mode Select Cluster ChangeToMode Command callback (from client) - */ -bool emberAfLaundryWasherModeSelectClusterChangeToModeCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToMode::DecodableType & commandData); -/** - * @brief Laundry Washer Mode Select Cluster ChangeToModeWithStatus Command callback (from client) + * @brief Laundry Washer Mode Cluster ChangeToMode Command callback (from client) */ -bool emberAfLaundryWasherModeSelectClusterChangeToModeWithStatusCallback( +bool emberAfLaundryWasherModeClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToModeWithStatus::DecodableType & commandData); + const chip::app::Clusters::LaundryWasherMode::Commands::ChangeToMode::DecodableType & commandData); /** - * @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster ChangeToMode Command callback (from client) + * @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster ChangeToMode Command callback (from client) */ -bool emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeCallback( +bool emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToMode::DecodableType & + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToMode::DecodableType & commandData); /** - * @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster ChangeToModeWithStatus Command callback (from client) - */ -bool emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeWithStatusCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeWithStatus:: - DecodableType & commandData); -/** - * @brief RVC Run Mode Select Cluster ChangeToMode Command callback (from client) + * @brief RVC Run Mode Cluster ChangeToMode Command callback (from client) */ -bool emberAfRvcRunModeSelectClusterChangeToModeCallback( +bool emberAfRvcRunModeClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToMode::DecodableType & commandData); + const chip::app::Clusters::RvcRunMode::Commands::ChangeToMode::DecodableType & commandData); /** - * @brief RVC Run Mode Select Cluster ChangeToModeWithStatus Command callback (from client) + * @brief RVC Clean Mode Cluster ChangeToMode Command callback (from client) */ -bool emberAfRvcRunModeSelectClusterChangeToModeWithStatusCallback( +bool emberAfRvcCleanModeClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToModeWithStatus::DecodableType & commandData); -/** - * @brief RVC Clean Mode Select Cluster ChangeToMode Command callback (from client) - */ -bool emberAfRvcCleanModeSelectClusterChangeToModeCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToMode::DecodableType & commandData); -/** - * @brief RVC Clean Mode Select Cluster ChangeToModeWithStatus Command callback (from client) - */ -bool emberAfRvcCleanModeSelectClusterChangeToModeWithStatusCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToModeWithStatus::DecodableType & commandData); + const chip::app::Clusters::RvcCleanMode::Commands::ChangeToMode::DecodableType & commandData); /** * @brief Temperature Control Cluster SetTemperature Command callback (from client) */ @@ -11689,17 +11748,11 @@ bool emberAfTemperatureControlClusterSetTemperatureCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::TemperatureControl::Commands::SetTemperature::DecodableType & commandData); /** - * @brief Dishwasher Mode Select Cluster ChangeToMode Command callback (from client) + * @brief Dishwasher Mode Cluster ChangeToMode Command callback (from client) */ -bool emberAfDishwasherModeSelectClusterChangeToModeCallback( +bool emberAfDishwasherModeClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToMode::DecodableType & commandData); -/** - * @brief Dishwasher Mode Select Cluster ChangeToModeWithStatus Command callback (from client) - */ -bool emberAfDishwasherModeSelectClusterChangeToModeWithStatusCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToModeWithStatus::DecodableType & commandData); + const chip::app::Clusters::DishwasherMode::Commands::ChangeToMode::DecodableType & commandData); /** * @brief Smoke CO Alarm Cluster SelfTestRequest Command callback (from client) */ @@ -11730,6 +11783,30 @@ bool emberAfOperationalStateClusterStartCallback( bool emberAfOperationalStateClusterResumeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OperationalState::Commands::Resume::DecodableType & commandData); +/** + * @brief RVC Operational State Cluster Pause Command callback (from client) + */ +bool emberAfRvcOperationalStateClusterPauseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RvcOperationalState::Commands::Pause::DecodableType & commandData); +/** + * @brief RVC Operational State Cluster Stop Command callback (from client) + */ +bool emberAfRvcOperationalStateClusterStopCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RvcOperationalState::Commands::Stop::DecodableType & commandData); +/** + * @brief RVC Operational State Cluster Start Command callback (from client) + */ +bool emberAfRvcOperationalStateClusterStartCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RvcOperationalState::Commands::Start::DecodableType & commandData); +/** + * @brief RVC Operational State Cluster Resume Command callback (from client) + */ +bool emberAfRvcOperationalStateClusterResumeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RvcOperationalState::Commands::Resume::DecodableType & commandData); /** * @brief HEPA Filter Monitoring Cluster ResetCondition Command callback (from client) */ 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 843538b9e1e2a3..4db5f488faf6aa 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 @@ -1237,43 +1237,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(GroupKeyManagement::Gro } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ModeSelect::ModeTag val) +static auto __attribute__((unused)) EnsureKnownEnumValue(LaundryWasherMode::ModeTag val) { - using EnumType = ModeSelect::ModeTag; - switch (val) - { - case EnumType::kAuto: - case EnumType::kQuick: - case EnumType::kQuiet: - case EnumType::kLowNoise: - case EnumType::kLowEnergy: - case EnumType::kVacation: - case EnumType::kMin: - case EnumType::kMax: - case EnumType::kNight: - case EnumType::kDay: - return val; - default: - return static_cast(10); - } -} -static auto __attribute__((unused)) EnsureKnownEnumValue(ModeSelect::StatusCode val) -{ - using EnumType = ModeSelect::StatusCode; - switch (val) - { - case EnumType::kSuccess: - case EnumType::kUnsupportedMode: - case EnumType::kGenericFailure: - return val; - default: - return static_cast(3); - } -} - -static auto __attribute__((unused)) EnsureKnownEnumValue(LaundryWasherModeSelect::ModeTag val) -{ - using EnumType = LaundryWasherModeSelect::ModeTag; + using EnumType = LaundryWasherMode::ModeTag; switch (val) { case EnumType::kNormal: @@ -1286,9 +1252,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(LaundryWasherModeSelect } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RefrigeratorAndTemperatureControlledCabinetModeSelect::ModeTag val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RefrigeratorAndTemperatureControlledCabinetMode::ModeTag val) { - using EnumType = RefrigeratorAndTemperatureControlledCabinetModeSelect::ModeTag; + using EnumType = RefrigeratorAndTemperatureControlledCabinetMode::ModeTag; switch (val) { case EnumType::kRapidCool: @@ -1299,9 +1265,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RefrigeratorAndTemperat } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunModeSelect::ModeTag val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunMode::ModeTag val) { - using EnumType = RvcRunModeSelect::ModeTag; + using EnumType = RvcRunMode::ModeTag; switch (val) { case EnumType::kIdle: @@ -1311,9 +1277,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunModeSelect::ModeT return static_cast(0); } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunModeSelect::StatusCode val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunMode::StatusCode val) { - using EnumType = RvcRunModeSelect::StatusCode; + using EnumType = RvcRunMode::StatusCode; switch (val) { case EnumType::kStuck: @@ -1330,9 +1296,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunModeSelect::Statu } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanModeSelect::ModeTag val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanMode::ModeTag val) { - using EnumType = RvcCleanModeSelect::ModeTag; + using EnumType = RvcCleanMode::ModeTag; switch (val) { case EnumType::kDeepClean: @@ -1343,9 +1309,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanModeSelect::Mod return static_cast(0); } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanModeSelect::StatusCode val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanMode::StatusCode val) { - using EnumType = RvcCleanModeSelect::StatusCode; + using EnumType = RvcCleanMode::StatusCode; switch (val) { case EnumType::kCleaningInProgress: @@ -1355,9 +1321,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanModeSelect::Sta } } -static auto __attribute__((unused)) EnsureKnownEnumValue(DishwasherModeSelect::ModeTag val) +static auto __attribute__((unused)) EnsureKnownEnumValue(DishwasherMode::ModeTag val) { - using EnumType = DishwasherModeSelect::ModeTag; + using EnumType = DishwasherMode::ModeTag; switch (val) { case EnumType::kNormal: @@ -1500,6 +1466,38 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(OperationalState::Opera } } +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcOperationalState::ErrorStateEnum val) +{ + using EnumType = RvcOperationalState::ErrorStateEnum; + switch (val) + { + case EnumType::kFailedToFindChargingDock: + case EnumType::kStuck: + case EnumType::kDustBinMissing: + case EnumType::kDustBinFull: + case EnumType::kWaterTankEmpty: + case EnumType::kWaterTankMissing: + case EnumType::kWaterTankLidOpen: + case EnumType::kMopCleaningPadMissing: + return val; + default: + return static_cast(0); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcOperationalState::OperationalStateEnum val) +{ + using EnumType = RvcOperationalState::OperationalStateEnum; + switch (val) + { + case EnumType::kSeekingCharger: + case EnumType::kCharging: + case EnumType::kDocked: + return val; + default: + return static_cast(0); + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(HepaFilterMonitoring::ChangeIndicationEnum val) { using EnumType = HepaFilterMonitoring::ChangeIndicationEnum; 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 0d755baec83fee..121eaeae62f0ed 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 @@ -1468,48 +1468,14 @@ enum class Feature : uint32_t namespace ModeSelect { -// Enum for ModeTag -enum class ModeTag : uint16_t -{ - kAuto = 0x00, - kQuick = 0x01, - kQuiet = 0x02, - kLowNoise = 0x03, - kLowEnergy = 0x04, - kVacation = 0x05, - kMin = 0x06, - kMax = 0x07, - kNight = 0x08, - kDay = 0x09, - // 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 = 10, -}; - -// Enum for StatusCode -enum class StatusCode : uint8_t -{ - kSuccess = 0x00, - kUnsupportedMode = 0x01, - kGenericFailure = 0x02, - // 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 = 3, -}; - // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { // Enum for ModeTag enum class ModeTag : uint16_t @@ -1528,12 +1494,11 @@ enum class ModeTag : uint16_t // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; -} // namespace LaundryWasherModeSelect +} // namespace LaundryWasherMode -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +namespace RefrigeratorAndTemperatureControlledCabinetMode { // Enum for ModeTag enum class ModeTag : uint16_t @@ -1550,10 +1515,9 @@ enum class ModeTag : uint16_t // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { @@ -1565,7 +1529,7 @@ enum class Feature : uint32_t }; } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { // Enum for ModeTag enum class ModeTag : uint16_t @@ -1600,12 +1564,11 @@ enum class StatusCode : uint8_t // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; -} // namespace RvcRunModeSelect +} // namespace RvcRunMode -namespace RvcCleanModeSelect { +namespace RvcCleanMode { // Enum for ModeTag enum class ModeTag : uint16_t @@ -1634,10 +1597,9 @@ enum class StatusCode : uint8_t // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { @@ -1659,7 +1621,7 @@ enum class AlarmMap : uint32_t }; } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { // Enum for ModeTag enum class ModeTag : uint16_t @@ -1677,10 +1639,9 @@ enum class ModeTag : uint16_t // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { @@ -1835,6 +1796,40 @@ enum class OperationalStateEnum : uint8_t }; } // namespace OperationalState +namespace RvcOperationalState { + +// Enum for ErrorStateEnum +enum class ErrorStateEnum : uint8_t +{ + kFailedToFindChargingDock = 0x40, + kStuck = 0x41, + kDustBinMissing = 0x42, + kDustBinFull = 0x43, + kWaterTankEmpty = 0x44, + kWaterTankMissing = 0x45, + kWaterTankLidOpen = 0x46, + kMopCleaningPadMissing = 0x47, + // 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 = 0, +}; + +// Enum for OperationalStateEnum +enum class OperationalStateEnum : uint8_t +{ + kSeekingCharger = 0x40, + kCharging = 0x41, + kDocked = 0x42, + // 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 = 0, +}; +} // namespace RvcOperationalState + namespace HepaFilterMonitoring { // Enum for ChangeIndicationEnum 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 ffc13c37e3fe2a..d000e28af8987a 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 @@ -33,7 +33,6 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMfgCode), mfgCode)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kValue), value)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kTagName), tagName)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -59,9 +58,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) case to_underlying(Fields::kValue): ReturnErrorOnFailure(DataModel::Decode(reader, value)); break; - case to_underlying(Fields::kTagName): - ReturnErrorOnFailure(DataModel::Decode(reader, tagName)); - break; default: break; } @@ -166,6 +162,54 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } // namespace ApplicationStruct +namespace ErrorStateStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateID), errorStateID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateLabel), errorStateLabel)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateDetails), errorStateDetails)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kErrorStateID): + ReturnErrorOnFailure(DataModel::Decode(reader, errorStateID)); + break; + case to_underlying(Fields::kErrorStateLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, errorStateLabel)); + break; + case to_underlying(Fields::kErrorStateDetails): + ReturnErrorOnFailure(DataModel::Decode(reader, errorStateDetails)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; +} + +} // namespace ErrorStateStruct namespace LabelStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -210,6 +254,50 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } // namespace LabelStruct +namespace OperationalStateStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateID), operationalStateID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateLabel), operationalStateLabel)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kOperationalStateID): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateID)); + break; + case to_underlying(Fields::kOperationalStateLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateLabel)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; +} + +} // namespace OperationalStateStruct } // namespace Structs } // namespace detail @@ -11335,15 +11423,14 @@ namespace Events {} // namespace Events } // namespace IcdManagement namespace ModeSelect { -namespace Structs {} // namespace Structs - -namespace Commands { -namespace ChangeToMode { +namespace Structs { +namespace SemanticTagStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMfgCode), mfgCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kValue), value)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11353,7 +11440,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -11362,8 +11450,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); + case to_underlying(Fields::kMfgCode): + ReturnErrorOnFailure(DataModel::Decode(reader, mfgCode)); + break; + case to_underlying(Fields::kValue): + ReturnErrorOnFailure(DataModel::Decode(reader, value)); break; default: break; @@ -11372,15 +11463,19 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; } -} // namespace ChangeToMode. -namespace ChangeToModeWithStatus { + +} // namespace SemanticTagStruct +namespace ModeOptionStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kLabel), label)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMode), mode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kSemanticTags), semanticTags)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11390,7 +11485,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -11399,8 +11495,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); + case to_underlying(Fields::kLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, label)); + break; + case to_underlying(Fields::kMode): + ReturnErrorOnFailure(DataModel::Decode(reader, mode)); + break; + case to_underlying(Fields::kSemanticTags): + ReturnErrorOnFailure(DataModel::Decode(reader, semanticTags)); break; default: break; @@ -11409,16 +11511,20 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; } -} // namespace ChangeToModeWithStatus. -namespace ChangeToModeResponse { + +} // namespace ModeOptionStruct +} // namespace Structs + +namespace Commands { +namespace ChangeToMode { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kStatus), status)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kStatusText), statusText)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11437,11 +11543,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, status)); - break; - case to_underlying(Fields::kStatusText): - ReturnErrorOnFailure(DataModel::Decode(reader, statusText)); + case to_underlying(Fields::kNewMode): + ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); break; default: break; @@ -11452,7 +11555,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ChangeToModeResponse. +} // namespace ChangeToMode. } // namespace Commands namespace Attributes { @@ -11507,7 +11610,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Structs {} // namespace Structs namespace Commands { @@ -11548,43 +11651,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. -namespace ChangeToModeWithStatus { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ChangeToModeWithStatus. namespace ChangeToModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -11633,9 +11699,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); - break; case Attributes::SupportedModes::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; @@ -11676,8 +11739,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace LaundryWasherModeSelect -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +} // namespace LaundryWasherMode +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Structs {} // namespace Structs namespace Commands { @@ -11718,43 +11781,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. -namespace ChangeToModeWithStatus { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ChangeToModeWithStatus. namespace ChangeToModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -11803,9 +11829,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); - break; case Attributes::SupportedModes::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; @@ -11846,7 +11869,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { namespace Commands {} // namespace Commands @@ -11897,7 +11920,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Structs {} // namespace Structs namespace Commands { @@ -11938,12 +11961,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. -namespace ChangeToModeWithStatus { +namespace ChangeToModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kStatus), status)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kStatusText), statusText)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11962,8 +11986,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); + case to_underlying(Fields::kStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, status)); + break; + case to_underlying(Fields::kStatusText): + ReturnErrorOnFailure(DataModel::Decode(reader, statusText)); break; default: break; @@ -11974,58 +12001,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ChangeToModeWithStatus. -namespace ChangeToModeResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kStatus), status)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kStatusText), statusText)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} +} // namespace ChangeToModeResponse. +} // namespace Commands -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, status)); - break; - case to_underlying(Fields::kStatusText): - ReturnErrorOnFailure(DataModel::Decode(reader, statusText)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ChangeToModeResponse. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) { switch (path.mAttributeId) { - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); - break; case Attributes::SupportedModes::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; @@ -12066,8 +12049,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace RvcRunModeSelect -namespace RvcCleanModeSelect { +} // namespace RvcRunMode +namespace RvcCleanMode { namespace Structs {} // namespace Structs namespace Commands { @@ -12108,43 +12091,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. -namespace ChangeToModeWithStatus { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ChangeToModeWithStatus. namespace ChangeToModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -12193,9 +12139,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); - break; case Attributes::SupportedModes::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; @@ -12236,7 +12179,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Commands { @@ -12429,7 +12372,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Structs {} // namespace Structs namespace Commands { @@ -12470,43 +12413,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. -namespace ChangeToModeWithStatus { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ChangeToModeWithStatus. namespace ChangeToModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -12555,9 +12461,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); - break; case Attributes::SupportedModes::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; @@ -12598,7 +12501,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { namespace Commands {} // namespace Commands @@ -12635,15 +12538,250 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return CHIP_NO_ERROR; } -} // namespace Attributes - -namespace Events {} // namespace Events - -} // namespace AirQuality -namespace SmokeCoAlarm { - -namespace Commands { -namespace SelfTestRequest { +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace AirQuality +namespace SmokeCoAlarm { + +namespace Commands { +namespace SelfTestRequest { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace SelfTestRequest. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::ExpressedState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, expressedState)); + break; + case Attributes::SmokeState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, smokeState)); + break; + case Attributes::COState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, COState)); + break; + case Attributes::BatteryAlert::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, batteryAlert)); + break; + case Attributes::DeviceMuted::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, deviceMuted)); + break; + case Attributes::TestInProgress::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, testInProgress)); + break; + case Attributes::HardwareFaultAlert::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, hardwareFaultAlert)); + break; + case Attributes::EndOfServiceAlert::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, endOfServiceAlert)); + break; + case Attributes::InterconnectSmokeAlarm::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, interconnectSmokeAlarm)); + break; + case Attributes::InterconnectCOAlarm::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, interconnectCOAlarm)); + break; + case Attributes::ContaminationState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, contaminationState)); + break; + case Attributes::SensitivityLevel::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, sensitivityLevel)); + break; + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); + break; + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); + break; + case Attributes::EventList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +namespace SmokeAlarm { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace SmokeAlarm. +namespace COAlarm { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace COAlarm. +namespace LowBattery { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace LowBattery. +namespace HardwareFault { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace HardwareFault. +namespace EndOfService { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -12675,78 +12813,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace SelfTestRequest. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::ExpressedState::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, expressedState)); - break; - case Attributes::SmokeState::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, smokeState)); - break; - case Attributes::COState::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, COState)); - break; - case Attributes::BatteryAlert::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, batteryAlert)); - break; - case Attributes::DeviceMuted::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, deviceMuted)); - break; - case Attributes::TestInProgress::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, testInProgress)); - break; - case Attributes::HardwareFaultAlert::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, hardwareFaultAlert)); - break; - case Attributes::EndOfServiceAlert::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, endOfServiceAlert)); - break; - case Attributes::InterconnectSmokeAlarm::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, interconnectSmokeAlarm)); - break; - case Attributes::InterconnectCOAlarm::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, interconnectCOAlarm)); - break; - case Attributes::ContaminationState::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, contaminationState)); - break; - case Attributes::SensitivityLevel::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, sensitivityLevel)); - break; - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); - break; - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); - break; - case Attributes::EventList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - - return CHIP_NO_ERROR; -} -} // namespace Attributes - -namespace Events { -namespace SmokeAlarm { +} // namespace EndOfService. +namespace SelfTestComplete { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -12778,8 +12846,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace SmokeAlarm. -namespace COAlarm { +} // namespace SelfTestComplete. +namespace AlarmMuted { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -12811,8 +12879,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace COAlarm. -namespace LowBattery { +} // namespace AlarmMuted. +namespace MuteEnded { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -12844,8 +12912,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace LowBattery. -namespace HardwareFault { +} // namespace MuteEnded. +namespace InterconnectSmokeAlarm { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -12877,8 +12945,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace HardwareFault. -namespace EndOfService { +} // namespace InterconnectSmokeAlarm. +namespace InterconnectCOAlarm { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -12910,8 +12978,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace EndOfService. -namespace SelfTestComplete { +} // namespace InterconnectCOAlarm. +namespace AllClear { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -12943,8 +13011,15 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace SelfTestComplete. -namespace AlarmMuted { +} // namespace AllClear. +} // namespace Events + +} // namespace SmokeCoAlarm +namespace OperationalState { +namespace Structs {} // namespace Structs + +namespace Commands { +namespace Pause { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -12976,8 +13051,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace AlarmMuted. -namespace MuteEnded { +} // namespace Pause. +namespace Stop { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -13009,8 +13084,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MuteEnded. -namespace InterconnectSmokeAlarm { +} // namespace Stop. +namespace Start { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -13042,8 +13117,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace InterconnectSmokeAlarm. -namespace InterconnectCOAlarm { +} // namespace Start. +namespace Resume { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -13075,12 +13150,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace InterconnectCOAlarm. -namespace AllClear { +} // namespace Resume. +namespace OperationalCommandResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCommandResponseState), commandResponseState)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -13099,6 +13175,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kCommandResponseState): + ReturnErrorOnFailure(DataModel::Decode(reader, commandResponseState)); + break; default: break; } @@ -13108,20 +13187,65 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace AllClear. -} // namespace Events +} // namespace OperationalCommandResponse. +} // namespace Commands -} // namespace SmokeCoAlarm -namespace OperationalState { -namespace Structs { -namespace ErrorStateStruct { +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::PhaseList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, phaseList)); + break; + case Attributes::CurrentPhase::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, currentPhase)); + break; + case Attributes::CountdownTime::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, countdownTime)); + break; + case Attributes::OperationalStateList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateList)); + break; + case Attributes::OperationalState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalState)); + break; + case Attributes::OperationalError::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalError)); + break; + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); + break; + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); + break; + case Attributes::EventList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +namespace OperationalError { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateID), errorStateID)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateLabel), errorStateLabel)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateDetails), errorStateDetails)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorState), errorState)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -13131,8 +13255,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -13141,14 +13264,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kErrorStateID): - ReturnErrorOnFailure(DataModel::Decode(reader, errorStateID)); - break; - case to_underlying(Fields::kErrorStateLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, errorStateLabel)); - break; - case to_underlying(Fields::kErrorStateDetails): - ReturnErrorOnFailure(DataModel::Decode(reader, errorStateDetails)); + case to_underlying(Fields::kErrorState): + ReturnErrorOnFailure(DataModel::Decode(reader, errorState)); break; default: break; @@ -13157,18 +13274,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; } - -} // namespace ErrorStateStruct -namespace OperationalStateStruct { +} // namespace OperationalError. +namespace OperationCompletion { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateID), operationalStateID)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateLabel), operationalStateLabel)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCompletionErrorCode), completionErrorCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kTotalOperationalTime), totalOperationalTime)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kPausedTime), pausedTime)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -13178,8 +13294,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -13188,11 +13303,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kOperationalStateID): - ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateID)); + case to_underlying(Fields::kCompletionErrorCode): + ReturnErrorOnFailure(DataModel::Decode(reader, completionErrorCode)); break; - case to_underlying(Fields::kOperationalStateLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateLabel)); + case to_underlying(Fields::kTotalOperationalTime): + ReturnErrorOnFailure(DataModel::Decode(reader, totalOperationalTime)); + break; + case to_underlying(Fields::kPausedTime): + ReturnErrorOnFailure(DataModel::Decode(reader, pausedTime)); break; default: break; @@ -13201,12 +13319,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; } +} // namespace OperationCompletion. +} // namespace Events -} // namespace OperationalStateStruct -} // namespace Structs +} // namespace OperationalState +namespace RvcOperationalState { +namespace Structs {} // namespace Structs namespace Commands { namespace Pause { @@ -13514,7 +13634,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace OperationCompletion. } // namespace Events -} // namespace OperationalState +} // namespace RvcOperationalState namespace HepaFilterMonitoring { namespace Commands { @@ -28024,28 +28144,28 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } - case Clusters::LaundryWasherModeSelect::Id: { + case Clusters::LaundryWasherMode::Id: { switch (aCommand) { default: return false; } } - case Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id: { + case Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { switch (aCommand) { default: return false; } } - case Clusters::RvcRunModeSelect::Id: { + case Clusters::RvcRunMode::Id: { switch (aCommand) { default: return false; } } - case Clusters::RvcCleanModeSelect::Id: { + case Clusters::RvcCleanMode::Id: { switch (aCommand) { default: @@ -28059,7 +28179,7 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } - case Clusters::DishwasherModeSelect::Id: { + case Clusters::DishwasherMode::Id: { switch (aCommand) { default: @@ -28080,6 +28200,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::RvcOperationalState::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::HepaFilterMonitoring::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 3dd2881b9049c1..7d386143d47cf9 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 @@ -48,7 +48,6 @@ enum class Fields : uint8_t { kMfgCode = 0, kValue = 1, - kTagName = 2, }; struct Type @@ -56,7 +55,6 @@ struct Type public: Optional mfgCode; uint16_t value = static_cast(0); - Optional tagName; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -124,6 +122,31 @@ struct Type using DecodableType = Type; } // namespace ApplicationStruct +namespace ErrorStateStruct { +enum class Fields : uint8_t +{ + kErrorStateID = 0, + kErrorStateLabel = 1, + kErrorStateDetails = 2, +}; + +struct Type +{ +public: + uint8_t errorStateID = static_cast(0); + Optional errorStateLabel; + Optional errorStateDetails; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +using DecodableType = Type; + +} // namespace ErrorStateStruct namespace LabelStruct { enum class Fields : uint8_t { @@ -147,6 +170,29 @@ struct Type using DecodableType = Type; } // namespace LabelStruct +namespace OperationalStateStruct { +enum class Fields : uint8_t +{ + kOperationalStateID = 0, + kOperationalStateLabel = 1, +}; + +struct Type +{ +public: + uint8_t operationalStateID = static_cast(0); + Optional operationalStateLabel; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +using DecodableType = Type; + +} // namespace OperationalStateStruct } // namespace Structs } // namespace detail @@ -14027,111 +14073,89 @@ struct TypeInfo } // namespace IcdManagement namespace ModeSelect { namespace Structs { -namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; -namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; -} // namespace Structs - -namespace Commands { -// Forward-declarations so we can reference these later. - -namespace ChangeToMode { -struct Type; -struct DecodableType; -} // namespace ChangeToMode - -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - -namespace ChangeToModeResponse { -struct Type; -struct DecodableType; -} // namespace ChangeToModeResponse - -} // namespace Commands - -namespace Commands { -namespace ChangeToMode { +namespace SemanticTagStruct { enum class Fields : uint8_t { - kNewMode = 0, + kMfgCode = 0, + kValue = 1, }; struct Type { public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } - - uint8_t newMode = static_cast(0); + chip::VendorId mfgCode = static_cast(0); + uint16_t value = static_cast(0); - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); - using ResponseType = DataModel::NullObjectType; + static constexpr bool kIsFabricScoped = false; - static constexpr bool MustUseTimedInvoke() { return false; } + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } +using DecodableType = Type; - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToMode -namespace ChangeToModeWithStatus { +} // namespace SemanticTagStruct +namespace ModeOptionStruct { enum class Fields : uint8_t { - kNewMode = 0, + kLabel = 0, + kMode = 1, + kSemanticTags = 2, }; struct Type { public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } + chip::CharSpan label; + uint8_t mode = static_cast(0); + DataModel::List semanticTags; - uint8_t newMode = static_cast(0); + static constexpr bool kIsFabricScoped = false; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } }; struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } + chip::CharSpan label; + uint8_t mode = static_cast(0); + DataModel::DecodableList semanticTags; - uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; }; -}; // namespace ChangeToModeWithStatus -namespace ChangeToModeResponse { + +} // namespace ModeOptionStruct +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace ChangeToMode { +struct Type; +struct DecodableType; +} // namespace ChangeToMode + +} // namespace Commands + +namespace Commands { +namespace ChangeToMode { enum class Fields : uint8_t { - kStatus = 0, - kStatusText = 1, + kNewMode = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } - uint8_t status = static_cast(0); - Optional statusText; + uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -14143,14 +14167,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } - uint8_t status = static_cast(0); - Optional statusText; + uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ChangeToModeResponse +}; // namespace ChangeToMode } // namespace Commands namespace Attributes { @@ -14291,7 +14314,7 @@ struct TypeInfo }; } // namespace Attributes } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Structs { namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; @@ -14305,11 +14328,6 @@ struct Type; struct DecodableType; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { struct Type; struct DecodableType; @@ -14329,13 +14347,13 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -14344,44 +14362,12 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode -namespace ChangeToModeWithStatus { -enum class Fields : uint8_t -{ - kNewMode = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } - - uint8_t newMode = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } - - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToModeWithStatus namespace ChangeToModeResponse { enum class Fields : uint8_t { @@ -14394,7 +14380,7 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -14410,7 +14396,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -14421,29 +14407,16 @@ struct DecodableType namespace Attributes { -namespace Description { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 64; } -}; -} // namespace Description namespace SupportedModes { struct TypeInfo { - using Type = chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = - chip::app::DataModel::DecodableList; + chip::app::DataModel::DecodableList; using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::LaundryWasherModeSelect::Structs::ModeOptionStruct::DecodableType> &; + chip::app::Clusters::LaundryWasherMode::Structs::ModeOptionStruct::DecodableType> &; - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedModes::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14455,7 +14428,7 @@ struct TypeInfo using DecodableType = uint8_t; using DecodableArgType = uint8_t; - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14467,7 +14440,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14479,7 +14452,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14487,37 +14460,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace ClusterRevision @@ -14525,11 +14498,10 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Description::TypeInfo::DecodableType description; Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; @@ -14543,8 +14515,8 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace LaundryWasherModeSelect -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +} // namespace LaundryWasherMode +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Structs { namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; @@ -14558,11 +14530,6 @@ struct Type; struct DecodableType; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { struct Type; struct DecodableType; @@ -14582,13 +14549,13 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -14597,45 +14564,12 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode -namespace ChangeToModeWithStatus { -enum class Fields : uint8_t -{ - kNewMode = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } - - uint8_t newMode = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = - Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } - - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToModeWithStatus namespace ChangeToModeResponse { enum class Fields : uint8_t { @@ -14648,7 +14582,7 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -14664,7 +14598,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -14675,30 +14609,17 @@ struct DecodableType namespace Attributes { -namespace Description { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 64; } -}; -} // namespace Description namespace SupportedModes { struct TypeInfo { using Type = chip::app::DataModel::List< - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Structs::ModeOptionStruct::Type>; + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::Type>; using DecodableType = chip::app::DataModel::DecodableList< - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Structs::ModeOptionStruct::DecodableType>; + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::DecodableType>; using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Structs::ModeOptionStruct::DecodableType> &; + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::DecodableType> &; - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedModes::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14710,7 +14631,7 @@ struct TypeInfo using DecodableType = uint8_t; using DecodableArgType = uint8_t; - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14722,7 +14643,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14734,7 +14655,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14742,37 +14663,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace ClusterRevision @@ -14780,11 +14701,10 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Description::TypeInfo::DecodableType description; Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; @@ -14798,7 +14718,7 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { namespace Attributes { @@ -14910,7 +14830,7 @@ struct TypeInfo }; } // namespace Attributes } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Structs { namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; @@ -14924,11 +14844,6 @@ struct Type; struct DecodableType; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { struct Type; struct DecodableType; @@ -14948,13 +14863,13 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::RvcRunMode::Commands::ChangeToModeResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -14963,44 +14878,12 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode -namespace ChangeToModeWithStatus { -enum class Fields : uint8_t -{ - kNewMode = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } - - uint8_t newMode = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } - - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToModeWithStatus namespace ChangeToModeResponse { enum class Fields : uint8_t { @@ -15013,7 +14896,7 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15029,7 +14912,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15040,29 +14923,16 @@ struct DecodableType namespace Attributes { -namespace Description { +namespace SupportedModes { struct TypeInfo { - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 64; } -}; -} // namespace Description -namespace SupportedModes { -struct TypeInfo -{ - using Type = chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = - chip::app::DataModel::DecodableList; - using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::RvcRunModeSelect::Structs::ModeOptionStruct::DecodableType> &; + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedModes::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15074,7 +14944,7 @@ struct TypeInfo using DecodableType = uint8_t; using DecodableArgType = uint8_t; - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15086,7 +14956,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15098,7 +14968,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15106,37 +14976,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace ClusterRevision @@ -15144,11 +15014,10 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Description::TypeInfo::DecodableType description; Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; @@ -15162,8 +15031,8 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace RvcRunModeSelect -namespace RvcCleanModeSelect { +} // namespace RvcRunMode +namespace RvcCleanMode { namespace Structs { namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; @@ -15177,11 +15046,6 @@ struct Type; struct DecodableType; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { struct Type; struct DecodableType; @@ -15201,13 +15065,13 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::RvcCleanMode::Commands::ChangeToModeResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -15216,44 +15080,12 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode -namespace ChangeToModeWithStatus { -enum class Fields : uint8_t -{ - kNewMode = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } - - uint8_t newMode = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } - - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToModeWithStatus namespace ChangeToModeResponse { enum class Fields : uint8_t { @@ -15266,7 +15098,7 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15282,7 +15114,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15293,29 +15125,16 @@ struct DecodableType namespace Attributes { -namespace Description { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 64; } -}; -} // namespace Description namespace SupportedModes { struct TypeInfo { - using Type = chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = - chip::app::DataModel::DecodableList; - using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::RvcCleanModeSelect::Structs::ModeOptionStruct::DecodableType> &; + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedModes::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15327,7 +15146,7 @@ struct TypeInfo using DecodableType = uint8_t; using DecodableArgType = uint8_t; - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15339,7 +15158,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15351,7 +15170,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15359,37 +15178,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace ClusterRevision @@ -15397,11 +15216,10 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Description::TypeInfo::DecodableType description; Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; @@ -15415,7 +15233,7 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Commands { @@ -15732,7 +15550,7 @@ struct DecodableType } // namespace Notify } // namespace Events } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Structs { namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; @@ -15746,11 +15564,6 @@ struct Type; struct DecodableType; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { struct Type; struct DecodableType; @@ -15770,13 +15583,13 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::DishwasherMode::Commands::ChangeToModeResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -15785,44 +15598,12 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode -namespace ChangeToModeWithStatus { -enum class Fields : uint8_t -{ - kNewMode = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } - - uint8_t newMode = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } - - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToModeWithStatus namespace ChangeToModeResponse { enum class Fields : uint8_t { @@ -15835,7 +15616,7 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15851,7 +15632,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15862,29 +15643,16 @@ struct DecodableType namespace Attributes { -namespace Description { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 64; } -}; -} // namespace Description namespace SupportedModes { struct TypeInfo { - using Type = chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = - chip::app::DataModel::DecodableList; - using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::DishwasherModeSelect::Structs::ModeOptionStruct::DecodableType> &; + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedModes::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15896,7 +15664,7 @@ struct TypeInfo using DecodableType = uint8_t; using DecodableArgType = uint8_t; - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15908,7 +15676,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15920,7 +15688,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15928,37 +15696,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace ClusterRevision @@ -15966,11 +15734,10 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Description::TypeInfo::DecodableType description; Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; @@ -15984,7 +15751,7 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { namespace Attributes { @@ -16635,54 +16402,8 @@ struct DecodableType } // namespace SmokeCoAlarm namespace OperationalState { namespace Structs { -namespace ErrorStateStruct { -enum class Fields : uint8_t -{ - kErrorStateID = 0, - kErrorStateLabel = 1, - kErrorStateDetails = 2, -}; - -struct Type -{ -public: - ErrorStateEnum errorStateID = static_cast(0); - DataModel::Nullable errorStateLabel; - Optional errorStateDetails; - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = false; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; -}; - -using DecodableType = Type; - -} // namespace ErrorStateStruct -namespace OperationalStateStruct { -enum class Fields : uint8_t -{ - kOperationalStateID = 0, - kOperationalStateLabel = 1, -}; - -struct Type -{ -public: - OperationalStateEnum operationalStateID = static_cast(0); - chip::CharSpan operationalStateLabel; - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = false; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; -}; - -using DecodableType = Type; - -} // namespace OperationalStateStruct +namespace ErrorStateStruct = Clusters::detail::Structs::ErrorStateStruct; +namespace OperationalStateStruct = Clusters::detail::Structs::OperationalStateStruct; } // namespace Structs namespace Commands { @@ -17050,7 +16771,7 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::Id; } static constexpr bool kIsFabricScoped = false; - ErrorStateEnum completionErrorCode = static_cast(0); + uint8_t completionErrorCode = static_cast(0); Optional> totalOperationalTime; Optional> pausedTime; @@ -17064,7 +16785,7 @@ struct DecodableType static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::Id; } - ErrorStateEnum completionErrorCode = static_cast(0); + uint8_t completionErrorCode = static_cast(0); Optional> totalOperationalTime; Optional> pausedTime; @@ -17073,6 +16794,400 @@ struct DecodableType } // namespace OperationCompletion } // namespace Events } // namespace OperationalState +namespace RvcOperationalState { +namespace Structs { +namespace ErrorStateStruct = Clusters::detail::Structs::ErrorStateStruct; +namespace OperationalStateStruct = Clusters::detail::Structs::OperationalStateStruct; +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace Pause { +struct Type; +struct DecodableType; +} // namespace Pause + +namespace Stop { +struct Type; +struct DecodableType; +} // namespace Stop + +namespace Start { +struct Type; +struct DecodableType; +} // namespace Start + +namespace Resume { +struct Type; +struct DecodableType; +} // namespace Resume + +namespace OperationalCommandResponse { +struct Type; +struct DecodableType; +} // namespace OperationalCommandResponse + +} // namespace Commands + +namespace Commands { +namespace Pause { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Pause::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Pause::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Pause +namespace Stop { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Stop +namespace Start { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Start::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Start::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Start +namespace Resume { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Resume::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Resume::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Resume +namespace OperationalCommandResponse { +enum class Fields : uint8_t +{ + kCommandResponseState = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::OperationalCommandResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + Structs::ErrorStateStruct::Type commandResponseState; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::OperationalCommandResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + Structs::ErrorStateStruct::DecodableType commandResponseState; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace OperationalCommandResponse +} // namespace Commands + +namespace Attributes { + +namespace PhaseList { +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::RvcOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PhaseList::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PhaseList +namespace CurrentPhase { +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::RvcOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPhase::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentPhase +namespace CountdownTime { +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::RvcOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CountdownTime::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CountdownTime +namespace OperationalStateList { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OperationalStateList::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace OperationalStateList +namespace OperationalState { +struct TypeInfo +{ + using Type = chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::Type; + using DecodableType = chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OperationalState::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace OperationalState +namespace OperationalError { +struct TypeInfo +{ + using Type = chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::Type; + using DecodableType = chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OperationalError::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace OperationalError +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::PhaseList::TypeInfo::DecodableType phaseList; + Attributes::CurrentPhase::TypeInfo::DecodableType currentPhase; + Attributes::CountdownTime::TypeInfo::DecodableType countdownTime; + Attributes::OperationalStateList::TypeInfo::DecodableType operationalStateList; + Attributes::OperationalState::TypeInfo::DecodableType operationalState; + Attributes::OperationalError::TypeInfo::DecodableType operationalError; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +namespace Events { +namespace OperationalError { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; + +enum class Fields : uint8_t +{ + kErrorState = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationalError::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + static constexpr bool kIsFabricScoped = false; + + Structs::ErrorStateStruct::Type errorState; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationalError::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + Structs::ErrorStateStruct::DecodableType errorState; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace OperationalError +namespace OperationCompletion { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kCompletionErrorCode = 0, + kTotalOperationalTime = 1, + kPausedTime = 2, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + static constexpr bool kIsFabricScoped = false; + + uint8_t completionErrorCode = static_cast(0); + Optional> totalOperationalTime; + Optional> pausedTime; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } + + uint8_t completionErrorCode = static_cast(0); + Optional> totalOperationalTime; + Optional> pausedTime; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace OperationCompletion +} // namespace Events +} // namespace RvcOperationalState namespace HepaFilterMonitoring { namespace Commands { 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 9df5738cf6be5c..a20b6cd0022bff 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 @@ -2467,27 +2467,23 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Attributes { -namespace Description { -static constexpr AttributeId Id = 0x00000000; -} // namespace Description - namespace SupportedModes { -static constexpr AttributeId Id = 0x00000002; +static constexpr AttributeId Id = 0x00000000; } // namespace SupportedModes namespace CurrentMode { -static constexpr AttributeId Id = 0x00000003; +static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode namespace StartUpMode { -static constexpr AttributeId Id = 0x00000004; +static constexpr AttributeId Id = 0x00000002; } // namespace StartUpMode namespace OnMode { -static constexpr AttributeId Id = 0x00000005; +static constexpr AttributeId Id = 0x00000003; } // namespace OnMode namespace GeneratedCommandList { @@ -2515,29 +2511,25 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace LaundryWasherModeSelect +} // namespace LaundryWasherMode -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Attributes { -namespace Description { -static constexpr AttributeId Id = 0x00000000; -} // namespace Description - namespace SupportedModes { -static constexpr AttributeId Id = 0x00000002; +static constexpr AttributeId Id = 0x00000000; } // namespace SupportedModes namespace CurrentMode { -static constexpr AttributeId Id = 0x00000003; +static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode namespace StartUpMode { -static constexpr AttributeId Id = 0x00000004; +static constexpr AttributeId Id = 0x00000002; } // namespace StartUpMode namespace OnMode { -static constexpr AttributeId Id = 0x00000005; +static constexpr AttributeId Id = 0x00000003; } // namespace OnMode namespace GeneratedCommandList { @@ -2565,7 +2557,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { namespace Attributes { @@ -2613,27 +2605,23 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Attributes { -namespace Description { -static constexpr AttributeId Id = 0x00000000; -} // namespace Description - namespace SupportedModes { -static constexpr AttributeId Id = 0x00000002; +static constexpr AttributeId Id = 0x00000000; } // namespace SupportedModes namespace CurrentMode { -static constexpr AttributeId Id = 0x00000003; +static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode namespace StartUpMode { -static constexpr AttributeId Id = 0x00000004; +static constexpr AttributeId Id = 0x00000002; } // namespace StartUpMode namespace OnMode { -static constexpr AttributeId Id = 0x00000005; +static constexpr AttributeId Id = 0x00000003; } // namespace OnMode namespace GeneratedCommandList { @@ -2661,29 +2649,25 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcRunModeSelect +} // namespace RvcRunMode -namespace RvcCleanModeSelect { +namespace RvcCleanMode { namespace Attributes { -namespace Description { -static constexpr AttributeId Id = 0x00000000; -} // namespace Description - namespace SupportedModes { -static constexpr AttributeId Id = 0x00000002; +static constexpr AttributeId Id = 0x00000000; } // namespace SupportedModes namespace CurrentMode { -static constexpr AttributeId Id = 0x00000003; +static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode namespace StartUpMode { -static constexpr AttributeId Id = 0x00000004; +static constexpr AttributeId Id = 0x00000002; } // namespace StartUpMode namespace OnMode { -static constexpr AttributeId Id = 0x00000005; +static constexpr AttributeId Id = 0x00000003; } // namespace OnMode namespace GeneratedCommandList { @@ -2711,7 +2695,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Attributes { @@ -2805,27 +2789,23 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Attributes { -namespace Description { -static constexpr AttributeId Id = 0x00000000; -} // namespace Description - namespace SupportedModes { -static constexpr AttributeId Id = 0x00000002; +static constexpr AttributeId Id = 0x00000000; } // namespace SupportedModes namespace CurrentMode { -static constexpr AttributeId Id = 0x00000003; +static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode namespace StartUpMode { -static constexpr AttributeId Id = 0x00000004; +static constexpr AttributeId Id = 0x00000002; } // namespace StartUpMode namespace OnMode { -static constexpr AttributeId Id = 0x00000005; +static constexpr AttributeId Id = 0x00000003; } // namespace OnMode namespace GeneratedCommandList { @@ -2853,7 +2833,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { namespace Attributes { @@ -3021,6 +3001,60 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace OperationalState +namespace RvcOperationalState { +namespace Attributes { + +namespace PhaseList { +static constexpr AttributeId Id = 0x00000000; +} // namespace PhaseList + +namespace CurrentPhase { +static constexpr AttributeId Id = 0x00000001; +} // namespace CurrentPhase + +namespace CountdownTime { +static constexpr AttributeId Id = 0x00000002; +} // namespace CountdownTime + +namespace OperationalStateList { +static constexpr AttributeId Id = 0x00000003; +} // namespace OperationalStateList + +namespace OperationalState { +static constexpr AttributeId Id = 0x00000004; +} // namespace OperationalState + +namespace OperationalError { +static constexpr AttributeId Id = 0x00000005; +} // namespace OperationalError + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RvcOperationalState + namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index afbdd5fdf33410..9be3dacbbae75d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -151,30 +151,30 @@ static constexpr ClusterId Id = 0x00000046; namespace ModeSelect { static constexpr ClusterId Id = 0x00000050; } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { static constexpr ClusterId Id = 0x00000051; -} // namespace LaundryWasherModeSelect -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +} // namespace LaundryWasherMode +namespace RefrigeratorAndTemperatureControlledCabinetMode { static constexpr ClusterId Id = 0x00000052; -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { static constexpr ClusterId Id = 0x00000053; } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { static constexpr ClusterId Id = 0x00000054; -} // namespace RvcRunModeSelect -namespace RvcCleanModeSelect { +} // namespace RvcRunMode +namespace RvcCleanMode { static constexpr ClusterId Id = 0x00000055; -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { static constexpr ClusterId Id = 0x00000056; } // namespace TemperatureControl namespace RefrigeratorAlarm { static constexpr ClusterId Id = 0x00000057; } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { static constexpr ClusterId Id = 0x00000059; -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { static constexpr ClusterId Id = 0x0000005B; } // namespace AirQuality @@ -184,6 +184,9 @@ static constexpr ClusterId Id = 0x0000005C; namespace OperationalState { static constexpr ClusterId Id = 0x00000060; } // namespace OperationalState +namespace RvcOperationalState { +static constexpr ClusterId Id = 0x00000061; +} // namespace RvcOperationalState namespace HepaFilterMonitoring { static constexpr ClusterId Id = 0x00000071; } // namespace HepaFilterMonitoring 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 54ed91151d52cd..f81eea1404fb8a 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 @@ -638,88 +638,64 @@ namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - -namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; -} // namespace ChangeToModeResponse - } // namespace Commands } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Commands { namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; +static constexpr CommandId Id = 0x00000001; } // namespace ChangeToModeResponse } // namespace Commands -} // namespace LaundryWasherModeSelect +} // namespace LaundryWasherMode -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Commands { namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; +static constexpr CommandId Id = 0x00000001; } // namespace ChangeToModeResponse } // namespace Commands -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Commands { namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; +static constexpr CommandId Id = 0x00000001; } // namespace ChangeToModeResponse } // namespace Commands -} // namespace RvcRunModeSelect +} // namespace RvcRunMode -namespace RvcCleanModeSelect { +namespace RvcCleanMode { namespace Commands { namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; +static constexpr CommandId Id = 0x00000001; } // namespace ChangeToModeResponse } // namespace Commands -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Commands { @@ -731,23 +707,19 @@ static constexpr CommandId Id = 0x00000000; } // namespace Commands } // namespace TemperatureControl -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Commands { namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; +static constexpr CommandId Id = 0x00000001; } // namespace ChangeToModeResponse } // namespace Commands -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace SmokeCoAlarm { namespace Commands { @@ -785,6 +757,32 @@ static constexpr CommandId Id = 0x00000004; } // namespace Commands } // namespace OperationalState +namespace RvcOperationalState { +namespace Commands { + +namespace Pause { +static constexpr CommandId Id = 0x00000000; +} // namespace Pause + +namespace Stop { +static constexpr CommandId Id = 0x00000001; +} // namespace Stop + +namespace Start { +static constexpr CommandId Id = 0x00000002; +} // namespace Start + +namespace Resume { +static constexpr CommandId Id = 0x00000003; +} // namespace Resume + +namespace OperationalCommandResponse { +static constexpr CommandId Id = 0x00000004; +} // namespace OperationalCommandResponse + +} // namespace Commands +} // namespace RvcOperationalState + namespace HepaFilterMonitoring { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index cc23a3c7c6d1c6..65d06ed3442de0 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -341,6 +341,20 @@ static constexpr EventId Id = 0x00000001; } // namespace Events } // namespace OperationalState +namespace RvcOperationalState { +namespace Events { + +namespace OperationalError { +static constexpr EventId Id = 0x00000000; +} // namespace OperationalError + +namespace OperationCompletion { +static constexpr EventId Id = 0x00000001; +} // namespace OperationCompletion + +} // namespace Events +} // namespace RvcOperationalState + namespace DoorLock { namespace Events { diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index a254d99be4a077..3052095d47d1a9 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -292,20 +292,19 @@ #define CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER #endif -#if defined(ZCL_USING_LAUNDRY_WASHER_MODE_SELECT_CLUSTER_SERVER) || defined(ZCL_USING_LAUNDRY_WASHER_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_SELECT_CLUSTER \ - { chip::app::Clusters::LaundryWasherModeSelect::Id, "Laundry Washer Mode Select" }, +#if defined(ZCL_USING_LAUNDRY_WASHER_MODE_CLUSTER_SERVER) || defined(ZCL_USING_LAUNDRY_WASHER_MODE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_CLUSTER { chip::app::Clusters::LaundryWasherMode::Id, "Laundry Washer Mode" }, #else -#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_SELECT_CLUSTER +#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_CLUSTER #endif -#if defined(ZCL_USING_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER_SERVER) || \ - defined(ZCL_USING_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER \ - { chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, \ - "Refrigerator And Temperature Controlled Cabinet Mode Select" }, +#if defined(ZCL_USING_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_SERVER) || \ + defined(ZCL_USING_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER \ + { chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, \ + "Refrigerator And Temperature Controlled Cabinet Mode" }, #else -#define CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER +#define CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER #endif #if defined(ZCL_USING_WASHER_CONTROLS_CLUSTER_SERVER) || defined(ZCL_USING_WASHER_CONTROLS_CLUSTER_CLIENT) @@ -314,16 +313,16 @@ #define CHIP_PRINTCLUSTER_WASHER_CONTROLS_CLUSTER #endif -#if defined(ZCL_USING_RVC_RUN_MODE_SELECT_CLUSTER_SERVER) || defined(ZCL_USING_RVC_RUN_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_RVC_RUN_MODE_SELECT_CLUSTER { chip::app::Clusters::RvcRunModeSelect::Id, "RVC Run Mode Select" }, +#if defined(ZCL_USING_RVC_RUN_MODE_CLUSTER_SERVER) || defined(ZCL_USING_RVC_RUN_MODE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_RVC_RUN_MODE_CLUSTER { chip::app::Clusters::RvcRunMode::Id, "RVC Run Mode" }, #else -#define CHIP_PRINTCLUSTER_RVC_RUN_MODE_SELECT_CLUSTER +#define CHIP_PRINTCLUSTER_RVC_RUN_MODE_CLUSTER #endif -#if defined(ZCL_USING_RVC_CLEAN_MODE_SELECT_CLUSTER_SERVER) || defined(ZCL_USING_RVC_CLEAN_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_SELECT_CLUSTER { chip::app::Clusters::RvcCleanModeSelect::Id, "RVC Clean Mode Select" }, +#if defined(ZCL_USING_RVC_CLEAN_MODE_CLUSTER_SERVER) || defined(ZCL_USING_RVC_CLEAN_MODE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_CLUSTER { chip::app::Clusters::RvcCleanMode::Id, "RVC Clean Mode" }, #else -#define CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_SELECT_CLUSTER +#define CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_CLUSTER #endif #if defined(ZCL_USING_TEMPERATURE_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_TEMPERATURE_CONTROL_CLUSTER_CLIENT) @@ -338,11 +337,10 @@ #define CHIP_PRINTCLUSTER_REFRIGERATOR_ALARM #endif -#if defined(ZCL_USING_DISHWASHER_MODE_SELECT_CLUSTER_SERVER) || defined(ZCL_USING_DISHWASHER_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DISHWASHER_MODE_SELECT_CLUSTER \ - { chip::app::Clusters::DishwasherModeSelect::Id, "Dishwasher Mode Select" }, +#if defined(ZCL_USING_DISHWASHER_MODE_CLUSTER_SERVER) || defined(ZCL_USING_DISHWASHER_MODE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_DISHWASHER_MODE_CLUSTER { chip::app::Clusters::DishwasherMode::Id, "Dishwasher Mode" }, #else -#define CHIP_PRINTCLUSTER_DISHWASHER_MODE_SELECT_CLUSTER +#define CHIP_PRINTCLUSTER_DISHWASHER_MODE_CLUSTER #endif #if defined(ZCL_USING_AIR_QUALITY_CLUSTER_SERVER) || defined(ZCL_USING_AIR_QUALITY_CLUSTER_CLIENT) @@ -363,6 +361,12 @@ #define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER #endif +#if defined(ZCL_USING_OPERATIONAL_STATE_RVC_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_STATE_RVC_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER { chip::app::Clusters::RvcOperationalState::Id, "RVC Operational State" }, +#else +#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER +#endif + #if defined(ZCL_USING_HEPA_FILTER_MONITORING_CLUSTER_SERVER) || defined(ZCL_USING_HEPA_FILTER_MONITORING_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ { chip::app::Clusters::HepaFilterMonitoring::Id, "HEPA Filter Monitoring" }, @@ -967,17 +971,18 @@ CHIP_PRINTCLUSTER_BOOLEAN_STATE_CLUSTER \ CHIP_PRINTCLUSTER_ICD_MANAGEMENT_CLUSTER \ CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER \ - CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_SELECT_CLUSTER \ - CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER \ + CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_CLUSTER \ + CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER \ CHIP_PRINTCLUSTER_WASHER_CONTROLS_CLUSTER \ - CHIP_PRINTCLUSTER_RVC_RUN_MODE_SELECT_CLUSTER \ - CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_SELECT_CLUSTER \ + CHIP_PRINTCLUSTER_RVC_RUN_MODE_CLUSTER \ + CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_CLUSTER \ CHIP_PRINTCLUSTER_TEMPERATURE_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_REFRIGERATOR_ALARM \ - CHIP_PRINTCLUSTER_DISHWASHER_MODE_SELECT_CLUSTER \ + CHIP_PRINTCLUSTER_DISHWASHER_MODE_CLUSTER \ CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER \ CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER \ CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER \ + CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER \ CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_CERAMIC_FILTER_MONITORING_CLUSTER \ @@ -1057,4 +1062,4 @@ CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER \ CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER -#define MAX_CLUSTER_NAME_LENGTH 59 +#define MAX_CLUSTER_NAME_LENGTH 58 diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index e286a82888ae37..bc33ea2a4d5c96 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -74,17 +74,18 @@ | BooleanState | 0x0045 | | IcdManagement | 0x0046 | | ModeSelect | 0x0050 | -| LaundryWasherModeSelect | 0x0051 | -| RefrigeratorAndTemperatureControlledCabinetModeSelect | 0x0052 | +| LaundryWasherMode | 0x0051 | +| RefrigeratorAndTemperatureControlledCabinetMode | 0x0052 | | WasherControls | 0x0053 | -| RvcRunModeSelect | 0x0054 | -| RvcCleanModeSelect | 0x0055 | +| RvcRunMode | 0x0054 | +| RvcCleanMode | 0x0055 | | TemperatureControl | 0x0056 | | RefrigeratorAlarm | 0x0057 | -| DishwasherModeSelect | 0x0059 | +| DishwasherMode | 0x0059 | | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | +| RvcOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -4034,7 +4035,6 @@ class IcdManagementStayActiveRequest : public ClusterCommand |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * Description | 0x0000 | @@ -4083,50 +4083,17 @@ class ModeSelectChangeToMode : public ClusterCommand chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type mRequest; }; -/* - * Command ChangeToModeWithStatus - */ -class ModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - ModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000050, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000050, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::ModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; -}; - /*----------------------------------------------------------------------------*\ -| Cluster LaundryWasherModeSelect | 0x0051 | +| Cluster LaundryWasherMode | 0x0051 | |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * Description | 0x0000 | -| * SupportedModes | 0x0002 | -| * CurrentMode | 0x0003 | -| * StartUpMode | 0x0004 | -| * OnMode | 0x0005 | +| * SupportedModes | 0x0000 | +| * CurrentMode | 0x0001 | +| * StartUpMode | 0x0002 | +| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -4140,10 +4107,10 @@ class ModeSelectChangeToModeWithStatus : public ClusterCommand /* * Command ChangeToMode */ -class LaundryWasherModeSelectChangeToMode : public ClusterCommand +class LaundryWasherModeChangeToMode : public ClusterCommand { public: - LaundryWasherModeSelectChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : + LaundryWasherModeChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) { AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); @@ -4165,53 +4132,20 @@ class LaundryWasherModeSelectChangeToMode : public ClusterCommand } private: - chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToMode::Type mRequest; -}; - -/* - * Command ChangeToModeWithStatus - */ -class LaundryWasherModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - LaundryWasherModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000051) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000051, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000051) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000051, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; + chip::app::Clusters::LaundryWasherMode::Commands::ChangeToMode::Type mRequest; }; /*----------------------------------------------------------------------------*\ -| Cluster RefrigeratorAndTemperatureControlledCabinetModeSelect | 0x0052 | +| Cluster RefrigeratorAndTemperatureControlledCabinetMode | 0x0052 | |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * Description | 0x0000 | -| * SupportedModes | 0x0002 | -| * CurrentMode | 0x0003 | -| * StartUpMode | 0x0004 | -| * OnMode | 0x0005 | +| * SupportedModes | 0x0000 | +| * CurrentMode | 0x0001 | +| * StartUpMode | 0x0002 | +| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -4225,10 +4159,10 @@ class LaundryWasherModeSelectChangeToModeWithStatus : public ClusterCommand /* * Command ChangeToMode */ -class RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToMode : public ClusterCommand +class RefrigeratorAndTemperatureControlledCabinetModeChangeToMode : public ClusterCommand { public: - RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : + RefrigeratorAndTemperatureControlledCabinetModeChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) { AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); @@ -4250,38 +4184,7 @@ class RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToMode : public } private: - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToMode::Type mRequest; -}; - -/* - * Command ChangeToModeWithStatus - */ -class RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000052) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000052, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000052) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000052, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToMode::Type mRequest; }; /*----------------------------------------------------------------------------*\ @@ -4305,18 +4208,16 @@ class RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToModeWithStatu \*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*\ -| Cluster RvcRunModeSelect | 0x0054 | +| Cluster RvcRunMode | 0x0054 | |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * Description | 0x0000 | -| * SupportedModes | 0x0002 | -| * CurrentMode | 0x0003 | -| * StartUpMode | 0x0004 | -| * OnMode | 0x0005 | +| * SupportedModes | 0x0000 | +| * CurrentMode | 0x0001 | +| * StartUpMode | 0x0002 | +| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -4330,10 +4231,10 @@ class RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToModeWithStatu /* * Command ChangeToMode */ -class RvcRunModeSelectChangeToMode : public ClusterCommand +class RvcRunModeChangeToMode : public ClusterCommand { public: - RvcRunModeSelectChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) + RvcRunModeChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) { AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); ClusterCommand::AddArguments(); @@ -4354,53 +4255,20 @@ class RvcRunModeSelectChangeToMode : public ClusterCommand } private: - chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToMode::Type mRequest; -}; - -/* - * Command ChangeToModeWithStatus - */ -class RvcRunModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - RvcRunModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000054) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000054, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000054) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000054, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; + chip::app::Clusters::RvcRunMode::Commands::ChangeToMode::Type mRequest; }; /*----------------------------------------------------------------------------*\ -| Cluster RvcCleanModeSelect | 0x0055 | +| Cluster RvcCleanMode | 0x0055 | |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * Description | 0x0000 | -| * SupportedModes | 0x0002 | -| * CurrentMode | 0x0003 | -| * StartUpMode | 0x0004 | -| * OnMode | 0x0005 | +| * SupportedModes | 0x0000 | +| * CurrentMode | 0x0001 | +| * StartUpMode | 0x0002 | +| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -4414,11 +4282,10 @@ class RvcRunModeSelectChangeToModeWithStatus : public ClusterCommand /* * Command ChangeToMode */ -class RvcCleanModeSelectChangeToMode : public ClusterCommand +class RvcCleanModeChangeToMode : public ClusterCommand { public: - RvcCleanModeSelectChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode", credsIssuerConfig) + RvcCleanModeChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) { AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); ClusterCommand::AddArguments(); @@ -4439,38 +4306,7 @@ class RvcCleanModeSelectChangeToMode : public ClusterCommand } private: - chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToMode::Type mRequest; -}; - -/* - * Command ChangeToModeWithStatus - */ -class RvcCleanModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - RvcCleanModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000055) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000055, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000055) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000055, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; + chip::app::Clusters::RvcCleanMode::Commands::ChangeToMode::Type mRequest; }; /*----------------------------------------------------------------------------*\ @@ -4548,18 +4384,16 @@ class TemperatureControlSetTemperature : public ClusterCommand \*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*\ -| Cluster DishwasherModeSelect | 0x0059 | +| Cluster DishwasherMode | 0x0059 | |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * Description | 0x0000 | -| * SupportedModes | 0x0002 | -| * CurrentMode | 0x0003 | -| * StartUpMode | 0x0004 | -| * OnMode | 0x0005 | +| * SupportedModes | 0x0000 | +| * CurrentMode | 0x0001 | +| * StartUpMode | 0x0002 | +| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -4573,11 +4407,10 @@ class TemperatureControlSetTemperature : public ClusterCommand /* * Command ChangeToMode */ -class DishwasherModeSelectChangeToMode : public ClusterCommand +class DishwasherModeChangeToMode : public ClusterCommand { public: - DishwasherModeSelectChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode", credsIssuerConfig) + DishwasherModeChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) { AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); ClusterCommand::AddArguments(); @@ -4598,38 +4431,7 @@ class DishwasherModeSelectChangeToMode : public ClusterCommand } private: - chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToMode::Type mRequest; -}; - -/* - * Command ChangeToModeWithStatus - */ -class DishwasherModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - DishwasherModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000059) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000059, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000059) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000059, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; + chip::app::Clusters::DishwasherMode::Commands::ChangeToMode::Type mRequest; }; /*----------------------------------------------------------------------------*\ @@ -4863,6 +4665,150 @@ class OperationalStateResume : public ClusterCommand chip::app::Clusters::OperationalState::Commands::Resume::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster RvcOperationalState | 0x0061 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Pause | 0x00 | +| * Stop | 0x01 | +| * Start | 0x02 | +| * Resume | 0x03 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * PhaseList | 0x0000 | +| * CurrentPhase | 0x0001 | +| * CountdownTime | 0x0002 | +| * OperationalStateList | 0x0003 | +| * OperationalState | 0x0004 | +| * OperationalError | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * OperationalError | 0x0000 | +| * OperationCompletion | 0x0001 | +\*----------------------------------------------------------------------------*/ + +/* + * Command Pause + */ +class RvcOperationalStatePause : public ClusterCommand +{ +public: + RvcOperationalStatePause(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("pause", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000000) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000000, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000000) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000000, mRequest); + } + +private: + chip::app::Clusters::RvcOperationalState::Commands::Pause::Type mRequest; +}; + +/* + * Command Stop + */ +class RvcOperationalStateStop : public ClusterCommand +{ +public: + RvcOperationalStateStop(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("stop", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000001) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000001, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000001) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000001, mRequest); + } + +private: + chip::app::Clusters::RvcOperationalState::Commands::Stop::Type mRequest; +}; + +/* + * Command Start + */ +class RvcOperationalStateStart : public ClusterCommand +{ +public: + RvcOperationalStateStart(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("start", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000002) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000002, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000002) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000002, mRequest); + } + +private: + chip::app::Clusters::RvcOperationalState::Commands::Start::Type mRequest; +}; + +/* + * Command Resume + */ +class RvcOperationalStateResume : public ClusterCommand +{ +public: + RvcOperationalStateResume(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("resume", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000003) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000003, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000003) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000003, mRequest); + } + +private: + chip::app::Clusters::RvcOperationalState::Commands::Resume::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster HepaFilterMonitoring | 0x0071 | |------------------------------------------------------------------------------| @@ -14607,9 +14553,8 @@ void registerClusterModeSelect(Commands & commands, CredentialIssuerCommands * c // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // @@ -14676,24 +14621,22 @@ void registerClusterModeSelect(Commands & commands, CredentialIssuerCommands * c commands.Register(clusterName, clusterCommands); } -void registerClusterLaundryWasherModeSelect(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterLaundryWasherMode(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::LaundryWasherModeSelect; + using namespace chip::app::Clusters::LaundryWasherMode; - const char * clusterName = "LaundryWasherModeSelect"; + const char * clusterName = "LaundryWasherMode"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -14705,10 +14648,8 @@ void registerClusterLaundryWasherModeSelect(Commands & commands, CredentialIssue make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "description", Attributes::Description::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // make_unique>>( + chip::app::DataModel::List>>( Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -14730,7 +14671,6 @@ void registerClusterLaundryWasherModeSelect(Commands & commands, CredentialIssue make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -14750,25 +14690,23 @@ void registerClusterLaundryWasherModeSelect(Commands & commands, CredentialIssue commands.Register(clusterName, clusterCommands); } -void registerClusterRefrigeratorAndTemperatureControlledCabinetModeSelect(Commands & commands, - CredentialIssuerCommands * credsIssuerConfig) +void registerClusterRefrigeratorAndTemperatureControlledCabinetMode(Commands & commands, + CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect; + using namespace chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode; - const char * clusterName = "RefrigeratorAndTemperatureControlledCabinetModeSelect"; + const char * clusterName = "RefrigeratorAndTemperatureControlledCabinetMode"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -14780,10 +14718,8 @@ void registerClusterRefrigeratorAndTemperatureControlledCabinetModeSelect(Comman make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "description", Attributes::Description::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // make_unique>>( + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::Type>>>( Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -14805,7 +14741,6 @@ void registerClusterRefrigeratorAndTemperatureControlledCabinetModeSelect(Comman make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -14893,24 +14828,22 @@ void registerClusterWasherControls(Commands & commands, CredentialIssuerCommands commands.Register(clusterName, clusterCommands); } -void registerClusterRvcRunModeSelect(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterRvcRunMode(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::RvcRunModeSelect; + using namespace chip::app::Clusters::RvcRunMode; - const char * clusterName = "RvcRunModeSelect"; + const char * clusterName = "RvcRunMode"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -14922,10 +14855,8 @@ void registerClusterRvcRunModeSelect(Commands & commands, CredentialIssuerComman make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "description", Attributes::Description::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // make_unique>>( + chip::app::DataModel::List>>( Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -14947,7 +14878,6 @@ void registerClusterRvcRunModeSelect(Commands & commands, CredentialIssuerComman make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -14967,24 +14897,22 @@ void registerClusterRvcRunModeSelect(Commands & commands, CredentialIssuerComman commands.Register(clusterName, clusterCommands); } -void registerClusterRvcCleanModeSelect(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterRvcCleanMode(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::RvcCleanModeSelect; + using namespace chip::app::Clusters::RvcCleanMode; - const char * clusterName = "RvcCleanModeSelect"; + const char * clusterName = "RvcCleanMode"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -14996,10 +14924,8 @@ void registerClusterRvcCleanModeSelect(Commands & commands, CredentialIssuerComm make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "description", Attributes::Description::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // make_unique>>( + chip::app::DataModel::List>>( Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -15021,7 +14947,6 @@ void registerClusterRvcCleanModeSelect(Commands & commands, CredentialIssuerComm make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -15184,24 +15109,22 @@ void registerClusterRefrigeratorAlarm(Commands & commands, CredentialIssuerComma commands.Register(clusterName, clusterCommands); } -void registerClusterDishwasherModeSelect(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterDishwasherMode(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::DishwasherModeSelect; + using namespace chip::app::Clusters::DishwasherMode; - const char * clusterName = "DishwasherModeSelect"; + const char * clusterName = "DishwasherMode"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -15213,10 +15136,8 @@ void registerClusterDishwasherModeSelect(Commands & commands, CredentialIssuerCo make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "description", Attributes::Description::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // make_unique>>( + chip::app::DataModel::List>>( Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -15238,7 +15159,6 @@ void registerClusterDishwasherModeSelect(Commands & commands, CredentialIssuerCo make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -15528,6 +15448,92 @@ void registerClusterOperationalState(Commands & commands, CredentialIssuerComman commands.Register(clusterName, clusterCommands); } +void registerClusterRvcOperationalState(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::RvcOperationalState; + + const char * clusterName = "RvcOperationalState"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "phase-list", Attributes::PhaseList::Id, credsIssuerConfig), // + make_unique(Id, "current-phase", Attributes::CurrentPhase::Id, credsIssuerConfig), // + make_unique(Id, "countdown-time", Attributes::CountdownTime::Id, credsIssuerConfig), // + make_unique(Id, "operational-state-list", Attributes::OperationalStateList::Id, credsIssuerConfig), // + make_unique(Id, "operational-state", Attributes::OperationalState::Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Attributes::OperationalError::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), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>>( + Id, "phase-list", Attributes::PhaseList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "current-phase", 0, UINT8_MAX, Attributes::CurrentPhase::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>(Id, "countdown-time", 0, UINT32_MAX, + Attributes::CountdownTime::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "operational-state-list", Attributes::OperationalStateList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>( + Id, "operational-state", Attributes::OperationalState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "operational-error", Attributes::OperationalError::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "phase-list", Attributes::PhaseList::Id, credsIssuerConfig), // + make_unique(Id, "current-phase", Attributes::CurrentPhase::Id, credsIssuerConfig), // + make_unique(Id, "countdown-time", Attributes::CountdownTime::Id, credsIssuerConfig), // + make_unique(Id, "operational-state-list", Attributes::OperationalStateList::Id, credsIssuerConfig), // + make_unique(Id, "operational-state", Attributes::OperationalState::Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Attributes::OperationalError::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), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Events::OperationalError::Id, credsIssuerConfig), // + make_unique(Id, "operation-completion", Events::OperationCompletion::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Events::OperationalError::Id, credsIssuerConfig), // + make_unique(Id, "operation-completion", Events::OperationCompletion::Id, credsIssuerConfig), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterHepaFilterMonitoring(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::HepaFilterMonitoring; @@ -24436,17 +24442,18 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterBooleanState(commands, credsIssuerConfig); registerClusterIcdManagement(commands, credsIssuerConfig); registerClusterModeSelect(commands, credsIssuerConfig); - registerClusterLaundryWasherModeSelect(commands, credsIssuerConfig); - registerClusterRefrigeratorAndTemperatureControlledCabinetModeSelect(commands, credsIssuerConfig); + registerClusterLaundryWasherMode(commands, credsIssuerConfig); + registerClusterRefrigeratorAndTemperatureControlledCabinetMode(commands, credsIssuerConfig); registerClusterWasherControls(commands, credsIssuerConfig); - registerClusterRvcRunModeSelect(commands, credsIssuerConfig); - registerClusterRvcCleanModeSelect(commands, credsIssuerConfig); + registerClusterRvcRunMode(commands, credsIssuerConfig); + registerClusterRvcCleanMode(commands, credsIssuerConfig); registerClusterTemperatureControl(commands, credsIssuerConfig); registerClusterRefrigeratorAlarm(commands, credsIssuerConfig); - registerClusterDishwasherModeSelect(commands, credsIssuerConfig); + registerClusterDishwasherMode(commands, credsIssuerConfig); registerClusterAirQuality(commands, credsIssuerConfig); registerClusterSmokeCoAlarm(commands, credsIssuerConfig); registerClusterOperationalState(commands, credsIssuerConfig); + registerClusterRvcOperationalState(commands, credsIssuerConfig); registerClusterHepaFilterMonitoring(commands, credsIssuerConfig); registerClusterActivatedCarbonFilterMonitoring(commands, credsIssuerConfig); registerClusterCeramicFilterMonitoring(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 120444bbebbb8b..b7ba3d66776751 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -41,13 +41,6 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters: ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.value, value["value"])); valueCopy.removeMember("value"); - if (value.isMember("tagName")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "tagName"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.tagName, value["tagName"])); - } - valueCopy.removeMember("tagName"); - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } @@ -55,7 +48,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::ModeT { ComplexArgumentParser::Finalize(request.mfgCode); ComplexArgumentParser::Finalize(request.value); - ComplexArgumentParser::Finalize(request.tagName); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ModeOptionStruct::Type & request, @@ -125,6 +117,46 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::Appli ComplexArgumentParser::Finalize(request.applicationID); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ErrorStateStruct::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("ErrorStateStruct.errorStateID", "errorStateID", value.isMember("errorStateID"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateID, value["errorStateID"])); + valueCopy.removeMember("errorStateID"); + + if (value.isMember("errorStateLabel")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateLabel"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateLabel, value["errorStateLabel"])); + } + valueCopy.removeMember("errorStateLabel"); + + if (value.isMember("errorStateDetails")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateDetails"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateDetails, value["errorStateDetails"])); + } + valueCopy.removeMember("errorStateDetails"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::ErrorStateStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.errorStateID); + ComplexArgumentParser::Finalize(request.errorStateLabel); + ComplexArgumentParser::Finalize(request.errorStateDetails); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::LabelStruct::Type & request, Json::Value & value) { @@ -154,6 +186,40 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::Label ComplexArgumentParser::Finalize(request.value); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::detail::Structs::OperationalStateStruct::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("OperationalStateStruct.operationalStateID", "operationalStateID", + value.isMember("operationalStateID"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.operationalStateID, value["operationalStateID"])); + valueCopy.removeMember("operationalStateID"); + + if (value.isMember("operationalStateLabel")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateLabel"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.operationalStateLabel, value["operationalStateLabel"])); + } + valueCopy.removeMember("operationalStateLabel"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.operationalStateID); + ComplexArgumentParser::Finalize(request.operationalStateLabel); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request, Json::Value & value) @@ -1904,7 +1970,7 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::IcdManagement::Structs } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request, + chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::Type & request, Json::Value & value) { VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); @@ -1913,38 +1979,29 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, Json::Value valueCopy(value); ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("ErrorStateStruct.errorStateID", "errorStateID", value.isMember("errorStateID"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ErrorStateStruct.errorStateLabel", "errorStateLabel", - value.isMember("errorStateLabel"))); + ComplexArgumentParser::EnsureMemberExist("SemanticTagStruct.mfgCode", "mfgCode", value.isMember("mfgCode"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SemanticTagStruct.value", "value", value.isMember("value"))); char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateID"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateID, value["errorStateID"])); - valueCopy.removeMember("errorStateID"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateLabel"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateLabel, value["errorStateLabel"])); - valueCopy.removeMember("errorStateLabel"); + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "mfgCode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.mfgCode, value["mfgCode"])); + valueCopy.removeMember("mfgCode"); - if (value.isMember("errorStateDetails")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateDetails"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateDetails, value["errorStateDetails"])); - } - valueCopy.removeMember("errorStateDetails"); + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "value"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.value, value["value"])); + valueCopy.removeMember("value"); return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } -void ComplexArgumentParser::Finalize(chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request) +void ComplexArgumentParser::Finalize(chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::Type & request) { - ComplexArgumentParser::Finalize(request.errorStateID); - ComplexArgumentParser::Finalize(request.errorStateLabel); - ComplexArgumentParser::Finalize(request.errorStateDetails); + ComplexArgumentParser::Finalize(request.mfgCode); + ComplexArgumentParser::Finalize(request.value); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request, + chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::Type & request, Json::Value & value) { VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); @@ -1952,28 +2009,32 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, // Copy to track which members we already processed. Json::Value valueCopy(value); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("OperationalStateStruct.operationalStateID", "operationalStateID", - value.isMember("operationalStateID"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist( - "OperationalStateStruct.operationalStateLabel", "operationalStateLabel", value.isMember("operationalStateLabel"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ModeOptionStruct.label", "label", value.isMember("label"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ModeOptionStruct.mode", "mode", value.isMember("mode"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ModeOptionStruct.semanticTags", "semanticTags", value.isMember("semanticTags"))); char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateID"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.operationalStateID, value["operationalStateID"])); - valueCopy.removeMember("operationalStateID"); + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "label"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.label, value["label"])); + valueCopy.removeMember("label"); - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateLabel"); - ReturnErrorOnFailure( - ComplexArgumentParser::Setup(labelWithMember, request.operationalStateLabel, value["operationalStateLabel"])); - valueCopy.removeMember("operationalStateLabel"); + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "mode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.mode, value["mode"])); + valueCopy.removeMember("mode"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "semanticTags"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.semanticTags, value["semanticTags"])); + valueCopy.removeMember("semanticTags"); return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } -void ComplexArgumentParser::Finalize(chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request) +void ComplexArgumentParser::Finalize(chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::Type & request) { - ComplexArgumentParser::Finalize(request.operationalStateID); - ComplexArgumentParser::Finalize(request.operationalStateLabel); + ComplexArgumentParser::Finalize(request.label); + ComplexArgumentParser::Finalize(request.mode); + ComplexArgumentParser::Finalize(request.semanticTags); } 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 dea2397ae70c89..fd35d2d31115d8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -37,10 +37,20 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs static void Finalize(chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::ErrorStateStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::detail::Structs::ErrorStateStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::LabelStruct::Type & request, Json::Value & value); static void Finalize(chip::app::Clusters::detail::Structs::LabelStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request, Json::Value & value); @@ -234,15 +244,15 @@ static CHIP_ERROR Setup(const char * label, static void Finalize(chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request, +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request); +static void Finalize(chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request, +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request); +static void Finalize(chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::DoorLock::Structs::CredentialStruct::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 085d9de02833c8..071648f097ff34 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -41,14 +41,6 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return err; } } - { - CHIP_ERROR err = LogValue("TagName", indent + 1, value.tagName); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TagName'"); - return err; - } - } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; @@ -112,6 +104,39 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::ErrorStateStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("ErrorStateID", indent + 1, value.errorStateID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ErrorStateLabel", indent + 1, value.errorStateLabel); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateLabel'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ErrorStateDetails", indent + 1, value.errorStateDetails); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateDetails'"); + 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::LabelStruct::DecodableType & value) { @@ -137,6 +162,31 @@ 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::detail::Structs::OperationalStateStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("OperationalStateID", indent + 1, value.operationalStateID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("OperationalStateLabel", indent + 1, value.operationalStateLabel); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateLabel'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value) { @@ -1720,30 +1770,22 @@ DataModelLogger::LogValue(const char * label, size_t indent, } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType & value) + const chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("ErrorStateID", indent + 1, value.errorStateID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateID'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("ErrorStateLabel", indent + 1, value.errorStateLabel); + CHIP_ERROR err = LogValue("MfgCode", indent + 1, value.mfgCode); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateLabel'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MfgCode'"); return err; } } { - CHIP_ERROR err = LogValue("ErrorStateDetails", indent + 1, value.errorStateDetails); + CHIP_ERROR err = LogValue("Value", indent + 1, value.value); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateDetails'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Value'"); return err; } } @@ -1752,24 +1794,31 @@ 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::OperationalState::Structs::OperationalStateStruct::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("OperationalStateID", indent + 1, value.operationalStateID); + CHIP_ERROR err = LogValue("Label", indent + 1, value.label); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Label'"); return err; } } { - CHIP_ERROR err = LogValue("OperationalStateLabel", indent + 1, value.operationalStateLabel); + CHIP_ERROR err = LogValue("Mode", indent + 1, value.mode); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateLabel'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Mode'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("SemanticTags", indent + 1, value.semanticTags); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SemanticTags'"); return err; } } @@ -3713,6 +3762,54 @@ 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 RvcOperationalState::Events::OperationalError::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const RvcOperationalState::Events::OperationCompletion::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const DoorLock::Events::DoorLockAlarm::DecodableType & value) { @@ -4432,7 +4529,7 @@ 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 ModeSelect::Commands::ChangeToModeResponse::DecodableType & value) + const LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -4440,8 +4537,9 @@ 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 LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -4449,9 +4547,8 @@ 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 RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeResponse::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const RvcRunMode::Commands::ChangeToModeResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -4460,7 +4557,7 @@ CHIP_ERROR DataModelLogger::LogValue( return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType & value) + const RvcCleanMode::Commands::ChangeToModeResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -4469,7 +4566,7 @@ 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 RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType & value) + const DishwasherMode::Commands::ChangeToModeResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -4478,16 +4575,15 @@ 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 DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType & value) + const OperationalState::Commands::OperationalCommandResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("statusText", indent + 1, value.statusText)); + ReturnErrorOnFailure(DataModelLogger::LogValue("commandResponseState", indent + 1, value.commandResponseState)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OperationalState::Commands::OperationalCommandResponse::DecodableType & value) + const RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("commandResponseState", indent + 1, value.commandResponseState)); @@ -7798,62 +7894,56 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case LaundryWasherModeSelect::Id: { + case LaundryWasherMode::Id: { switch (path.mAttributeId) { - case LaundryWasherModeSelect::Attributes::Description::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Description", 1, value); - } - case LaundryWasherModeSelect::Attributes::SupportedModes::Id: { - chip::app::DataModel::DecodableList< - chip::app::Clusters::LaundryWasherModeSelect::Structs::ModeOptionStruct::DecodableType> + case LaundryWasherMode::Attributes::SupportedModes::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedModes", 1, value); } - case LaundryWasherModeSelect::Attributes::CurrentMode::Id: { + case LaundryWasherMode::Attributes::CurrentMode::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case LaundryWasherModeSelect::Attributes::StartUpMode::Id: { + case LaundryWasherMode::Attributes::StartUpMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpMode", 1, value); } - case LaundryWasherModeSelect::Attributes::OnMode::Id: { + case LaundryWasherMode::Attributes::OnMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OnMode", 1, value); } - case LaundryWasherModeSelect::Attributes::GeneratedCommandList::Id: { + case LaundryWasherMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case LaundryWasherModeSelect::Attributes::AcceptedCommandList::Id: { + case LaundryWasherMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case LaundryWasherModeSelect::Attributes::EventList::Id: { + case LaundryWasherMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case LaundryWasherModeSelect::Attributes::AttributeList::Id: { + case LaundryWasherMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case LaundryWasherModeSelect::Attributes::FeatureMap::Id: { + case LaundryWasherMode::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case LaundryWasherModeSelect::Attributes::ClusterRevision::Id: { + case LaundryWasherMode::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -7861,62 +7951,57 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Id: { switch (path.mAttributeId) { - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::Description::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Description", 1, value); - } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::SupportedModes::Id: { - chip::app::DataModel::DecodableList + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::SupportedModes::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::DecodableType> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedModes", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::CurrentMode::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::CurrentMode::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::StartUpMode::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::StartUpMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpMode", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::OnMode::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::OnMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OnMode", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::GeneratedCommandList::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::AcceptedCommandList::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::EventList::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::AttributeList::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::FeatureMap::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::ClusterRevision::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -7980,61 +8065,55 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case RvcRunModeSelect::Id: { + case RvcRunMode::Id: { switch (path.mAttributeId) { - case RvcRunModeSelect::Attributes::Description::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Description", 1, value); - } - case RvcRunModeSelect::Attributes::SupportedModes::Id: { - chip::app::DataModel::DecodableList - value; + case RvcRunMode::Attributes::SupportedModes::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedModes", 1, value); } - case RvcRunModeSelect::Attributes::CurrentMode::Id: { + case RvcRunMode::Attributes::CurrentMode::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case RvcRunModeSelect::Attributes::StartUpMode::Id: { + case RvcRunMode::Attributes::StartUpMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpMode", 1, value); } - case RvcRunModeSelect::Attributes::OnMode::Id: { + case RvcRunMode::Attributes::OnMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OnMode", 1, value); } - case RvcRunModeSelect::Attributes::GeneratedCommandList::Id: { + case RvcRunMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case RvcRunModeSelect::Attributes::AcceptedCommandList::Id: { + case RvcRunMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case RvcRunModeSelect::Attributes::EventList::Id: { + case RvcRunMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case RvcRunModeSelect::Attributes::AttributeList::Id: { + case RvcRunMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case RvcRunModeSelect::Attributes::FeatureMap::Id: { + case RvcRunMode::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case RvcRunModeSelect::Attributes::ClusterRevision::Id: { + case RvcRunMode::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -8042,61 +8121,55 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case RvcCleanModeSelect::Id: { + case RvcCleanMode::Id: { switch (path.mAttributeId) { - case RvcCleanModeSelect::Attributes::Description::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Description", 1, value); - } - case RvcCleanModeSelect::Attributes::SupportedModes::Id: { - chip::app::DataModel::DecodableList - value; + case RvcCleanMode::Attributes::SupportedModes::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedModes", 1, value); } - case RvcCleanModeSelect::Attributes::CurrentMode::Id: { + case RvcCleanMode::Attributes::CurrentMode::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case RvcCleanModeSelect::Attributes::StartUpMode::Id: { + case RvcCleanMode::Attributes::StartUpMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpMode", 1, value); } - case RvcCleanModeSelect::Attributes::OnMode::Id: { + case RvcCleanMode::Attributes::OnMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OnMode", 1, value); } - case RvcCleanModeSelect::Attributes::GeneratedCommandList::Id: { + case RvcCleanMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case RvcCleanModeSelect::Attributes::AcceptedCommandList::Id: { + case RvcCleanMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case RvcCleanModeSelect::Attributes::EventList::Id: { + case RvcCleanMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case RvcCleanModeSelect::Attributes::AttributeList::Id: { + case RvcCleanMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case RvcCleanModeSelect::Attributes::FeatureMap::Id: { + case RvcCleanMode::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case RvcCleanModeSelect::Attributes::ClusterRevision::Id: { + case RvcCleanMode::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -8216,61 +8289,56 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case DishwasherModeSelect::Id: { + case DishwasherMode::Id: { switch (path.mAttributeId) { - case DishwasherModeSelect::Attributes::Description::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Description", 1, value); - } - case DishwasherModeSelect::Attributes::SupportedModes::Id: { - chip::app::DataModel::DecodableList + case DishwasherMode::Attributes::SupportedModes::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedModes", 1, value); } - case DishwasherModeSelect::Attributes::CurrentMode::Id: { + case DishwasherMode::Attributes::CurrentMode::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case DishwasherModeSelect::Attributes::StartUpMode::Id: { + case DishwasherMode::Attributes::StartUpMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpMode", 1, value); } - case DishwasherModeSelect::Attributes::OnMode::Id: { + case DishwasherMode::Attributes::OnMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OnMode", 1, value); } - case DishwasherModeSelect::Attributes::GeneratedCommandList::Id: { + case DishwasherMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case DishwasherModeSelect::Attributes::AcceptedCommandList::Id: { + case DishwasherMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case DishwasherModeSelect::Attributes::EventList::Id: { + case DishwasherMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case DishwasherModeSelect::Attributes::AttributeList::Id: { + case DishwasherMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case DishwasherModeSelect::Attributes::FeatureMap::Id: { + case DishwasherMode::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case DishwasherModeSelect::Attributes::ClusterRevision::Id: { + case DishwasherMode::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -8483,6 +8551,74 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case RvcOperationalState::Id: { + switch (path.mAttributeId) + { + case RvcOperationalState::Attributes::PhaseList::Id: { + chip::app::DataModel::Nullable> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PhaseList", 1, value); + } + case RvcOperationalState::Attributes::CurrentPhase::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentPhase", 1, value); + } + case RvcOperationalState::Attributes::CountdownTime::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CountdownTime", 1, value); + } + case RvcOperationalState::Attributes::OperationalStateList::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalStateList", 1, value); + } + case RvcOperationalState::Attributes::OperationalState::Id: { + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalState", 1, value); + } + case RvcOperationalState::Attributes::OperationalError::Id: { + chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalError", 1, value); + } + case RvcOperationalState::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case RvcOperationalState::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case RvcOperationalState::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case RvcOperationalState::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case RvcOperationalState::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case RvcOperationalState::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case HepaFilterMonitoring::Id: { switch (path.mAttributeId) { @@ -16231,77 +16367,77 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } - case ModeSelect::Id: { + case LaundryWasherMode::Id: { switch (path.mCommandId) { - case ModeSelect::Commands::ChangeToModeResponse::Id: { - ModeSelect::Commands::ChangeToModeResponse::DecodableType value; + case LaundryWasherMode::Commands::ChangeToModeResponse::Id: { + LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); } } break; } - case LaundryWasherModeSelect::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Id: { switch (path.mCommandId) { - case LaundryWasherModeSelect::Commands::ChangeToModeResponse::Id: { - LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType value; + case RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::Id: { + RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); } } break; } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Id: { + case RvcRunMode::Id: { switch (path.mCommandId) { - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeResponse::Id: { - RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeResponse::DecodableType value; + case RvcRunMode::Commands::ChangeToModeResponse::Id: { + RvcRunMode::Commands::ChangeToModeResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); } } break; } - case RvcRunModeSelect::Id: { + case RvcCleanMode::Id: { switch (path.mCommandId) { - case RvcRunModeSelect::Commands::ChangeToModeResponse::Id: { - RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType value; + case RvcCleanMode::Commands::ChangeToModeResponse::Id: { + RvcCleanMode::Commands::ChangeToModeResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); } } break; } - case RvcCleanModeSelect::Id: { + case DishwasherMode::Id: { switch (path.mCommandId) { - case RvcCleanModeSelect::Commands::ChangeToModeResponse::Id: { - RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType value; + case DishwasherMode::Commands::ChangeToModeResponse::Id: { + DishwasherMode::Commands::ChangeToModeResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); } } break; } - case DishwasherModeSelect::Id: { + case OperationalState::Id: { switch (path.mCommandId) { - case DishwasherModeSelect::Commands::ChangeToModeResponse::Id: { - DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType value; + case OperationalState::Commands::OperationalCommandResponse::Id: { + OperationalState::Commands::OperationalCommandResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); + return DataModelLogger::LogValue("OperationalCommandResponse", 1, value); } } break; } - case OperationalState::Id: { + case RvcOperationalState::Id: { switch (path.mCommandId) { - case OperationalState::Commands::OperationalCommandResponse::Id: { - OperationalState::Commands::OperationalCommandResponse::DecodableType value; + case RvcOperationalState::Commands::OperationalCommandResponse::Id: { + RvcOperationalState::Commands::OperationalCommandResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationalCommandResponse", 1, value); } @@ -16920,6 +17056,22 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case RvcOperationalState::Id: { + switch (header.mPath.mEventId) + { + case RvcOperationalState::Events::OperationalError::Id: { + chip::app::Clusters::RvcOperationalState::Events::OperationalError::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalError", 1, value); + } + case RvcOperationalState::Events::OperationCompletion::Id: { + chip::app::Clusters::RvcOperationalState::Events::OperationCompletion::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationCompletion", 1, value); + } + } + break; + } case DoorLock::Id: { switch (header.mPath.mEventId) { 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 5199662816d440..c259176393d7f8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -29,9 +29,15 @@ 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::ApplicationStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::ErrorStateStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::LabelStruct::DecodableType & value); +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::Scenes::Structs::AttributeValuePair::DecodableType & value); @@ -148,10 +154,10 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType & value); + const chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType & value); + const chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Structs::CredentialStruct::DecodableType & value); @@ -330,6 +336,10 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Events::OperationalError::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Events::OperationCompletion::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::RvcOperationalState::Events::OperationalError::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::RvcOperationalState::Events::OperationCompletion::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Events::DoorLockAlarm::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, @@ -456,22 +466,23 @@ LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType & value); + const chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType & value); -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands:: - ChangeToModeResponse::DecodableType & value); + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType & + value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType & value); + const chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType & value); + const chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType & value); + const chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index bd8f0f92d82a80..cb11f6427d4461 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -75,6 +75,26 @@ class TestList : public Command printf("Test_TC_CC_8_1\n"); printf("TestColorControl_9_1\n"); printf("TestColorControl_9_2\n"); + printf("Test_TC_CDOCONC_1_1\n"); + printf("Test_TC_CDOCONC_2_1\n"); + printf("Test_TC_CMOCONC_1_1\n"); + printf("Test_TC_CMOCONC_2_1\n"); + printf("Test_TC_FLDCONC_1_1\n"); + printf("Test_TC_FLDCONC_2_1\n"); + printf("Test_TC_NDOCONC_1_1\n"); + printf("Test_TC_NDOCONC_2_1\n"); + printf("Test_TC_OZCONC_1_1\n"); + printf("Test_TC_OZCONC_2_1\n"); + printf("Test_TC_PMHCONC_1_1\n"); + printf("Test_TC_PMHCONC_2_1\n"); + printf("Test_TC_PMICONC_1_1\n"); + printf("Test_TC_PMICONC_2_1\n"); + printf("Test_TC_PMKCONC_1_1\n"); + printf("Test_TC_PMKCONC_2_1\n"); + printf("Test_TC_RNCONC_1_1\n"); + printf("Test_TC_RNCONC_2_1\n"); + printf("Test_TC_TVOCCONC_1_1\n"); + printf("Test_TC_TVOCCONC_2_1\n"); printf("TestIcdManagementCluster\n"); printf("Test_TC_OPCREDS_1_2\n"); printf("Test_TC_BINFO_1_1\n"); @@ -23006,6 +23026,7535 @@ class TestColorControl_9_2Suite : public TestCommand } }; +class Test_TC_CDOCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_CDOCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CDOCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CDOCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given CDOCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given CDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given CDOCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given CDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given CDOCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given CDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given CDOCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given CDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given CDOCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given CDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given CDOCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given CDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.A0007 && CDOCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when CDOCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when CDOCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when CDOCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "CDOCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when CDOCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CDOCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_CDOCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CDOCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CDOCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CMOCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_CMOCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CMOCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CMOCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given CMOCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given CMOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given CMOCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given CMOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given CMOCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given CMOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given CMOCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given CMOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given CMOCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given CMOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given CMOCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given CMOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.A0007 && CMOCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when CMOCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when CMOCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when CMOCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "CMOCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when CMOCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CMOCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_CMOCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CMOCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CMOCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLDCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_FLDCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_FLDCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLDCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given FLDCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given FLDCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given FLDCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given FLDCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given FLDCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given FLDCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given FLDCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given FLDCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given FLDCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given FLDCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given FLDCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given FLDCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.A0007 && FLDCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when FLDCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when FLDCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when FLDCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "FLDCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when FLDCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLDCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_FLDCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_FLDCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLDCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_NDOCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_NDOCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_NDOCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_NDOCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Given NDOCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given NDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given NDOCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given NDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given NDOCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given NDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given NDOCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given NDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given NDOCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given NDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given NDOCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given NDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.A0007 && NDOCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when NDOCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when NDOCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when NDOCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "NDOCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when NDOCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_NDOCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_NDOCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_NDOCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_NDOCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_OZCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OZCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OZCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given OZCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given OZCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given OZCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given OZCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given OZCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given OZCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given OZCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given OZCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given OZCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given OZCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given OZCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given OZCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && OZCONC.S.A0007 && OZCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when OZCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when OZCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when OZCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "OZCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when OZCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_OZCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OZCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OZCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OzoneConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OzoneConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OzoneConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMHCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_PMHCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMHCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMHCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given PMHCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given PMHCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given PMHCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given PMHCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given PMHCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given PMHCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given PMHCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given PMHCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given PMHCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given PMHCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given PMHCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given PMHCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.A0007 && PMHCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when PMHCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when PMHCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMHCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "PMHCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when PMHCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMHCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_PMHCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMHCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMHCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm1ConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm1ConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm1ConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMICONC_1_1Suite : public TestCommand +{ +public: + Test_TC_PMICONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMICONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMICONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given PMICONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given PMICONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given PMICONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given PMICONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given PMICONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given PMICONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given PMICONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given PMICONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given PMICONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given PMICONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given PMICONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given PMICONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && PMICONC.S.A0007 && PMICONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when PMICONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when PMICONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMICONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "PMICONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when PMICONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMICONC_2_1Suite : public TestCommand +{ +public: + Test_TC_PMICONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMICONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMICONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm25ConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm25ConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm25ConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMKCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_PMKCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMKCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMKCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given PMKCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given PMKCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given PMKCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given PMKCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given PMKCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given PMKCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given PMKCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given PMKCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given PMKCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given PMKCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given PMKCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given PMKCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.A0007 && PMKCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when PMKCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when PMKCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMKCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "PMKCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when PMKCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMKCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_PMKCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMKCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMKCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm10ConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm10ConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm10ConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RNCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_RNCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RNCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RNCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given RNCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given RNCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given RNCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given RNCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given RNCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given RNCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given RNCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given RNCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given RNCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given RNCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given RNCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given RNCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && RNCONC.S.A0007 && RNCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when RNCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when RNCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when RNCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "RNCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when RNCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RNCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_RNCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RNCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RNCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RadonConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RadonConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RadonConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TVOCCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_TVOCCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TVOCCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TVOCCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Given TVOCCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Given TVOCCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Given TVOCCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Given TVOCCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Given TVOCCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Given TVOCCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Given TVOCCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Given TVOCCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Given TVOCCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Given TVOCCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Given TVOCCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Given TVOCCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.A0007 && TVOCCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when TVOCCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when TVOCCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when TVOCCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "TVOCCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when TVOCCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TVOCCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_TVOCCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TVOCCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TVOCCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasuredValue::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::LevelValue::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class TestIcdManagementClusterSuite : public TestCommand { public: @@ -77320,7 +84869,7 @@ class TestModeSelectClusterSuite : public TestCommand { public: TestModeSelectClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("TestModeSelectCluster", 31, credsIssuerConfig) + TestCommand("TestModeSelectCluster", 32, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -77369,6 +84918,15 @@ class TestModeSelectClusterSuite : public TestCommand } break; case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("standardNamespace", value)); + VerifyOrReturn(CheckValue("standardNamespace.Value()", value.Value(), 0U)); + } + break; + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList @@ -77381,36 +84939,36 @@ class TestModeSelectClusterSuite : public TestCommand CheckValueAsString("supportedModes[0].label", iter_0.GetValue().label, chip::CharSpan("Black", 5))); VerifyOrReturn(CheckValue("supportedModes[0].mode", iter_0.GetValue().mode, 0U)); { - auto iter_2 = iter_0.GetValue().modeTags.begin(); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes[0].modeTags", - iter_2, 0)); - VerifyOrReturn(CheckValue("supportedModes[0].modeTags[0].value", iter_2.GetValue().value, 0U)); - VerifyOrReturn( - CheckNoMoreListItems("supportedModes[0].modeTags", iter_2, 1)); + auto iter_2 = iter_0.GetValue().semanticTags.begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "supportedModes[0].semanticTags", iter_2, 0)); + VerifyOrReturn(CheckValue("supportedModes[0].semanticTags[0].value", iter_2.GetValue().value, 0U)); + VerifyOrReturn(CheckNoMoreListItems( + "supportedModes[0].semanticTags", iter_2, 1)); } VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 1)); VerifyOrReturn( CheckValueAsString("supportedModes[1].label", iter_0.GetValue().label, chip::CharSpan("Cappuccino", 10))); VerifyOrReturn(CheckValue("supportedModes[1].mode", iter_0.GetValue().mode, 4U)); { - auto iter_2 = iter_0.GetValue().modeTags.begin(); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes[1].modeTags", - iter_2, 0)); - VerifyOrReturn(CheckValue("supportedModes[1].modeTags[0].value", iter_2.GetValue().value, 0U)); - VerifyOrReturn( - CheckNoMoreListItems("supportedModes[1].modeTags", iter_2, 1)); + auto iter_2 = iter_0.GetValue().semanticTags.begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "supportedModes[1].semanticTags", iter_2, 0)); + VerifyOrReturn(CheckValue("supportedModes[1].semanticTags[0].value", iter_2.GetValue().value, 0U)); + VerifyOrReturn(CheckNoMoreListItems( + "supportedModes[1].semanticTags", iter_2, 1)); } VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 2)); VerifyOrReturn( CheckValueAsString("supportedModes[2].label", iter_0.GetValue().label, chip::CharSpan("Espresso", 8))); VerifyOrReturn(CheckValue("supportedModes[2].mode", iter_0.GetValue().mode, 7U)); { - auto iter_2 = iter_0.GetValue().modeTags.begin(); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes[2].modeTags", - iter_2, 0)); - VerifyOrReturn(CheckValue("supportedModes[2].modeTags[0].value", iter_2.GetValue().value, 0U)); - VerifyOrReturn( - CheckNoMoreListItems("supportedModes[2].modeTags", iter_2, 1)); + auto iter_2 = iter_0.GetValue().semanticTags.begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "supportedModes[2].semanticTags", iter_2, 0)); + VerifyOrReturn(CheckValue("supportedModes[2].semanticTags[0].value", iter_2.GetValue().value, 0U)); + VerifyOrReturn(CheckNoMoreListItems( + "supportedModes[2].semanticTags", iter_2, 1)); } VerifyOrReturn(CheckNoMoreListItems("supportedModes", iter_0, 3)); } @@ -77419,7 +84977,7 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckConstraintMaxLength("value", value, 3)); } break; - case 3: + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -77427,7 +84985,7 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("currentMode", value, 0U)); } break; - case 4: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -77436,7 +84994,7 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("startUpMode.Value()", value.Value(), 0U)); } break; - case 5: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -77444,10 +85002,10 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValueNull("onMode", value)); } break; - case 6: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 7: + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -77456,16 +85014,16 @@ class TestModeSelectClusterSuite : public TestCommand currentModeBeforeToggle = value; } break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -77473,13 +85031,13 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("currentMode", value, currentModeBeforeToggle)); } break; - case 12: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 13: + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 14: + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -77489,13 +85047,13 @@ class TestModeSelectClusterSuite : public TestCommand OnModeValue = value; } break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -77503,13 +85061,13 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("currentMode", value, OnModeValue)); } break; - case 18: + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 19: + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 20: + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -77518,9 +85076,6 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("startUpMode.Value()", value.Value(), 7U)); } break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; @@ -77529,13 +85084,16 @@ class TestModeSelectClusterSuite : public TestCommand break; case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -77543,18 +85101,18 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("currentMode", value, 4U)); } break; - case 27: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -77590,27 +85148,32 @@ class TestModeSelectClusterSuite : public TestCommand chip::NullOptional); } case 2: { - LogStep(2, "Read SupportedModes"); + LogStep(2, "Read StandardNamespace"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StandardNamespace::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Read SupportedModes"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::SupportedModes::Id, true, chip::NullOptional); } - case 3: { - LogStep(3, "Read CurrentMode"); + case 4: { + LogStep(4, "Read CurrentMode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } - case 4: { - LogStep(4, "Read StartUpMode"); + case 5: { + LogStep(5, "Read StartUpMode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, true, chip::NullOptional); } - case 5: { - LogStep(5, "Read OnMode"); + case 6: { + LogStep(6, "Read OnMode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, true, chip::NullOptional); } - case 6: { - LogStep(6, "Change to Supported Mode"); + case 7: { + LogStep(7, "Change to Supported Mode"); ListFreer listFreer; chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type value; value.newMode = 4U; @@ -77619,13 +85182,13 @@ class TestModeSelectClusterSuite : public TestCommand ); } - case 7: { - LogStep(7, "Verify Current Mode Change"); + case 8: { + LogStep(8, "Verify Current Mode Change"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } - case 8: { - LogStep(8, "Change to Unsupported Mode"); + case 9: { + LogStep(9, "Change to Unsupported Mode"); ListFreer listFreer; chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type value; value.newMode = 2U; @@ -77634,29 +85197,29 @@ class TestModeSelectClusterSuite : public TestCommand ); } - case 9: { - LogStep(9, "Toggle OnOff"); + case 10: { + LogStep(10, "Toggle OnOff"); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional ); } - case 10: { - LogStep(10, "Toggle OnOff"); + case 11: { + LogStep(11, "Toggle OnOff"); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::On::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional ); } - case 11: { - LogStep(11, "Verify Current Mode does not change when OnMode is null"); + case 12: { + LogStep(12, "Verify Current Mode does not change when OnMode is null"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } - case 12: { - LogStep(12, "Change to Unsupported OnMode"); + case 13: { + LogStep(13, "Change to Unsupported OnMode"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -77664,8 +85227,8 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 13: { - LogStep(13, "Change OnMode"); + case 14: { + LogStep(14, "Change OnMode"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -77673,34 +85236,34 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 14: { - LogStep(14, "Verify OnMode"); + case 15: { + LogStep(15, "Verify OnMode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, true, chip::NullOptional); } - case 15: { - LogStep(15, "Toggle OnOff"); + case 16: { + LogStep(16, "Toggle OnOff"); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional ); } - case 16: { - LogStep(16, "Toggle OnOff"); + case 17: { + LogStep(17, "Toggle OnOff"); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::On::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional ); } - case 17: { - LogStep(17, "Verify Current Mode Changes if OnMode is not null"); + case 18: { + LogStep(18, "Verify Current Mode Changes if OnMode is not null"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } - case 18: { - LogStep(18, "Change to Unsupported StartUp Mode"); + case 19: { + LogStep(19, "Change to Unsupported StartUp Mode"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -77708,8 +85271,8 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 19: { - LogStep(19, "Change to Supported StartUp Mode"); + case 20: { + LogStep(20, "Change to Supported StartUp Mode"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -77717,13 +85280,13 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 20: { - LogStep(20, "Verify StartUp Mode Change"); + case 21: { + LogStep(21, "Verify StartUp Mode Change"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, true, chip::NullOptional); } - case 21: { - LogStep(21, "Change CurrentMode to another value"); + case 22: { + LogStep(22, "Change CurrentMode to another value"); ListFreer listFreer; chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type value; value.newMode = 0U; @@ -77732,8 +85295,8 @@ class TestModeSelectClusterSuite : public TestCommand ); } - case 22: { - LogStep(22, "Change On Mode"); + case 23: { + LogStep(23, "Change On Mode"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -77741,8 +85304,8 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 23: { - LogStep(23, "Set StartUpOnOff"); + case 24: { + LogStep(24, "Set StartUpOnOff"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -77750,47 +85313,47 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::StartUpOnOff::Id, value, chip::NullOptional, chip::NullOptional); } - case 24: { - LogStep(24, "Reboot target device"); + case 25: { + LogStep(25, "Reboot target device"); ListFreer listFreer; chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; return Reboot(kIdentityAlpha, value); } - case 25: { - LogStep(25, "Wait for the commissioned device to be retrieved"); + case 26: { + LogStep(26, "Wait for the commissioned device to be retrieved"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee(kIdentityAlpha, value); } - case 26: { - LogStep(26, "Verify Current Mode Change based on OnMode, as it overwrites StartUpMode"); + case 27: { + LogStep(27, "Verify Current Mode Change based on OnMode, as it overwrites StartUpMode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } - case 27: { - LogStep(27, "Change On Mode to Null"); + case 28: { + LogStep(28, "Change On Mode to Null"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNull(); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 28: { - LogStep(28, "Reboot target device"); + case 29: { + LogStep(29, "Reboot target device"); ListFreer listFreer; chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; return Reboot(kIdentityAlpha, value); } - case 29: { - LogStep(29, "Wait for the commissioned device to be retrieved"); + case 30: { + LogStep(30, "Wait for the commissioned device to be retrieved"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee(kIdentityAlpha, value); } - case 30: { - LogStep(30, "Verify Current Mode Change based on new StartUp Mode"); + case 31: { + LogStep(31, "Verify Current Mode Change based on new StartUp Mode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } @@ -127130,6 +134693,26 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), 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 b30091d2b0e58e..a0ad2c6fd475b1 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -77,17 +77,18 @@ | BooleanState | 0x0045 | | IcdManagement | 0x0046 | | ModeSelect | 0x0050 | -| LaundryWasherModeSelect | 0x0051 | -| RefrigeratorAndTemperatureControlledCabinetModeSelect | 0x0052 | +| LaundryWasherMode | 0x0051 | +| RefrigeratorAndTemperatureControlledCabinetMode | 0x0052 | | WasherControls | 0x0053 | -| RvcRunModeSelect | 0x0054 | -| RvcCleanModeSelect | 0x0055 | +| RvcRunMode | 0x0054 | +| RvcCleanMode | 0x0055 | | TemperatureControl | 0x0056 | | RefrigeratorAlarm | 0x0057 | -| DishwasherModeSelect | 0x0059 | +| DishwasherMode | 0x0059 | | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | +| RvcOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -39609,7 +39610,6 @@ class SubscribeAttributeBooleanStateClusterRevision : public SubscribeAttribute |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * Description | 0x0000 | @@ -45032,6 +45032,1056 @@ class SubscribeAttributeOperationalStateClusterRevision : public SubscribeAttrib } }; +/*----------------------------------------------------------------------------*\ +| Cluster RvcOperationalState | 0x0061 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Pause | 0x00 | +| * Stop | 0x01 | +| * Start | 0x02 | +| * Resume | 0x03 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * PhaseList | 0x0000 | +| * CurrentPhase | 0x0001 | +| * CountdownTime | 0x0002 | +| * OperationalStateList | 0x0003 | +| * OperationalState | 0x0004 | +| * OperationalError | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * OperationalError | 0x0000 | +| * OperationCompletion | 0x0001 | +\*----------------------------------------------------------------------------*/ + +/* + * Command Pause + */ +class RvcOperationalStatePause : public ClusterCommand { +public: + RvcOperationalStatePause() + : ClusterCommand("pause") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRVCOperationalStateClusterPauseParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster pauseWithParams:params + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Command Stop + */ +class RvcOperationalStateStop : public ClusterCommand { +public: + RvcOperationalStateStop() + : ClusterCommand("stop") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRVCOperationalStateClusterStopParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster stopWithParams:params + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Command Start + */ +class RvcOperationalStateStart : public ClusterCommand { +public: + RvcOperationalStateStart() + : ClusterCommand("start") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRVCOperationalStateClusterStartParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster startWithParams:params + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Command Resume + */ +class RvcOperationalStateResume : public ClusterCommand { +public: + RvcOperationalStateResume() + : ClusterCommand("resume") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRVCOperationalStateClusterResumeParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster resumeWithParams:params + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Attribute PhaseList + */ +class ReadRvcOperationalStatePhaseList : public ReadAttribute { +public: + ReadRvcOperationalStatePhaseList() + : ReadAttribute("phase-list") + { + } + + ~ReadRvcOperationalStatePhaseList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributePhaseListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.PhaseList response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState PhaseList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStatePhaseList : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStatePhaseList() + : SubscribeAttribute("phase-list") + { + } + + ~SubscribeAttributeRvcOperationalStatePhaseList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributePhaseListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.PhaseList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute CurrentPhase + */ +class ReadRvcOperationalStateCurrentPhase : public ReadAttribute { +public: + ReadRvcOperationalStateCurrentPhase() + : ReadAttribute("current-phase") + { + } + + ~ReadRvcOperationalStateCurrentPhase() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeCurrentPhaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.CurrentPhase response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState CurrentPhase read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStateCurrentPhase : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStateCurrentPhase() + : SubscribeAttribute("current-phase") + { + } + + ~SubscribeAttributeRvcOperationalStateCurrentPhase() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributeCurrentPhaseWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.CurrentPhase response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute CountdownTime + */ +class ReadRvcOperationalStateCountdownTime : public ReadAttribute { +public: + ReadRvcOperationalStateCountdownTime() + : ReadAttribute("countdown-time") + { + } + + ~ReadRvcOperationalStateCountdownTime() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeCountdownTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.CountdownTime response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState CountdownTime read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStateCountdownTime : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStateCountdownTime() + : SubscribeAttribute("countdown-time") + { + } + + ~SubscribeAttributeRvcOperationalStateCountdownTime() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributeCountdownTimeWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.CountdownTime response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalStateList + */ +class ReadRvcOperationalStateOperationalStateList : public ReadAttribute { +public: + ReadRvcOperationalStateOperationalStateList() + : ReadAttribute("operational-state-list") + { + } + + ~ReadRvcOperationalStateOperationalStateList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalStateListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalStateList response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState OperationalStateList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStateOperationalStateList : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStateOperationalStateList() + : SubscribeAttribute("operational-state-list") + { + } + + ~SubscribeAttributeRvcOperationalStateOperationalStateList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributeOperationalStateListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalStateList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalState + */ +class ReadRvcOperationalStateOperationalState : public ReadAttribute { +public: + ReadRvcOperationalStateOperationalState() + : ReadAttribute("operational-state") + { + } + + ~ReadRvcOperationalStateOperationalState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalStateWithCompletion:^( + MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalState response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState OperationalState read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStateOperationalState : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStateOperationalState() + : SubscribeAttribute("operational-state") + { + } + + ~SubscribeAttributeRvcOperationalStateOperationalState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributeOperationalStateWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalState response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalError + */ +class ReadRvcOperationalStateOperationalError : public ReadAttribute { +public: + ReadRvcOperationalStateOperationalError() + : ReadAttribute("operational-error") + { + } + + ~ReadRvcOperationalStateOperationalError() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalErrorWithCompletion:^( + MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalError response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState OperationalError read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStateOperationalError : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStateOperationalError() + : SubscribeAttribute("operational-error") + { + } + + ~SubscribeAttributeRvcOperationalStateOperationalError() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributeOperationalErrorWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalError response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadRvcOperationalStateGeneratedCommandList : public ReadAttribute { +public: + ReadRvcOperationalStateGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadRvcOperationalStateGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.GeneratedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState GeneratedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStateGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStateGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeRvcOperationalStateGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.GeneratedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadRvcOperationalStateAcceptedCommandList : public ReadAttribute { +public: + ReadRvcOperationalStateAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadRvcOperationalStateAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.AcceptedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState AcceptedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStateAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStateAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeRvcOperationalStateAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.AcceptedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute EventList + */ +class ReadRvcOperationalStateEventList : public ReadAttribute { +public: + ReadRvcOperationalStateEventList() + : ReadAttribute("event-list") + { + } + + ~ReadRvcOperationalStateEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFA) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.EventList response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState EventList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStateEventList : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStateEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeRvcOperationalStateEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFA) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.EventList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AttributeList + */ +class ReadRvcOperationalStateAttributeList : public ReadAttribute { +public: + ReadRvcOperationalStateAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadRvcOperationalStateAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.AttributeList response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState AttributeList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStateAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStateAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeRvcOperationalStateAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.AttributeList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute FeatureMap + */ +class ReadRvcOperationalStateFeatureMap : public ReadAttribute { +public: + ReadRvcOperationalStateFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadRvcOperationalStateFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.FeatureMap response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState FeatureMap read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStateFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStateFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeRvcOperationalStateFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.FeatureMap response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadRvcOperationalStateClusterRevision : public ReadAttribute { +public: + ReadRvcOperationalStateClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadRvcOperationalStateClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.ClusterRevision response %@", [value description]); + if (error != nil) { + LogNSError("RVCOperationalState ClusterRevision read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRvcOperationalStateClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeRvcOperationalStateClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeRvcOperationalStateClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState 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 subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.ClusterRevision response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + /*----------------------------------------------------------------------------*\ | Cluster HepaFilterMonitoring | 0x0071 | |------------------------------------------------------------------------------| @@ -122595,6 +123645,51 @@ void registerClusterOperationalState(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterRvcOperationalState(Commands & commands) +{ + using namespace chip::app::Clusters::RvcOperationalState; + + const char * clusterName = "RvcOperationalState"; + + commands_list clusterCommands = { + make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(Id), // + make_unique(), // + make_unique(Id), // + make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(Id), // + make_unique(Id), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterHepaFilterMonitoring(Commands & commands) { using namespace chip::app::Clusters::HepaFilterMonitoring; @@ -125301,6 +126396,7 @@ void registerClusters(Commands & commands) registerClusterAirQuality(commands); registerClusterSmokeCoAlarm(commands); registerClusterOperationalState(commands); + registerClusterRvcOperationalState(commands); registerClusterHepaFilterMonitoring(commands); registerClusterActivatedCarbonFilterMonitoring(commands); registerClusterDoorLock(commands); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 019717e676f697..908c734985d6c9 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -66,6 +66,26 @@ class TestList : public Command { printf("Test_TC_CC_7_4\n"); printf("TestColorControl_9_1\n"); printf("TestColorControl_9_2\n"); + printf("Test_TC_CDOCONC_1_1\n"); + printf("Test_TC_CDOCONC_2_1\n"); + printf("Test_TC_CMOCONC_1_1\n"); + printf("Test_TC_CMOCONC_2_1\n"); + printf("Test_TC_FLDCONC_1_1\n"); + printf("Test_TC_FLDCONC_2_1\n"); + printf("Test_TC_NDOCONC_1_1\n"); + printf("Test_TC_NDOCONC_2_1\n"); + printf("Test_TC_OZCONC_1_1\n"); + printf("Test_TC_OZCONC_2_1\n"); + printf("Test_TC_PMHCONC_1_1\n"); + printf("Test_TC_PMHCONC_2_1\n"); + printf("Test_TC_PMICONC_1_1\n"); + printf("Test_TC_PMICONC_2_1\n"); + printf("Test_TC_PMKCONC_1_1\n"); + printf("Test_TC_PMKCONC_2_1\n"); + printf("Test_TC_RNCONC_1_1\n"); + printf("Test_TC_RNCONC_2_1\n"); + printf("Test_TC_TVOCCONC_1_1\n"); + printf("Test_TC_TVOCCONC_2_1\n"); printf("Test_TC_OPCREDS_1_2\n"); printf("Test_TC_BINFO_1_1\n"); printf("Test_TC_CNET_1_3\n"); @@ -26826,6 +26846,15091 @@ class TestColorControl_9_2 : public TestCommandBridge { } }; +class Test_TC_CDOCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CDOCONC_1_1() + : TestCommandBridge("Test_TC_CDOCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CDOCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CDOCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CDOCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("CDOCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given CDOCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given CDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given CDOCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given CDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given CDOCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given CDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given CDOCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given CDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given CDOCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given CDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given CDOCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given CDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.A0007 && CDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "CDOCONC.S.A0007 is not set\n"); + if (ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenCdoconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when CDOCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenCdoconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "CDOCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenCdoconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when CDOCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenCdoconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when CDOCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenCdoconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("CDOCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("CDOCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("CDOCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenCdoconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when CDOCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenCdoconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when CDOCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenCdoconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when CDOCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenCdoconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"CDOCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenCdoconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when CDOCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CDOCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CDOCONC_2_1() + : TestCommandBridge("Test_TC_CDOCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CDOCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CDOCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CDOCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CMOCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CMOCONC_1_1() + : TestCommandBridge("Test_TC_CMOCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CMOCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CMOCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CMOCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("CMOCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given CMOCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given CMOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given CMOCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given CMOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given CMOCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given CMOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given CMOCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given CMOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given CMOCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given CMOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given CMOCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given CMOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.A0007 && CMOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "CMOCONC.S.A0007 is not set\n"); + if (ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenCmoconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when CMOCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenCmoconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "CMOCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenCmoconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when CMOCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenCmoconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when CMOCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenCmoconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("CMOCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("CMOCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("CMOCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenCmoconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when CMOCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenCmoconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when CMOCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenCmoconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when CMOCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenCmoconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"CMOCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenCmoconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when CMOCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CMOCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CMOCONC_2_1() + : TestCommandBridge("Test_TC_CMOCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CMOCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CMOCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CMOCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLDCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_FLDCONC_1_1() + : TestCommandBridge("Test_TC_FLDCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_FLDCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLDCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLDCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("FLDCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given FLDCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenFldconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given FLDCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenFldconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given FLDCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenFldconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given FLDCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenFldconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given FLDCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenFldconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given FLDCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenFldconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given FLDCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenFldconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given FLDCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenFldconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given FLDCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenFldconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given FLDCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenFldconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given FLDCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenFldconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given FLDCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenFldconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.A0007 && FLDCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "FLDCONC.S.A0007 is not set\n"); + if (ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenFldconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when FLDCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenFldconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "FLDCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenFldconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when FLDCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenFldconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when FLDCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenFldconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("FLDCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("FLDCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("FLDCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenFldconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when FLDCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenFldconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when FLDCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenFldconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when FLDCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenFldconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"FLDCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenFldconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when FLDCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLDCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_FLDCONC_2_1() + : TestCommandBridge("Test_TC_FLDCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_FLDCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLDCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLDCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_NDOCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_NDOCONC_1_1() + : TestCommandBridge("Test_TC_NDOCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_NDOCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_NDOCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_NDOCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("NDOCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given NDOCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given NDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given NDOCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given NDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given NDOCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given NDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given NDOCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given NDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given NDOCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given NDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given NDOCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given NDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.A0007 && NDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "NDOCONC.S.A0007 is not set\n"); + if (ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenNdoconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when NDOCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenNdoconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "NDOCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenNdoconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when NDOCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenNdoconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when NDOCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenNdoconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("NDOCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("NDOCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("NDOCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenNdoconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when NDOCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenNdoconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when NDOCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenNdoconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when NDOCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenNdoconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"NDOCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenNdoconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when NDOCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_NDOCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_NDOCONC_2_1() + : TestCommandBridge("Test_TC_NDOCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_NDOCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_NDOCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_NDOCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OZCONC_1_1() + : TestCommandBridge("Test_TC_OZCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_OZCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OZCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OZCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("OZCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given OZCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenOzconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given OZCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenOzconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given OZCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenOzconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : Given OZCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenOzconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given OZCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenOzconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : Given OZCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenOzconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given OZCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenOzconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Given OZCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenOzconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Given OZCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenOzconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given OZCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenOzconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Given OZCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenOzconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given OZCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenOzconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb && OZCONC.S.A0007 && OZCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when OZCONC.S.A0007 " + "is not set\n"); + if (ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenOzconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when OZCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenOzconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "OZCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenOzconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when OZCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenOzconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when OZCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenOzconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("OZCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("OZCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("OZCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenOzconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Check the optional attribute Uncertainty is excluded from AttributeList when OZCONC.S.A0007 is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenOzconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when OZCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenOzconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when OZCONC.S.F04 (PEA) " + @"is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenOzconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"OZCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenOzconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when OZCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OZCONC_2_1() + : TestCommandBridge("Test_TC_OZCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_OZCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OZCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OZCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("OZCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("OZCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("OZCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("OZCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMHCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMHCONC_1_1() + : TestCommandBridge("Test_TC_PMHCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMHCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMHCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMHCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("PMHCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given PMHCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given PMHCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given PMHCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given PMHCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given PMHCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given PMHCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given PMHCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given PMHCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given PMHCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given PMHCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given PMHCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given PMHCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.A0007 && PMHCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "PMHCONC.S.A0007 is not set\n"); + if (ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmhconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when PMHCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmhconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "PMHCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmhconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when PMHCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmhconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when PMHCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmhconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("PMHCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PMHCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PMHCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmhconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when PMHCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmhconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when PMHCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmhconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMHCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmhconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"PMHCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmhconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when PMHCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMHCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMHCONC_2_1() + : TestCommandBridge("Test_TC_PMHCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMHCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMHCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMHCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMICONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMICONC_1_1() + : TestCommandBridge("Test_TC_PMICONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMICONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMICONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMICONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("PMICONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given PMICONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given PMICONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given PMICONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given PMICONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given PMICONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given PMICONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given PMICONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given PMICONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given PMICONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given PMICONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given PMICONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given PMICONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb && PMICONC.S.A0007 && PMICONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "PMICONC.S.A0007 is not set\n"); + if (ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmiconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when PMICONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmiconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "PMICONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmiconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when PMICONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmiconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when PMICONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmiconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("PMICONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PMICONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PMICONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmiconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when PMICONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmiconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when PMICONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmiconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMICONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmiconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"PMICONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmiconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when PMICONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMICONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMICONC_2_1() + : TestCommandBridge("Test_TC_PMICONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMICONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMICONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMICONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMICONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMICONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("PMICONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("PMICONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMKCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMKCONC_1_1() + : TestCommandBridge("Test_TC_PMKCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMKCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMKCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMKCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("PMKCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given PMKCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given PMKCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given PMKCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given PMKCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given PMKCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given PMKCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given PMKCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given PMKCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given PMKCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given PMKCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given PMKCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given PMKCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.A0007 && PMKCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "PMKCONC.S.A0007 is not set\n"); + if (ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmkconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when PMKCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmkconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "PMKCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmkconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when PMKCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmkconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when PMKCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmkconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("PMKCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PMKCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PMKCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmkconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when PMKCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmkconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when PMKCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmkconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMKCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmkconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"PMKCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmkconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when PMKCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMKCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMKCONC_2_1() + : TestCommandBridge("Test_TC_PMKCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMKCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMKCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMKCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RNCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_RNCONC_1_1() + : TestCommandBridge("Test_TC_RNCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_RNCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RNCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RNCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("RNCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given RNCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenRnconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given RNCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenRnconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given RNCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenRnconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : Given RNCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenRnconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given RNCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenRnconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : Given RNCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenRnconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given RNCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenRnconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Given RNCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenRnconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Given RNCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenRnconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given RNCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenRnconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Given RNCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenRnconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given RNCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenRnconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb && RNCONC.S.A0007 && RNCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when RNCONC.S.A0007 " + "is not set\n"); + if (ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenRnconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when RNCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenRnconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "RNCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenRnconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when RNCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenRnconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when RNCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenRnconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("RNCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("RNCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("RNCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenRnconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Check the optional attribute Uncertainty is excluded from AttributeList when RNCONC.S.A0007 is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenRnconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when RNCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenRnconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when RNCONC.S.F04 (PEA) " + @"is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenRnconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"RNCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenRnconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when RNCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RNCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_RNCONC_2_1() + : TestCommandBridge("Test_TC_RNCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_RNCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RNCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RNCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("RNCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("RNCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("RNCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("RNCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TVOCCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TVOCCONC_1_1() + : TestCommandBridge("Test_TC_TVOCCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TVOCCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TVOCCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TVOCCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("TVOCCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given TVOCCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given TVOCCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given TVOCCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given TVOCCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given TVOCCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given TVOCCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress( + chipTool, " ***** Test Step 8 : Given TVOCCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given TVOCCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given TVOCCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given TVOCCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given TVOCCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given TVOCCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.A0007 && TVOCCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "TVOCCONC.S.A0007 is not set\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenTvocconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when TVOCCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenTvocconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "TVOCCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenTvocconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when TVOCCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenTvocconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when TVOCCONC.S.F01 (LEV) is not " + "set\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenTvocconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("TVOCCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("TVOCCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("TVOCCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenTvocconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when TVOCCONC.S.A0007 is not set " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenTvocconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when TVOCCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenTvocconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when TVOCCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenTvocconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"TVOCCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenTvocconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when TVOCCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TVOCCONC_2_1() + : TestCommandBridge("Test_TC_TVOCCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TVOCCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TVOCCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TVOCCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_OPCREDS_1_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -112147,121 +127252,125 @@ class TestModeSelectCluster : public TestCommandBridge { err = TestReadDescription_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read SupportedModes\n"); - err = TestReadSupportedModes_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read StandardNamespace\n"); + err = TestReadStandardNamespace_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentMode\n"); - err = TestReadCurrentMode_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read SupportedModes\n"); + err = TestReadSupportedModes_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read StartUpMode\n"); - err = TestReadStartUpMode_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentMode\n"); + err = TestReadCurrentMode_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read OnMode\n"); - err = TestReadOnMode_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read StartUpMode\n"); + err = TestReadStartUpMode_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Change to Supported Mode\n"); - err = TestChangeToSupportedMode_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read OnMode\n"); + err = TestReadOnMode_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Verify Current Mode Change\n"); - err = TestVerifyCurrentModeChange_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Change to Supported Mode\n"); + err = TestChangeToSupportedMode_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Change to Unsupported Mode\n"); - err = TestChangeToUnsupportedMode_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Verify Current Mode Change\n"); + err = TestVerifyCurrentModeChange_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Toggle OnOff\n"); - err = TestToggleOnOff_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Change to Unsupported Mode\n"); + err = TestChangeToUnsupportedMode_9(); break; case 10: ChipLogProgress(chipTool, " ***** Test Step 10 : Toggle OnOff\n"); err = TestToggleOnOff_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Verify Current Mode does not change when OnMode is null\n"); - err = TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Toggle OnOff\n"); + err = TestToggleOnOff_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Change to Unsupported OnMode\n"); - err = TestChangeToUnsupportedOnMode_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Verify Current Mode does not change when OnMode is null\n"); + err = TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Change OnMode\n"); - err = TestChangeOnMode_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Change to Unsupported OnMode\n"); + err = TestChangeToUnsupportedOnMode_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Verify OnMode\n"); - err = TestVerifyOnMode_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Change OnMode\n"); + err = TestChangeOnMode_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Toggle OnOff\n"); - err = TestToggleOnOff_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Verify OnMode\n"); + err = TestVerifyOnMode_15(); break; case 16: ChipLogProgress(chipTool, " ***** Test Step 16 : Toggle OnOff\n"); err = TestToggleOnOff_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Verify Current Mode Changes if OnMode is not null\n"); - err = TestVerifyCurrentModeChangesIfOnModeIsNotNull_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Toggle OnOff\n"); + err = TestToggleOnOff_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Change to Unsupported StartUp Mode\n"); - err = TestChangeToUnsupportedStartUpMode_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Verify Current Mode Changes if OnMode is not null\n"); + err = TestVerifyCurrentModeChangesIfOnModeIsNotNull_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Change to Supported StartUp Mode\n"); - err = TestChangeToSupportedStartUpMode_19(); + ChipLogProgress(chipTool, " ***** Test Step 19 : Change to Unsupported StartUp Mode\n"); + err = TestChangeToUnsupportedStartUpMode_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Verify StartUp Mode Change\n"); - err = TestVerifyStartUpModeChange_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : Change to Supported StartUp Mode\n"); + err = TestChangeToSupportedStartUpMode_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Change CurrentMode to another value\n"); - err = TestChangeCurrentModeToAnotherValue_21(); + ChipLogProgress(chipTool, " ***** Test Step 21 : Verify StartUp Mode Change\n"); + err = TestVerifyStartUpModeChange_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Change On Mode\n"); - err = TestChangeOnMode_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Change CurrentMode to another value\n"); + err = TestChangeCurrentModeToAnotherValue_22(); break; case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Set StartUpOnOff\n"); - err = TestSetStartUpOnOff_23(); + ChipLogProgress(chipTool, " ***** Test Step 23 : Change On Mode\n"); + err = TestChangeOnMode_23(); break; case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Reboot target device\n"); - err = TestRebootTargetDevice_24(); + ChipLogProgress(chipTool, " ***** Test Step 24 : Set StartUpOnOff\n"); + err = TestSetStartUpOnOff_24(); break; case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_25(); + ChipLogProgress(chipTool, " ***** Test Step 25 : Reboot target device\n"); + err = TestRebootTargetDevice_25(); break; case 26: - ChipLogProgress( - chipTool, " ***** Test Step 26 : Verify Current Mode Change based on OnMode, as it overwrites StartUpMode\n"); - err = TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_26(); + ChipLogProgress(chipTool, " ***** Test Step 26 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_26(); break; case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Change On Mode to Null\n"); - err = TestChangeOnModeToNull_27(); + ChipLogProgress( + chipTool, " ***** Test Step 27 : Verify Current Mode Change based on OnMode, as it overwrites StartUpMode\n"); + err = TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_27(); break; case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Reboot target device\n"); - err = TestRebootTargetDevice_28(); + ChipLogProgress(chipTool, " ***** Test Step 28 : Change On Mode to Null\n"); + err = TestChangeOnModeToNull_28(); break; case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_29(); + ChipLogProgress(chipTool, " ***** Test Step 29 : Reboot target device\n"); + err = TestRebootTargetDevice_29(); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Verify Current Mode Change based on new StartUp Mode\n"); - err = TestVerifyCurrentModeChangeBasedOnNewStartUpMode_30(); + ChipLogProgress(chipTool, " ***** Test Step 30 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Verify Current Mode Change based on new StartUp Mode\n"); + err = TestVerifyCurrentModeChangeBasedOnNewStartUpMode_31(); break; } @@ -112299,10 +127408,10 @@ class TestModeSelectCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -112311,10 +127420,10 @@ class TestModeSelectCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -112329,10 +127438,10 @@ class TestModeSelectCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -112367,6 +127476,9 @@ class TestModeSelectCluster : public TestCommandBridge { case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -112380,7 +127492,7 @@ class TestModeSelectCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 31; + const uint16_t mTestCount = 32; chip::Optional mNodeId; chip::Optional mCluster; @@ -112418,7 +127530,31 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadSupportedModes_2() + CHIP_ERROR TestReadStandardNamespace_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStandardNamespaceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read StandardNamespace Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StandardNamespace", actualValue)); + VerifyOrReturn(CheckValue("StandardNamespace", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadSupportedModes_3() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112436,28 +127572,31 @@ class TestModeSelectCluster : public TestCommandBridge { VerifyOrReturn( CheckValueAsString("Label", ((MTRModeSelectClusterModeOptionStruct *) actualValue[0]).label, @"Black")); VerifyOrReturn(CheckValue("Mode", ((MTRModeSelectClusterModeOptionStruct *) actualValue[0]).mode, 0U)); - VerifyOrReturn(CheckValue("ModeTags", [((MTRModeSelectClusterModeOptionStruct *) actualValue[0]).modeTags count], - static_cast(1))); + VerifyOrReturn(CheckValue("SemanticTags", + [((MTRModeSelectClusterModeOptionStruct *) actualValue[0]).semanticTags count], static_cast(1))); VerifyOrReturn(CheckValue("Value", - ((MTRModeSelectClusterModeTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[0]).modeTags[0]) + ((MTRModeSelectClusterSemanticTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[0]) + .semanticTags[0]) .value, 0U)); VerifyOrReturn( CheckValueAsString("Label", ((MTRModeSelectClusterModeOptionStruct *) actualValue[1]).label, @"Cappuccino")); VerifyOrReturn(CheckValue("Mode", ((MTRModeSelectClusterModeOptionStruct *) actualValue[1]).mode, 4U)); - VerifyOrReturn(CheckValue("ModeTags", [((MTRModeSelectClusterModeOptionStruct *) actualValue[1]).modeTags count], - static_cast(1))); + VerifyOrReturn(CheckValue("SemanticTags", + [((MTRModeSelectClusterModeOptionStruct *) actualValue[1]).semanticTags count], static_cast(1))); VerifyOrReturn(CheckValue("Value", - ((MTRModeSelectClusterModeTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[1]).modeTags[0]) + ((MTRModeSelectClusterSemanticTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[1]) + .semanticTags[0]) .value, 0U)); VerifyOrReturn( CheckValueAsString("Label", ((MTRModeSelectClusterModeOptionStruct *) actualValue[2]).label, @"Espresso")); VerifyOrReturn(CheckValue("Mode", ((MTRModeSelectClusterModeOptionStruct *) actualValue[2]).mode, 7U)); - VerifyOrReturn(CheckValue("ModeTags", [((MTRModeSelectClusterModeOptionStruct *) actualValue[2]).modeTags count], - static_cast(1))); + VerifyOrReturn(CheckValue("SemanticTags", + [((MTRModeSelectClusterModeOptionStruct *) actualValue[2]).semanticTags count], static_cast(1))); VerifyOrReturn(CheckValue("Value", - ((MTRModeSelectClusterModeTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[2]).modeTags[0]) + ((MTRModeSelectClusterSemanticTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[2]) + .semanticTags[0]) .value, 0U)); } @@ -112471,7 +127610,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadCurrentMode_3() + CHIP_ERROR TestReadCurrentMode_4() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112494,7 +127633,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadStartUpMode_4() + CHIP_ERROR TestReadStartUpMode_5() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112518,7 +127657,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadOnMode_5() + CHIP_ERROR TestReadOnMode_6() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112541,7 +127680,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToSupportedMode_6() + CHIP_ERROR TestChangeToSupportedMode_7() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112563,7 +127702,7 @@ class TestModeSelectCluster : public TestCommandBridge { } NSNumber * _Nonnull currentModeBeforeToggle; - CHIP_ERROR TestVerifyCurrentModeChange_7() + CHIP_ERROR TestVerifyCurrentModeChange_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112589,7 +127728,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToUnsupportedMode_8() + CHIP_ERROR TestChangeToUnsupportedMode_9() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112613,7 +127752,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestToggleOnOff_9() + CHIP_ERROR TestToggleOnOff_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112631,7 +127770,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestToggleOnOff_10() + CHIP_ERROR TestToggleOnOff_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112649,7 +127788,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_11() + CHIP_ERROR TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112672,7 +127811,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToUnsupportedOnMode_12() + CHIP_ERROR TestChangeToUnsupportedOnMode_13() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112697,7 +127836,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeOnMode_13() + CHIP_ERROR TestChangeOnMode_14() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112719,7 +127858,7 @@ class TestModeSelectCluster : public TestCommandBridge { } NSNumber * _Nullable OnModeValue; - CHIP_ERROR TestVerifyOnMode_14() + CHIP_ERROR TestVerifyOnMode_15() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112746,7 +127885,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestToggleOnOff_15() + CHIP_ERROR TestToggleOnOff_16() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112764,7 +127903,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestToggleOnOff_16() + CHIP_ERROR TestToggleOnOff_17() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112782,7 +127921,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCurrentModeChangesIfOnModeIsNotNull_17() + CHIP_ERROR TestVerifyCurrentModeChangesIfOnModeIsNotNull_18() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112805,7 +127944,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToUnsupportedStartUpMode_18() + CHIP_ERROR TestChangeToUnsupportedStartUpMode_19() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112830,7 +127969,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToSupportedStartUpMode_19() + CHIP_ERROR TestChangeToSupportedStartUpMode_20() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112851,7 +127990,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyStartUpModeChange_20() + CHIP_ERROR TestVerifyStartUpModeChange_21() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112875,7 +128014,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeCurrentModeToAnotherValue_21() + CHIP_ERROR TestChangeCurrentModeToAnotherValue_22() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112896,7 +128035,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeOnMode_22() + CHIP_ERROR TestChangeOnMode_23() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112917,7 +128056,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSetStartUpOnOff_23() + CHIP_ERROR TestSetStartUpOnOff_24() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112938,14 +128077,14 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDevice_24() + CHIP_ERROR TestRebootTargetDevice_25() { chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; return Reboot("alpha", value); } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_25() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_26() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; @@ -112953,7 +128092,7 @@ class TestModeSelectCluster : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_26() + CHIP_ERROR TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_27() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112976,7 +128115,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeOnModeToNull_27() + CHIP_ERROR TestChangeOnModeToNull_28() { MTRBaseDevice * device = GetDevice("alpha"); @@ -112997,14 +128136,14 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDevice_28() + CHIP_ERROR TestRebootTargetDevice_29() { chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; return Reboot("alpha", value); } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_29() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_30() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; @@ -113012,7 +128151,7 @@ class TestModeSelectCluster : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestVerifyCurrentModeChangeBasedOnNewStartUpMode_30() + CHIP_ERROR TestVerifyCurrentModeChangeBasedOnNewStartUpMode_31() { MTRBaseDevice * device = GetDevice("alpha"); @@ -147995,6 +163134,26 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),