diff --git a/.gitignore b/.gitignore index 21a01b1000a779..4c17bb63a84a8c 100644 --- a/.gitignore +++ b/.gitignore @@ -80,4 +80,3 @@ examples/thermostat/ameba/build # https://github.com/espressif/idf-component-manager#using-with-a-project examples/*/esp32/managed_components examples/*/esp32/dependencies.lock -examples/all-clusters-app/all-clusters-common/all-clusters-app.zap.old 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 b6947874bb7010..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 @@ -4344,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; @@ -4391,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; @@ -4492,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; @@ -4657,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; @@ -4701,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; @@ -6595,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; } @@ -6638,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; } @@ -6668,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; @@ -6698,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/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/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/chip/operational-state-rvc-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml index c568f3f873871f..94c10eb297a5d3 100644 --- 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 @@ -38,7 +38,7 @@ limitations under the License. Robots - Robotic Vacuum Operational State + RVC Operational State 0x0061 OPERATIONAL_STATE_RVC_CLUSTER true 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 4a2a32f3c62005..07eca6ae3db3d3 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -303,10 +303,7 @@ ], "Temperature Control": ["SupportedTemperatureLevels"], "Operational State": ["OperationalState", "OperationalError"], - "Robotic Vacuum 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 d02de77d1c3bdf..24cc5cb2c4a6d1 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -301,10 +301,7 @@ ], "Temperature Control": ["SupportedTemperatureLevels"], "Operational State": ["OperationalState", "OperationalError"], - "Robotic Vacuum Operational State": [ - "OperationalState", - "OperationalError" - ] + "RVC Operational State": ["OperationalState", "OperationalError"] }, "defaultReportingPolicy": "mandatory", "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index 188be307a9a8a7..22f59e0292cb80 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -242,8 +242,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/RefrigeratorAndTemperatureControlledCabinetModeClient-ReadImpl.cpp", "jni/RelativeHumidityMeasurementClient-InvokeSubscribeImpl.cpp", "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", - "jni/RoboticVacuumOperationalStateClient-InvokeSubscribeImpl.cpp", - "jni/RoboticVacuumOperationalStateClient-ReadImpl.cpp", + "jni/RvcOperationalStateClient-InvokeSubscribeImpl.cpp", + "jni/RvcOperationalStateClient-ReadImpl.cpp", "jni/RvcCleanModeClient-InvokeSubscribeImpl.cpp", "jni/RvcCleanModeClient-ReadImpl.cpp", "jni/RvcRunModeClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 5681eef8cad565..a160909ea05ff4 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3321,7 +3321,7 @@ client cluster OperationalState = 96 { } /** This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ -client cluster RoboticVacuumOperationalState = 97 { +client cluster RvcOperationalState = 97 { enum ErrorStateEnum : ENUM8 { kFailedToFindChargingDock = 64; kStuck = 65; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index fb3554f086abd5..4f78819037b7ef 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -13096,7 +13096,7 @@ ] }, { - "name": "Robotic Vacuum Operational State", + "name": "RVC Operational State", "code": 97, "mfgCode": null, "define": "OPERATIONAL_STATE_RVC_CLUSTER", @@ -13172,7 +13172,7 @@ ] }, { - "name": "Robotic Vacuum Operational State", + "name": "RVC Operational State", "code": 97, "mfgCode": null, "define": "OPERATIONAL_STATE_RVC_CLUSTER", diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index b23c4812e8480b..3cd260b9e1aaf9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -187,8 +187,8 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == OperationalState.ID) { return new OperationalState(); } - if (clusterId == RoboticVacuumOperationalState.ID) { - return new RoboticVacuumOperationalState(); + if (clusterId == RvcOperationalState.ID) { + return new RvcOperationalState(); } if (clusterId == HepaFilterMonitoring.ID) { return new HepaFilterMonitoring(); @@ -7596,7 +7596,7 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class RoboticVacuumOperationalState implements BaseCluster { + public static class RvcOperationalState implements BaseCluster { public static final long ID = 97L; public long getID() { return ID; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index f327c57fb67a24..3faa2661db449f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -7365,117 +7365,117 @@ private static Map readOperationalStateInteractionInfo( return result; } - private static Map readRoboticVacuumOperationalStateInteractionInfo() { - Map result = new LinkedHashMap<>();Map readRoboticVacuumOperationalStatePhaseListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStatePhaseListAttributeInteractionInfo = new InteractionInfo( + private static Map readRvcOperationalStateInteractionInfo() { + Map result = new LinkedHashMap<>();Map readRvcOperationalStatePhaseListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStatePhaseListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readPhaseListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.PhaseListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readPhaseListAttribute( + (ChipClusters.RvcOperationalStateCluster.PhaseListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterPhaseListAttributeCallback(), - readRoboticVacuumOperationalStatePhaseListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterPhaseListAttributeCallback(), + readRvcOperationalStatePhaseListCommandParams ); - result.put("readPhaseListAttribute", readRoboticVacuumOperationalStatePhaseListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateCurrentPhaseCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateCurrentPhaseAttributeInteractionInfo = new InteractionInfo( + result.put("readPhaseListAttribute", readRvcOperationalStatePhaseListAttributeInteractionInfo); + Map readRvcOperationalStateCurrentPhaseCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateCurrentPhaseAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readCurrentPhaseAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.CurrentPhaseAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readCurrentPhaseAttribute( + (ChipClusters.RvcOperationalStateCluster.CurrentPhaseAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterCurrentPhaseAttributeCallback(), - readRoboticVacuumOperationalStateCurrentPhaseCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterCurrentPhaseAttributeCallback(), + readRvcOperationalStateCurrentPhaseCommandParams ); - result.put("readCurrentPhaseAttribute", readRoboticVacuumOperationalStateCurrentPhaseAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateCountdownTimeCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateCountdownTimeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentPhaseAttribute", readRvcOperationalStateCurrentPhaseAttributeInteractionInfo); + Map readRvcOperationalStateCountdownTimeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateCountdownTimeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readCountdownTimeAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.CountdownTimeAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readCountdownTimeAttribute( + (ChipClusters.RvcOperationalStateCluster.CountdownTimeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterCountdownTimeAttributeCallback(), - readRoboticVacuumOperationalStateCountdownTimeCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterCountdownTimeAttributeCallback(), + readRvcOperationalStateCountdownTimeCommandParams ); - result.put("readCountdownTimeAttribute", readRoboticVacuumOperationalStateCountdownTimeAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateOperationalStateListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateOperationalStateListAttributeInteractionInfo = new InteractionInfo( + result.put("readCountdownTimeAttribute", readRvcOperationalStateCountdownTimeAttributeInteractionInfo); + Map readRvcOperationalStateOperationalStateListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateOperationalStateListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readOperationalStateListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.OperationalStateListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readOperationalStateListAttribute( + (ChipClusters.RvcOperationalStateCluster.OperationalStateListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterOperationalStateListAttributeCallback(), - readRoboticVacuumOperationalStateOperationalStateListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterOperationalStateListAttributeCallback(), + readRvcOperationalStateOperationalStateListCommandParams ); - result.put("readOperationalStateListAttribute", readRoboticVacuumOperationalStateOperationalStateListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOperationalStateListAttribute", readRvcOperationalStateOperationalStateListAttributeInteractionInfo); + Map readRvcOperationalStateGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.RvcOperationalStateCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterGeneratedCommandListAttributeCallback(), - readRoboticVacuumOperationalStateGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterGeneratedCommandListAttributeCallback(), + readRvcOperationalStateGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readRoboticVacuumOperationalStateGeneratedCommandListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readRvcOperationalStateGeneratedCommandListAttributeInteractionInfo); + Map readRvcOperationalStateAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.RvcOperationalStateCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterAcceptedCommandListAttributeCallback(), - readRoboticVacuumOperationalStateAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterAcceptedCommandListAttributeCallback(), + readRvcOperationalStateAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readRoboticVacuumOperationalStateAcceptedCommandListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateEventListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readRvcOperationalStateAcceptedCommandListAttributeInteractionInfo); + Map readRvcOperationalStateEventListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readEventListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.EventListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readEventListAttribute( + (ChipClusters.RvcOperationalStateCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterEventListAttributeCallback(), - readRoboticVacuumOperationalStateEventListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterEventListAttributeCallback(), + readRvcOperationalStateEventListCommandParams ); - result.put("readEventListAttribute", readRoboticVacuumOperationalStateEventListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readRvcOperationalStateEventListAttributeInteractionInfo); + Map readRvcOperationalStateAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readAttributeListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.AttributeListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readAttributeListAttribute( + (ChipClusters.RvcOperationalStateCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterAttributeListAttributeCallback(), - readRoboticVacuumOperationalStateAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterAttributeListAttributeCallback(), + readRvcOperationalStateAttributeListCommandParams ); - result.put("readAttributeListAttribute", readRoboticVacuumOperationalStateAttributeListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readRvcOperationalStateAttributeListAttributeInteractionInfo); + Map readRvcOperationalStateFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.RvcOperationalStateCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readRoboticVacuumOperationalStateFeatureMapCommandParams + readRvcOperationalStateFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readRoboticVacuumOperationalStateFeatureMapAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readRvcOperationalStateFeatureMapAttributeInteractionInfo); + Map readRvcOperationalStateClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.RvcOperationalStateCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRoboticVacuumOperationalStateClusterRevisionCommandParams + readRvcOperationalStateClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readRoboticVacuumOperationalStateClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readRvcOperationalStateClusterRevisionAttributeInteractionInfo); return result; } @@ -23281,7 +23281,7 @@ public Map> getReadAttributeMap() { put("airQuality", readAirQualityInteractionInfo()); put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo()); put("operationalState", readOperationalStateInteractionInfo()); - put("roboticVacuumOperationalState", readRoboticVacuumOperationalStateInteractionInfo()); + 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 53c26c46cb0ed4..a3e32eb5a39671 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -1078,8 +1078,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("smokeCoAlarm", writeSmokeCoAlarmInteractionInfo); Map writeOperationalStateInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("operationalState", writeOperationalStateInteractionInfo); - Map writeRoboticVacuumOperationalStateInteractionInfo = new LinkedHashMap<>(); - writeAttributeMap.put("roboticVacuumOperationalState", writeRoboticVacuumOperationalStateInteractionInfo); + 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/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 647aa3a0f6ef93..12585d03b60a16 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -15139,8 +15139,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::RoboticVacuumOperationalState::Id: { - using namespace app::Clusters::RoboticVacuumOperationalState; + case app::Clusters::RvcOperationalState::Id: { + using namespace app::Clusters::RvcOperationalState; switch (aPath.mAttributeId) { case Attributes::PhaseList::Id: { @@ -15253,20 +15253,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jclass operationalStateStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", operationalStateStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + 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$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); return nullptr; } @@ -15307,19 +15305,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jclass operationalStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", operationalStateStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + 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$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); return nullptr; } @@ -15369,18 +15366,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jclass errorStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", - errorStateStructStructClass_0); + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + 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$RoboticVacuumOperationalStateClusterErrorStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); return nullptr; } diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index fbaaee694dd99e..9e3c8a92513186 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -591,19 +591,19 @@ typedef void (*OperationalStateEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStatePhaseListListAttributeCallback)( +typedef void (*RvcOperationalStatePhaseListListAttributeCallback)( void * context, const chip::app::DataModel::Nullable> & data); -typedef void (*RoboticVacuumOperationalStateOperationalStateListListAttributeCallback)( +typedef void (*RvcOperationalStateOperationalStateListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & data); -typedef void (*RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback)( + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & data); +typedef void (*RvcOperationalStateGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback)( +typedef void (*RvcOperationalStateAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStateEventListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStateAttributeListListAttributeCallback)( +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); diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 05278f2c9ff2da..ea8d604224fa77 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -3043,8 +3043,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::RoboticVacuumOperationalState::Id: { - using namespace app::Clusters::RoboticVacuumOperationalState; + case app::Clusters::RvcOperationalState::Id: { + using namespace app::Clusters::RvcOperationalState; switch (aPath.mEventId) { case Events::OperationalError::Id: { @@ -3090,18 +3090,17 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jclass errorStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", - errorStateStructStructClass_0); + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + 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$RoboticVacuumOperationalStateClusterErrorStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); return nullptr; } @@ -3111,21 +3110,19 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jclass operationalErrorStructClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent", + env, "chip/devicecontroller/ChipEventStructs$RvcOperationalStateClusterOperationalErrorEvent", operationalErrorStructClass); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent"); + ChipLogError(Zcl, "Could not find class ChipEventStructs$RvcOperationalStateClusterOperationalErrorEvent"); return nullptr; } jmethodID operationalErrorStructCtor = env->GetMethodID(operationalErrorStructClass, "", - "(Lchip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct;)V"); + "(Lchip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct;)V"); if (operationalErrorStructCtor == nullptr) { - ChipLogError( - Zcl, "Could not find ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent constructor"); + ChipLogError(Zcl, "Could not find ChipEventStructs$RvcOperationalStateClusterOperationalErrorEvent constructor"); return nullptr; } @@ -3197,21 +3194,18 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jclass operationCompletionStructClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipEventStructs$RoboticVacuumOperationalStateClusterOperationCompletionEvent", + env, "chip/devicecontroller/ChipEventStructs$RvcOperationalStateClusterOperationCompletionEvent", operationCompletionStructClass); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipEventStructs$RoboticVacuumOperationalStateClusterOperationCompletionEvent"); + 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$RoboticVacuumOperationalStateClusterOperationCompletionEvent constructor"); + ChipLogError(Zcl, "Could not find ChipEventStructs$RvcOperationalStateClusterOperationCompletionEvent constructor"); return nullptr; } diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 5e1f271ea91c57..0abae72ad343c9 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -3293,9 +3293,9 @@ void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, CommandResponseState); } -CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: - CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPRvcOperationalStateClusterOperationalCommandResponseCallback::CHIPRvcOperationalStateClusterOperationalCommandResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3311,8 +3311,8 @@ CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: } } -CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: - ~CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback() +CHIPRvcOperationalStateClusterOperationalCommandResponseCallback:: + ~CHIPRvcOperationalStateClusterOperationalCommandResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3323,9 +3323,9 @@ CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( +void CHIPRvcOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & dataResponse) + const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3335,10 +3335,10 @@ void CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback: 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; @@ -3346,8 +3346,8 @@ void CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback: VerifyOrReturn(javaCallbackRef != nullptr); err = JniReferences::GetInstance().FindMethod( - env, javaCallbackRef, "onSuccess", - "(Lchip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct;)V", &javaMethod); + 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; @@ -3386,18 +3386,17 @@ void CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback: jclass errorStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", - errorStateStructStructClass_0); + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); 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$RoboticVacuumOperationalStateClusterErrorStateStruct 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 7fb0f551e3d96d..2f93fd858fbec2 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -556,17 +556,17 @@ class CHIPOperationalStateClusterOperationalCommandResponseCallback jobject javaCallbackRef; }; -class CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback - : public Callback::Callback +class CHIPRvcOperationalStateClusterOperationalCommandResponseCallback + : public Callback::Callback { public: - CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback); + CHIPRvcOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback); - ~CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(); + ~CHIPRvcOperationalStateClusterOperationalCommandResponseCallback(); - static void CallbackFn( - void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::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 5a76387ea84927..215fd94d28c22f 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -25332,9 +25332,9 @@ void CHIPOperationalStateAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStatePhaseListAttributeCallback::CHIPRvcOperationalStatePhaseListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25351,7 +25351,7 @@ CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CHIPRoboticVacuumOp } } -CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::~CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback() +CHIPRvcOperationalStatePhaseListAttributeCallback::~CHIPRvcOperationalStatePhaseListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25362,7 +25362,7 @@ CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::~CHIPRoboticVacuumO env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CallbackFn( +void CHIPRvcOperationalStatePhaseListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::Nullable> & list) { chip::DeviceLayer::StackUnlock unlock; @@ -25372,8 +25372,8 @@ void CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::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; @@ -25407,9 +25407,9 @@ void CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateCurrentPhaseAttributeCallback::CHIPRvcOperationalStateCurrentPhaseAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25426,7 +25426,7 @@ CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CHIPRoboticVacuu } } -CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::~CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback() +CHIPRvcOperationalStateCurrentPhaseAttributeCallback::~CHIPRvcOperationalStateCurrentPhaseAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25437,8 +25437,8 @@ CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::~CHIPRoboticVacu env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPRvcOperationalStateCurrentPhaseAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -25446,8 +25446,8 @@ void CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CallbackFn( 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; @@ -25474,9 +25474,9 @@ void CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateCountdownTimeAttributeCallback::CHIPRvcOperationalStateCountdownTimeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25493,7 +25493,7 @@ CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CHIPRoboticVacu } } -CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::~CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback() +CHIPRvcOperationalStateCountdownTimeAttributeCallback::~CHIPRvcOperationalStateCountdownTimeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25504,8 +25504,8 @@ CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::~CHIPRoboticVac env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPRvcOperationalStateCountdownTimeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -25513,8 +25513,8 @@ void CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CallbackFn 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; @@ -25541,9 +25541,9 @@ void CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CallbackFn env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: - CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateOperationalStateListAttributeCallback::CHIPRvcOperationalStateOperationalStateListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25560,8 +25560,7 @@ CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: } } -CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: - ~CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback() +CHIPRvcOperationalStateOperationalStateListAttributeCallback::~CHIPRvcOperationalStateOperationalStateListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25572,10 +25571,10 @@ CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback::CallbackFn( +void CHIPRvcOperationalStateOperationalStateListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & list) + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -25584,8 +25583,8 @@ void CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback::Cal 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; @@ -25626,18 +25625,18 @@ void CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback::Cal jclass operationalStateStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", operationalStateStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + 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$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); return; } @@ -25650,9 +25649,9 @@ void CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback::Cal env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: - CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateGeneratedCommandListAttributeCallback::CHIPRvcOperationalStateGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25669,8 +25668,7 @@ CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: } } -CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: - ~CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback() +CHIPRvcOperationalStateGeneratedCommandListAttributeCallback::~CHIPRvcOperationalStateGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25681,7 +25679,7 @@ CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPRvcOperationalStateGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -25691,8 +25689,8 @@ void CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback::Cal 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; @@ -25722,9 +25720,9 @@ void CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback::Cal env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: - CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateAcceptedCommandListAttributeCallback::CHIPRvcOperationalStateAcceptedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25741,8 +25739,7 @@ CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: } } -CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: - ~CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback() +CHIPRvcOperationalStateAcceptedCommandListAttributeCallback::~CHIPRvcOperationalStateAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25753,7 +25750,7 @@ CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPRvcOperationalStateAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -25763,8 +25760,8 @@ void CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback::Call 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; @@ -25794,9 +25791,9 @@ void CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback::Call env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CHIPRoboticVacuumOperationalStateEventListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateEventListAttributeCallback::CHIPRvcOperationalStateEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25813,7 +25810,7 @@ CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CHIPRoboticVacuumOp } } -CHIPRoboticVacuumOperationalStateEventListAttributeCallback::~CHIPRoboticVacuumOperationalStateEventListAttributeCallback() +CHIPRvcOperationalStateEventListAttributeCallback::~CHIPRvcOperationalStateEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25824,8 +25821,8 @@ CHIPRoboticVacuumOperationalStateEventListAttributeCallback::~CHIPRoboticVacuumO env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPRvcOperationalStateEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -25834,8 +25831,8 @@ void CHIPRoboticVacuumOperationalStateEventListAttributeCallback::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; @@ -25865,9 +25862,9 @@ void CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateAttributeListAttributeCallback::CHIPRvcOperationalStateAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25884,7 +25881,7 @@ CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::CHIPRoboticVacu } } -CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::~CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback() +CHIPRvcOperationalStateAttributeListAttributeCallback::~CHIPRvcOperationalStateAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25895,7 +25892,7 @@ CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::~CHIPRoboticVac env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::CallbackFn( +void CHIPRvcOperationalStateAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -25905,8 +25902,8 @@ void CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::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; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index ee049095799615..23ca8d6a4308bf 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -16595,10 +16595,10 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class RoboticVacuumOperationalStateCluster extends BaseChipCluster { + public static class RvcOperationalStateCluster extends BaseChipCluster { public static final long CLUSTER_ID = 97L; - public RoboticVacuumOperationalStateCluster(long devicePtr, int endpointId) { + public RvcOperationalStateCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @@ -16661,7 +16661,7 @@ private native void resume(long chipClusterPtr, OperationalCommandResponseCallba , @Nullable Integer timedInvokeTimeoutMs); public interface OperationalCommandResponseCallback { - void onSuccess(ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct commandResponseState); + void onSuccess(ChipStructs.RvcOperationalStateClusterErrorStateStruct commandResponseState); void onError(Exception error); } @@ -16683,7 +16683,7 @@ public interface CountdownTimeAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } public interface OperationalStateListAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java index acbf63d6f4c4e2..81ef1fa558d09f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -1305,11 +1305,11 @@ public String toString() { } } -public static class RoboticVacuumOperationalStateClusterOperationalErrorEvent { -public ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct errorState; +public static class RvcOperationalStateClusterOperationalErrorEvent { +public ChipStructs.RvcOperationalStateClusterErrorStateStruct errorState; - public RoboticVacuumOperationalStateClusterOperationalErrorEvent( - ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct errorState + public RvcOperationalStateClusterOperationalErrorEvent( + ChipStructs.RvcOperationalStateClusterErrorStateStruct errorState ) { this.errorState = errorState; } @@ -1317,7 +1317,7 @@ public RoboticVacuumOperationalStateClusterOperationalErrorEvent( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RoboticVacuumOperationalStateClusterOperationalErrorEvent {\n"); + output.append("RvcOperationalStateClusterOperationalErrorEvent {\n"); output.append("\terrorState: "); output.append(errorState); output.append("\n"); @@ -1326,12 +1326,12 @@ public String toString() { } } -public static class RoboticVacuumOperationalStateClusterOperationCompletionEvent { +public static class RvcOperationalStateClusterOperationCompletionEvent { public Integer completionErrorCode; public @Nullable Optional totalOperationalTime; public @Nullable Optional pausedTime; - public RoboticVacuumOperationalStateClusterOperationCompletionEvent( + public RvcOperationalStateClusterOperationCompletionEvent( Integer completionErrorCode , @Nullable Optional totalOperationalTime , @Nullable Optional pausedTime @@ -1344,7 +1344,7 @@ public RoboticVacuumOperationalStateClusterOperationCompletionEvent( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RoboticVacuumOperationalStateClusterOperationCompletionEvent {\n"); + output.append("RvcOperationalStateClusterOperationCompletionEvent {\n"); output.append("\tcompletionErrorCode: "); output.append(completionErrorCode); output.append("\n"); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 4350bb17723122..77bdd9bce58781 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -184,7 +184,7 @@ public static String clusterIdToName(long clusterId) { return "OperationalState"; } if (clusterId == 97L) { - return "RoboticVacuumOperationalState"; + return "RvcOperationalState"; } if (clusterId == 113L) { return "HepaFilterMonitoring"; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index 4d67301d2aa90f..b024e13325d2b8 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1962,12 +1962,12 @@ public String toString() { } } -public static class RoboticVacuumOperationalStateClusterErrorStateStruct { +public static class RvcOperationalStateClusterErrorStateStruct { public Integer errorStateID; public Optional errorStateLabel; public Optional errorStateDetails; - public RoboticVacuumOperationalStateClusterErrorStateStruct( + public RvcOperationalStateClusterErrorStateStruct( Integer errorStateID , Optional errorStateLabel , Optional errorStateDetails @@ -1980,7 +1980,7 @@ public RoboticVacuumOperationalStateClusterErrorStateStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RoboticVacuumOperationalStateClusterErrorStateStruct {\n"); + output.append("RvcOperationalStateClusterErrorStateStruct {\n"); output.append("\terrorStateID: "); output.append(errorStateID); output.append("\n"); @@ -1995,11 +1995,11 @@ public String toString() { } } -public static class RoboticVacuumOperationalStateClusterOperationalStateStruct { +public static class RvcOperationalStateClusterOperationalStateStruct { public Integer operationalStateID; public Optional operationalStateLabel; - public RoboticVacuumOperationalStateClusterOperationalStateStruct( + public RvcOperationalStateClusterOperationalStateStruct( Integer operationalStateID , Optional operationalStateLabel ) { @@ -2010,7 +2010,7 @@ public RoboticVacuumOperationalStateClusterOperationalStateStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RoboticVacuumOperationalStateClusterOperationalStateStruct {\n"); + output.append("RvcOperationalStateClusterOperationalStateStruct {\n"); output.append("\toperationalStateID: "); output.append(operationalStateID); output.append("\n"); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index e960b0264d64cf..3db9f1bd3dba72 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -7309,7 +7309,7 @@ public void onError(Exception ex) { } } - public static class DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback implements ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7317,7 +7317,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct CommandResponseState) { + public void onSuccess(ChipStructs.RvcOperationalStateClusterErrorStateStruct CommandResponseState) { Map responseValues = new LinkedHashMap<>(); // CommandResponseState: Struct ErrorStateStruct // Conversion from this type to Java is not properly implemented yet @@ -7330,7 +7330,7 @@ public void onError(Exception error) { } } - public static class DelegatedRoboticVacuumOperationalStateClusterPhaseListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.PhaseListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterPhaseListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.PhaseListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7349,7 +7349,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterCurrentPhaseAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.CurrentPhaseAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterCurrentPhaseAttributeCallback implements ChipClusters.RvcOperationalStateCluster.CurrentPhaseAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7368,7 +7368,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterCountdownTimeAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.CountdownTimeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterCountdownTimeAttributeCallback implements ChipClusters.RvcOperationalStateCluster.CountdownTimeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7387,7 +7387,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterOperationalStateListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.OperationalStateListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterOperationalStateListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.OperationalStateListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7395,9 +7395,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); } @@ -7406,7 +7406,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterGeneratedCommandListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterGeneratedCommandListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7425,7 +7425,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterAcceptedCommandListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterAcceptedCommandListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7444,7 +7444,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterEventListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterEventListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7463,7 +7463,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterAttributeListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterAttributeListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20003,9 +20003,9 @@ public Map initializeClusterMap() { ClusterInfo operationalStateClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.OperationalStateCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("operationalState", operationalStateClusterInfo); - ClusterInfo roboticVacuumOperationalStateClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.RoboticVacuumOperationalStateCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("roboticVacuumOperationalState", roboticVacuumOperationalStateClusterInfo); + 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); @@ -20297,7 +20297,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("smokeCoAlarm", smokeCoAlarmClusterInteractionInfoMap); Map operationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("operationalState", operationalStateClusterInteractionInfoMap); - Map roboticVacuumOperationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); - Map roboticVacuumOperationalStatepauseCommandParams = new LinkedHashMap(); - InteractionInfo roboticVacuumOperationalStatepauseInteractionInfo = new InteractionInfo( + Map rvcOperationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); + Map rvcOperationalStatepauseCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStatepauseInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) - .pause((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster) + .pause((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), - roboticVacuumOperationalStatepauseCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStatepauseCommandParams ); - roboticVacuumOperationalStateClusterInteractionInfoMap.put("pause", roboticVacuumOperationalStatepauseInteractionInfo); - Map roboticVacuumOperationalStatestopCommandParams = new LinkedHashMap(); - InteractionInfo roboticVacuumOperationalStatestopInteractionInfo = new InteractionInfo( + rvcOperationalStateClusterInteractionInfoMap.put("pause", rvcOperationalStatepauseInteractionInfo); + Map rvcOperationalStatestopCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStatestopInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) - .stop((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster) + .stop((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), - roboticVacuumOperationalStatestopCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStatestopCommandParams ); - roboticVacuumOperationalStateClusterInteractionInfoMap.put("stop", roboticVacuumOperationalStatestopInteractionInfo); - Map roboticVacuumOperationalStatestartCommandParams = new LinkedHashMap(); - InteractionInfo roboticVacuumOperationalStatestartInteractionInfo = new InteractionInfo( + rvcOperationalStateClusterInteractionInfoMap.put("stop", rvcOperationalStatestopInteractionInfo); + Map rvcOperationalStatestartCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStatestartInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) - .start((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster) + .start((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), - roboticVacuumOperationalStatestartCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStatestartCommandParams ); - roboticVacuumOperationalStateClusterInteractionInfoMap.put("start", roboticVacuumOperationalStatestartInteractionInfo); - Map roboticVacuumOperationalStateresumeCommandParams = new LinkedHashMap(); - InteractionInfo roboticVacuumOperationalStateresumeInteractionInfo = new InteractionInfo( + rvcOperationalStateClusterInteractionInfoMap.put("start", rvcOperationalStatestartInteractionInfo); + Map rvcOperationalStateresumeCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStateresumeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) - .resume((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster) + .resume((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), - roboticVacuumOperationalStateresumeCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStateresumeCommandParams ); - roboticVacuumOperationalStateClusterInteractionInfoMap.put("resume", roboticVacuumOperationalStateresumeInteractionInfo); - commandMap.put("roboticVacuumOperationalState", roboticVacuumOperationalStateClusterInteractionInfoMap); + 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 ce7022c6ca7023..ebcb10cbbb1287 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -5233,8 +5233,8 @@ class ChipClusters: }, }, } - _ROBOTIC_VACUUM_OPERATIONAL_STATE_CLUSTER_INFO = { - "clusterName": "RoboticVacuumOperationalState", + _RVC_OPERATIONAL_STATE_CLUSTER_INFO = { + "clusterName": "RvcOperationalState", "clusterId": 0x00000061, "commands": { 0x00000000: { @@ -15623,7 +15623,7 @@ class ChipClusters: 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, 0x00000060: _OPERATIONAL_STATE_CLUSTER_INFO, - 0x00000061: _ROBOTIC_VACUUM_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, @@ -15758,7 +15758,7 @@ class ChipClusters: "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "SmokeCoAlarm": _SMOKE_CO_ALARM_CLUSTER_INFO, "OperationalState": _OPERATIONAL_STATE_CLUSTER_INFO, - "RoboticVacuumOperationalState": _ROBOTIC_VACUUM_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 063cc204d45da0..da33a4a753e694 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -18314,7 +18314,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass -class RoboticVacuumOperationalState(Cluster): +class RvcOperationalState(Cluster): id: typing.ClassVar[int] = 0x0061 @ChipUtility.classproperty @@ -18324,9 +18324,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: 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[RoboticVacuumOperationalState.Structs.OperationalStateStruct]), - ClusterObjectFieldDescriptor(Label="operationalState", Tag=0x00000004, Type=RoboticVacuumOperationalState.Structs.OperationalStateStruct), - ClusterObjectFieldDescriptor(Label="operationalError", Tag=0x00000005, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + 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]), @@ -18338,9 +18338,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: phaseList: 'typing.Union[Nullable, typing.List[str]]' = None currentPhase: 'typing.Union[Nullable, uint]' = None countdownTime: 'typing.Union[None, Nullable, uint]' = None - operationalStateList: 'typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]' = None - operationalState: 'RoboticVacuumOperationalState.Structs.OperationalStateStruct' = None - operationalError: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = 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 @@ -18467,10 +18467,10 @@ class OperationalCommandResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="commandResponseState", Tag=0, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + ClusterObjectFieldDescriptor(Label="commandResponseState", Tag=0, Type=RvcOperationalState.Structs.ErrorStateStruct), ]) - commandResponseState: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + commandResponseState: 'RvcOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.ErrorStateStruct()) class Attributes: @dataclass @@ -18533,9 +18533,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[RvcOperationalState.Structs.OperationalStateStruct]) - value: 'typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]' = field(default_factory=lambda: []) + value: 'typing.List[RvcOperationalState.Structs.OperationalStateStruct]' = field(default_factory=lambda: []) @dataclass class OperationalState(ClusterAttributeDescriptor): @@ -18549,9 +18549,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=RoboticVacuumOperationalState.Structs.OperationalStateStruct) + return ClusterObjectFieldDescriptor(Type=RvcOperationalState.Structs.OperationalStateStruct) - value: 'RoboticVacuumOperationalState.Structs.OperationalStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.OperationalStateStruct()) + value: 'RvcOperationalState.Structs.OperationalStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.OperationalStateStruct()) @dataclass class OperationalError(ClusterAttributeDescriptor): @@ -18565,9 +18565,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct) + return ClusterObjectFieldDescriptor(Type=RvcOperationalState.Structs.ErrorStateStruct) - value: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + value: 'RvcOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.ErrorStateStruct()) @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @@ -18680,10 +18680,10 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="errorState", Tag=0, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + ClusterObjectFieldDescriptor(Label="errorState", Tag=0, Type=RvcOperationalState.Structs.ErrorStateStruct), ]) - errorState: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + errorState: 'RvcOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.ErrorStateStruct()) @dataclass class OperationCompletion(ClusterEvent): 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/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index ca5f6de6d4d508..1b4bb1c6785da1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -2018,9 +2018,9 @@ static BOOL AttributeIsSpecifiedInOperationalStateCluster(AttributeId aAttribute } } } -static BOOL AttributeIsSpecifiedInRoboticVacuumOperationalStateCluster(AttributeId aAttributeId) +static BOOL AttributeIsSpecifiedInRVCOperationalStateCluster(AttributeId aAttributeId) { - using namespace Clusters::RoboticVacuumOperationalState; + using namespace Clusters::RvcOperationalState; switch (aAttributeId) { case Attributes::PhaseList::Id: { return YES; @@ -5145,8 +5145,8 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::OperationalState::Id: { return AttributeIsSpecifiedInOperationalStateCluster(aAttributeId); } - case Clusters::RoboticVacuumOperationalState::Id: { - return AttributeIsSpecifiedInRoboticVacuumOperationalStateCluster(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 c96f19c474471a..fe3c110ea46a02 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -10352,10 +10352,10 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForRoboticVacuumOperationalStateCluster( +static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::RoboticVacuumOperationalState; + using namespace Clusters::RvcOperationalState; switch (aAttributeId) { case Attributes::PhaseList::Id: { using TypeInfo = Attributes::PhaseList::TypeInfo; @@ -10435,8 +10435,8 @@ static id _Nullable DecodeAttributeValueForRoboticVacuumOperationalStateCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * newElement_0; - newElement_0 = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + 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()); @@ -10466,8 +10466,8 @@ static id _Nullable DecodeAttributeValueForRoboticVacuumOperationalStateCluster( if (*aError != CHIP_NO_ERROR) { return nil; } - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nonnull value; - value = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + MTRRVCOperationalStateClusterOperationalStateStruct * _Nonnull value; + value = [MTRRVCOperationalStateClusterOperationalStateStruct new]; value.operationalStateID = [NSNumber numberWithUnsignedChar:cppValue.operationalStateID]; if (cppValue.operationalStateLabel.HasValue()) { value.operationalStateLabel = AsString(cppValue.operationalStateLabel.Value()); @@ -10488,8 +10488,8 @@ static id _Nullable DecodeAttributeValueForRoboticVacuumOperationalStateCluster( if (*aError != CHIP_NO_ERROR) { return nil; } - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull value; - value = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull value; + value = [MTRRVCOperationalStateClusterErrorStateStruct new]; value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; if (cppValue.errorStateLabel.HasValue()) { value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); @@ -24587,8 +24587,8 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::OperationalState::Id: { return DecodeAttributeValueForOperationalStateCluster(aPath.mAttributeId, aReader, aError); } - case Clusters::RoboticVacuumOperationalState::Id: { - return DecodeAttributeValueForRoboticVacuumOperationalStateCluster(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 eba4f893d0bfff..6e21a62b8e0a73 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -8734,12 +8734,12 @@ MTR_NEWLY_AVAILABLE @end /** - * Cluster Robotic Vacuum Operational State + * Cluster RVC Operational State * * This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ MTR_NEWLY_AVAILABLE -@interface MTRBaseClusterRoboticVacuumOperationalState : MTRCluster +@interface MTRBaseClusterRVCOperationalState : MTRCluster - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID @@ -8750,20 +8750,20 @@ MTR_NEWLY_AVAILABLE * * Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */ -- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)pauseWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (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:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)stopWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)stopWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; /** * Command Start @@ -8771,10 +8771,10 @@ MTR_NEWLY_AVAILABLE * 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:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)startWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)startWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; /** * Command Resume @@ -8782,10 +8782,10 @@ MTR_NEWLY_AVAILABLE * 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:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)resumeWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)resumeWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -8836,38 +8836,31 @@ MTR_NEWLY_AVAILABLE completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeOperationalStateWithCompletion: - (void (^)(MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _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 (^)( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + (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 (^)( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, - NSError * _Nullable error))completion 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 (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _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 (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, - NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; + 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 (^)( - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + (void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -24650,21 +24643,21 @@ typedef NS_ENUM(uint8_t, MTROperationalState) { MTROperationalStateError MTR_NEWLY_AVAILABLE = 0x03, } MTR_NEWLY_AVAILABLE; -typedef NS_ENUM(uint8_t, MTRRoboticVacuumOperationalStateErrorState) { - MTRRoboticVacuumOperationalStateErrorStateFailedToFindChargingDock MTR_NEWLY_AVAILABLE = 0x40, - MTRRoboticVacuumOperationalStateErrorStateStuck MTR_NEWLY_AVAILABLE = 0x41, - MTRRoboticVacuumOperationalStateErrorStateDustBinMissing MTR_NEWLY_AVAILABLE = 0x42, - MTRRoboticVacuumOperationalStateErrorStateDustBinFull MTR_NEWLY_AVAILABLE = 0x43, - MTRRoboticVacuumOperationalStateErrorStateWaterTankEmpty MTR_NEWLY_AVAILABLE = 0x44, - MTRRoboticVacuumOperationalStateErrorStateWaterTankMissing MTR_NEWLY_AVAILABLE = 0x45, - MTRRoboticVacuumOperationalStateErrorStateWaterTankLidOpen MTR_NEWLY_AVAILABLE = 0x46, - MTRRoboticVacuumOperationalStateErrorStateMopCleaningPadMissing MTR_NEWLY_AVAILABLE = 0x47, +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, MTRRoboticVacuumOperationalStateOperationalState) { - MTRRoboticVacuumOperationalStateOperationalStateSeekingCharger MTR_NEWLY_AVAILABLE = 0x40, - MTRRoboticVacuumOperationalStateOperationalStateCharging MTR_NEWLY_AVAILABLE = 0x41, - MTRRoboticVacuumOperationalStateOperationalStateDocked MTR_NEWLY_AVAILABLE = 0x42, +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) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 087572b6978dba..eb201d04621037 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -50705,7 +50705,7 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end -@implementation MTRBaseClusterRoboticVacuumOperationalState +@implementation MTRBaseClusterRVCOperationalState - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue { @@ -50720,28 +50720,26 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en return self; } -- (void)pauseWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)pauseWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self pauseWithParams:nil completion:completion]; } -- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (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 MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Pause::Type request; + RvcOperationalState::Commands::Pause::Type request; if (params != nil) { if (params.timedInvokeTimeoutMs != nil) { params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); @@ -50761,28 +50759,26 @@ - (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _N std::move(*bridge).DispatchAction(self.device); } -- (void)stopWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)stopWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self stopWithParams:nil completion:completion]; } -- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (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 MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Stop::Type request; + RvcOperationalState::Commands::Stop::Type request; if (params != nil) { if (params.timedInvokeTimeoutMs != nil) { params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); @@ -50802,28 +50798,26 @@ - (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nul std::move(*bridge).DispatchAction(self.device); } -- (void)startWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)startWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self startWithParams:nil completion:completion]; } -- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (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 MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Start::Type request; + RvcOperationalState::Commands::Start::Type request; if (params != nil) { if (params.timedInvokeTimeoutMs != nil) { params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); @@ -50843,28 +50837,26 @@ - (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _N std::move(*bridge).DispatchAction(self.device); } -- (void)resumeWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)resumeWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self resumeWithParams:nil completion:completion]; } -- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (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 MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Resume::Type request; + RvcOperationalState::Commands::Resume::Type request; if (params != nil) { if (params.timedInvokeTimeoutMs != nil) { params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); @@ -50887,8 +50879,8 @@ - (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * - (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; - return MTRReadAttribute( + using TypeInfo = RvcOperationalState::Attributes::PhaseList::TypeInfo; + return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -50896,10 +50888,10 @@ - (void)subscribeAttributePhaseListWithParams:(MTRSubscribeParams * _Nonnull)par subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, - TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); + using TypeInfo = RvcOperationalState::Attributes::PhaseList::TypeInfo; + MTRSubscribeAttribute( + params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); } + (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer @@ -50907,12 +50899,12 @@ + (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContain queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStatePhaseListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStatePhaseListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStatePhaseListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::PhaseList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -50930,7 +50922,7 @@ + (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContain - (void)readAttributeCurrentPhaseWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CurrentPhase::TypeInfo; return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -50939,7 +50931,7 @@ - (void)subscribeAttributeCurrentPhaseWithParams:(MTRSubscribeParams * _Nonnull) subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CurrentPhase::TypeInfo; MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); @@ -50955,7 +50947,7 @@ + (void)readAttributeCurrentPhaseWithClusterStateCache:(MTRClusterStateCacheCont clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CurrentPhase::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -50973,7 +50965,7 @@ + (void)readAttributeCurrentPhaseWithClusterStateCache:(MTRClusterStateCacheCont - (void)readAttributeCountdownTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CountdownTime::TypeInfo; return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -50982,7 +50974,7 @@ - (void)subscribeAttributeCountdownTimeWithParams:(MTRSubscribeParams * _Nonnull subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CountdownTime::TypeInfo; MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); @@ -50998,7 +50990,7 @@ + (void)readAttributeCountdownTimeWithClusterStateCache:(MTRClusterStateCacheCon clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CountdownTime::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51016,8 +51008,8 @@ + (void)readAttributeCountdownTimeWithClusterStateCache:(MTRClusterStateCacheCon - (void)readAttributeOperationalStateListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; - return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51027,8 +51019,8 @@ - (void)subscribeAttributeOperationalStateListWithParams:(MTRSubscribeParams * _ reportHandler: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51039,12 +51031,12 @@ + (void)readAttributeOperationalStateListWithClusterStateCache:(MTRClusterStateC completion: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateOperationalStateListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateOperationalStateListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::OperationalStateList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51059,44 +51051,41 @@ + (void)readAttributeOperationalStateListWithClusterStateCache:(MTRClusterStateC }); } -- (void)readAttributeOperationalStateWithCompletion: - (void (^)(MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeOperationalStateWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; - return MTRReadAttribute( + 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 (^)( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + (void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, + 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 (^)( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, - NSError * _Nullable error))completion ++ (void)readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateOperationalStateStructAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateOperationalStateStructAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::OperationalState::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51111,42 +51100,40 @@ - (void)subscribeAttributeOperationalStateWithParams:(MTRSubscribeParams * _Nonn }); } -- (void)readAttributeOperationalErrorWithCompletion: - (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeOperationalErrorWithCompletion:(void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; - return MTRReadAttribute( + 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 (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, - NSError * _Nullable error))reportHandler + reportHandler:(void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, - reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); + 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 (^)( - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + (void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateOperationalErrorStructAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateOperationalErrorStructAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::OperationalError::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51164,8 +51151,8 @@ + (void)readAttributeOperationalErrorWithClusterStateCache:(MTRClusterStateCache - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; - return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51175,8 +51162,8 @@ - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _ reportHandler: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51187,12 +51174,12 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC completion: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::GeneratedCommandList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51210,9 +51197,8 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC - (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; - return MTRReadAttribute( + using TypeInfo = RvcOperationalState::Attributes::AcceptedCommandList::TypeInfo; + return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51221,8 +51207,8 @@ - (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _N reportHandler: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51233,12 +51219,12 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa completion: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::AcceptedCommandList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51256,8 +51242,8 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa - (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; - return MTRReadAttribute( + using TypeInfo = RvcOperationalState::Attributes::EventList::TypeInfo; + return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51265,10 +51251,10 @@ - (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)par subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, - TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); + using TypeInfo = RvcOperationalState::Attributes::EventList::TypeInfo; + MTRSubscribeAttribute( + params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); } + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer @@ -51276,12 +51262,12 @@ + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContain queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateEventListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::EventList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51299,9 +51285,8 @@ + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContain - (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; - return MTRReadAttribute( + using TypeInfo = RvcOperationalState::Attributes::AttributeList::TypeInfo; + return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51309,8 +51294,8 @@ - (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51320,12 +51305,12 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateAttributeListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::AttributeList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51343,7 +51328,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::FeatureMap::TypeInfo; return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51352,7 +51337,7 @@ - (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)pa subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::FeatureMap::TypeInfo; MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); @@ -51368,7 +51353,7 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::FeatureMap::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51386,7 +51371,7 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::ClusterRevision::TypeInfo; return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51395,7 +51380,7 @@ - (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnu subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::ClusterRevision::TypeInfo; MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); @@ -51412,7 +51397,7 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::ClusterRevision::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index aa29354560fb44..d7135458fc7ec6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -225,7 +225,7 @@ @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end -@interface MTRBaseClusterRoboticVacuumOperationalState () +@interface MTRBaseClusterRVCOperationalState () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index df099251b0729e..74d4cfe31063c5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -87,8 +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 (*RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType)( - void *, const chip::app::Clusters::RoboticVacuumOperationalState::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)( @@ -416,14 +416,14 @@ typedef void (*OperationalStateClusterOperationalStateEnumAttributeCallback)( void *, chip::app::Clusters::OperationalState::OperationalStateEnum); typedef void (*NullableOperationalStateClusterOperationalStateEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); -typedef void (*RoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallback)( - void *, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum); -typedef void (*NullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*RoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallback)( - void *, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum); -typedef void (*NullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallback)( - 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)( @@ -1231,23 +1231,23 @@ typedef void (*OperationalStateEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStatePhaseListListAttributeCallback)( +typedef void (*RVCOperationalStatePhaseListListAttributeCallback)( void * context, const chip::app::DataModel::Nullable> & data); -typedef void (*RoboticVacuumOperationalStateOperationalStateListListAttributeCallback)( +typedef void (*RVCOperationalStateOperationalStateListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & data); -typedef void (*RoboticVacuumOperationalStateOperationalStateStructAttributeCallback)( - void *, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType &); -typedef void (*RoboticVacuumOperationalStateOperationalErrorStructAttributeCallback)( - void *, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType &); -typedef void (*RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback)( + 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 (*RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback)( +typedef void (*RVCOperationalStateAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStateEventListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStateAttributeListListAttributeCallback)( +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); @@ -9619,281 +9619,270 @@ class MTROperationalStateAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStatePhaseListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, 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 MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge +class MTRRVCOperationalStatePhaseListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStatePhaseListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStatePhaseListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStatePhaseListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStatePhaseListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStatePhaseListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - 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::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & value); + static void OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & value); }; -class MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge +class MTRRVCOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void - OnSuccessFn(void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType & value); + static void OnSuccessFn(void * context, + const chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType & value); }; -class MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge +class MTRRVCOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void - OnSuccessFn(void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType & value); + static void OnSuccessFn(void * context, + const chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType & value); }; -class MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge +class MTRRVCOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - 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 MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge +class MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - 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 MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge +class MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateEventListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, 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 MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge +class MTRRVCOperationalStateEventListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateEventListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateEventListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStateEventListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateEventListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateEventListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, 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 MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge +class MTRRVCOperationalStateAttributeListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateAttributeListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateAttributeListListAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateAttributeListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateAttributeListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; @@ -17072,23 +17061,20 @@ class MTROperationalStateClusterOperationalCommandResponseCallbackBridge const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data); }; -class MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, - OnSuccessFn){}; + MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void OnSuccessFn( - void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & data); + static void + OnSuccessFn(void * context, + const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & data); }; class MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge @@ -22672,149 +22658,139 @@ class MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackSub MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void OnSuccessFn(void * context, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum value); + static void OnSuccessFn(void * context, chip::app::Clusters::RvcOperationalState::ErrorStateEnum value); }; -class MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge +class MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge - : public MTRCallbackBridge +class MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, - OnSuccessFn){}; + MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - 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); + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); }; -class MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge - : public MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge +class MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge { public: - MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; - using MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + using MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void OnSuccessFn(void * context, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum value); + static void OnSuccessFn(void * context, chip::app::Clusters::RvcOperationalState::OperationalStateEnum value); }; -class MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge +class MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge - : public MTRCallbackBridge +class MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, - OnSuccessFn){}; + MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - 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); + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); }; -class MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge - : public MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge +class MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge { public: - MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; - using MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; + using MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 21c9a5b991c77c..6314800b01a871 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -9229,7 +9229,7 @@ } } -void MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::OnSuccessFn( +void MTRRVCOperationalStatePhaseListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::Nullable> & value) { NSArray * _Nullable objCValue; @@ -9261,7 +9261,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStatePhaseListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9276,9 +9276,9 @@ } } -void MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::OnSuccessFn(void * context, +void MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge::OnSuccessFn(void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & value) + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & value) { NSArray * _Nonnull objCValue; { // Scope for our temporary variables @@ -9286,8 +9286,8 @@ auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * newElement_0; - newElement_0 = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + 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()); @@ -9311,7 +9311,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9326,11 +9326,11 @@ } } -void MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType & value) +void MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType & value) { - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nonnull objCValue; - objCValue = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + MTRRVCOperationalStateClusterOperationalStateStruct * _Nonnull objCValue; + objCValue = [MTRRVCOperationalStateClusterOperationalStateStruct new]; objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:value.operationalStateID]; if (value.operationalStateLabel.HasValue()) { objCValue.operationalStateLabel = AsString(value.operationalStateLabel.Value()); @@ -9345,7 +9345,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9360,11 +9360,11 @@ } } -void MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType & value) +void MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType & value) { - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull objCValue; - objCValue = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull objCValue; + objCValue = [MTRRVCOperationalStateClusterErrorStateStruct new]; objCValue.errorStateID = [NSNumber numberWithUnsignedChar:value.errorStateID]; if (value.errorStateLabel.HasValue()) { objCValue.errorStateLabel = AsString(value.errorStateLabel.Value()); @@ -9389,7 +9389,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9404,7 +9404,7 @@ } } -void MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( +void MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; @@ -9427,7 +9427,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9442,7 +9442,7 @@ } } -void MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( +void MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; @@ -9465,7 +9465,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9480,7 +9480,7 @@ } } -void MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::OnSuccessFn( +void MTRRVCOperationalStateEventListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; @@ -9503,7 +9503,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateEventListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9518,7 +9518,7 @@ } } -void MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::OnSuccessFn( +void MTRRVCOperationalStateAttributeListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; @@ -9541,7 +9541,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -17740,10 +17740,10 @@ DispatchSuccess(context, response); }; -void MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge::OnSuccessFn(void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & data) +void MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & data) { - auto * response = [MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams new]; + auto * response = [MTRRVCOperationalStateClusterOperationalCommandResponseParams new]; CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; if (err != CHIP_NO_ERROR) { OnFailureFn(context, err); @@ -21823,15 +21823,15 @@ } } -void MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum value) +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 MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -21846,8 +21846,8 @@ } } -void MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value) +void MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -21858,7 +21858,7 @@ DispatchSuccess(context, objCValue); }; -void MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -21873,15 +21873,15 @@ } } -void MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum value) +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 MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -21896,8 +21896,8 @@ } } -void MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value) +void MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -21908,8 +21908,7 @@ DispatchSuccess(context, objCValue); }; -void MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge:: - OnSubscriptionEstablished() +void MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index e92763b74e85bb..92f35f673db378 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -281,7 +281,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAirQualityID MTR_NEWLY_AVAILABLE = 0x0000005B, MTRClusterIDTypeSmokeCOAlarmID MTR_NEWLY_AVAILABLE = 0x0000005C, MTRClusterIDTypeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000060, - MTRClusterIDTypeRoboticVacuumOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000061, + 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, @@ -3826,24 +3826,24 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, - // Cluster RoboticVacuumOperationalState attributes - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributePhaseListID MTR_NEWLY_AVAILABLE = 0x00000000, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCurrentPhaseID MTR_NEWLY_AVAILABLE = 0x00000001, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCountdownTimeID MTR_NEWLY_AVAILABLE = 0x00000002, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateListID MTR_NEWLY_AVAILABLE = 0x00000003, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000004, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000005, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE + // 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, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE + MTRAttributeIDTypeClusterRVCOperationalStateAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeEventListID MTR_NEWLY_AVAILABLE + MTRAttributeIDTypeClusterRVCOperationalStateAttributeEventListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAttributeListID MTR_NEWLY_AVAILABLE + MTRAttributeIDTypeClusterRVCOperationalStateAttributeAttributeListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeFeatureMapID MTR_NEWLY_AVAILABLE + MTRAttributeIDTypeClusterRVCOperationalStateAttributeFeatureMapID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE + MTRAttributeIDTypeClusterRVCOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, // Cluster HEPAFilterMonitoring attributes @@ -9297,12 +9297,12 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, MTRCommandIDTypeClusterOperationalStateCommandOperationalCommandResponseID MTR_NEWLY_AVAILABLE = 0x00000004, - // Cluster RoboticVacuumOperationalState commands - MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandPauseID MTR_NEWLY_AVAILABLE = 0x00000000, - MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStopID MTR_NEWLY_AVAILABLE = 0x00000001, - MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStartID MTR_NEWLY_AVAILABLE = 0x00000002, - MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, - MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandOperationalCommandResponseID 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, @@ -10453,9 +10453,9 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, MTREventIDTypeClusterOperationalStateEventOperationCompletionID MTR_NEWLY_AVAILABLE = 0x00000001, - // Cluster RoboticVacuumOperationalState events - MTREventIDTypeClusterRoboticVacuumOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, - MTREventIDTypeClusterRoboticVacuumOperationalStateEventOperationCompletionID 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", diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 5357cdde89d6b1..7f62aa4280d55d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3057,51 +3057,51 @@ MTR_NEWLY_AVAILABLE @end /** - * Cluster Robotic Vacuum Operational State + * Cluster RVC Operational State * This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ MTR_NEWLY_AVAILABLE -@interface MTRClusterRoboticVacuumOperationalState : MTRCluster +@interface MTRClusterRVCOperationalState : MTRCluster - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; -- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params +- (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)pauseWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params +- (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)stopWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params +- (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)startWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params +- (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)resumeWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (NSDictionary *)readAttributePhaseListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 006cc041f8adaa..99f1566cb1bc91 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -13913,7 +13913,7 @@ - (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)par @end -@implementation MTRClusterRoboticVacuumOperationalState +@implementation MTRClusterRVCOperationalState - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue { @@ -13930,20 +13930,20 @@ - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpoi - (void)pauseWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self pauseWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; } -- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params +- (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + 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) MTRClusterIDTypeRoboticVacuumOperationalStateID, - (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandPauseID]; + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandPauseID]; // Make a copy of params before we go async. params = [params copy]; NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; @@ -13955,7 +13955,7 @@ - (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _N MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( self.device.queue, ^(id _Nullable value, NSError * _Nullable error) { MTRClustersLogCompletion(logPrefix, value, error); @@ -13965,14 +13965,13 @@ - (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _N [workItem endWork]; }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Pause::Type request; + RvcOperationalState::Commands::Pause::Type request; if (timedInvokeTimeoutMsParam != nil) { timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); } @@ -14007,20 +14006,20 @@ - (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _N - (void)stopWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self stopWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; } -- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params +- (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + 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) MTRClusterIDTypeRoboticVacuumOperationalStateID, - (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStopID]; + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandStopID]; // Make a copy of params before we go async. params = [params copy]; NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; @@ -14032,7 +14031,7 @@ - (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nul MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( self.device.queue, ^(id _Nullable value, NSError * _Nullable error) { MTRClustersLogCompletion(logPrefix, value, error); @@ -14042,14 +14041,13 @@ - (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nul [workItem endWork]; }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Stop::Type request; + RvcOperationalState::Commands::Stop::Type request; if (timedInvokeTimeoutMsParam != nil) { timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); } @@ -14084,20 +14082,20 @@ - (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nul - (void)startWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self startWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; } -- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params +- (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + 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) MTRClusterIDTypeRoboticVacuumOperationalStateID, - (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStartID]; + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandStartID]; // Make a copy of params before we go async. params = [params copy]; NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; @@ -14109,7 +14107,7 @@ - (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _N MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( self.device.queue, ^(id _Nullable value, NSError * _Nullable error) { MTRClustersLogCompletion(logPrefix, value, error); @@ -14119,14 +14117,13 @@ - (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _N [workItem endWork]; }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Start::Type request; + RvcOperationalState::Commands::Start::Type request; if (timedInvokeTimeoutMsParam != nil) { timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); } @@ -14161,20 +14158,20 @@ - (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _N - (void)resumeWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self resumeWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; } -- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params +- (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + 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) MTRClusterIDTypeRoboticVacuumOperationalStateID, - (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandResumeID]; + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandResumeID]; // Make a copy of params before we go async. params = [params copy]; NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; @@ -14186,7 +14183,7 @@ - (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( self.device.queue, ^(id _Nullable value, NSError * _Nullable error) { MTRClustersLogCompletion(logPrefix, value, error); @@ -14196,14 +14193,13 @@ - (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * [workItem endWork]; }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Resume::Type request; + RvcOperationalState::Commands::Resume::Type request; if (timedInvokeTimeoutMsParam != nil) { timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); } @@ -14239,105 +14235,97 @@ - (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * - (NSDictionary *)readAttributePhaseListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributePhaseListID) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributePhaseListID) params:params]; } - (NSDictionary *)readAttributeCurrentPhaseWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCurrentPhaseID) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeCurrentPhaseID) params:params]; } - (NSDictionary *)readAttributeCountdownTimeWithParams:(MTRReadParams * _Nullable)params { - return - [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCountdownTimeID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeCountdownTimeID) + params:params]; } - (NSDictionary *)readAttributeOperationalStateListWithParams:(MTRReadParams * _Nullable)params { - return [self.device - readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateListID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalStateListID) + params:params]; } - (NSDictionary *)readAttributeOperationalStateWithParams:(MTRReadParams * _Nullable)params { - return [self.device - readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalStateID) + params:params]; } - (NSDictionary *)readAttributeOperationalErrorWithParams:(MTRReadParams * _Nullable)params { - return [self.device - readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalErrorID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalErrorID) + params:params]; } - (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { - return [self.device - readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeGeneratedCommandListID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeGeneratedCommandListID) + params:params]; } - (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params { - return [self.device - readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAcceptedCommandListID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeAcceptedCommandListID) + params:params]; } - (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeEventListID) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeEventListID) params:params]; } - (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params { - return - [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAttributeListID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeAttributeListID) + params:params]; } - (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeFeatureMapID) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeFeatureMapID) params:params]; } - (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params { - return - [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeClusterRevisionID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeClusterRevisionID) + params:params]; } @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h index 129f5bdc5ad9fc..849782b23cad83 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -226,7 +226,7 @@ @property (nonatomic, readonly) MTRDevice * device; @end -@interface MTRClusterRoboticVacuumOperationalState () +@interface MTRClusterRVCOperationalState () @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice * device; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 0cb9be344b6023..8838c0c06e0703 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4267,7 +4267,7 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterPauseParams : NSObject +@interface MTRRVCOperationalStateClusterPauseParams : NSObject /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -4295,7 +4295,7 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterStopParams : NSObject +@interface MTRRVCOperationalStateClusterStopParams : NSObject /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -4323,7 +4323,7 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterStartParams : NSObject +@interface MTRRVCOperationalStateClusterStartParams : NSObject /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -4351,7 +4351,7 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterResumeParams : NSObject +@interface MTRRVCOperationalStateClusterResumeParams : NSObject /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -4379,13 +4379,12 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams : NSObject +@interface MTRRVCOperationalStateClusterOperationalCommandResponseParams : NSObject -@property (nonatomic, copy) - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull commandResponseState MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull commandResponseState MTR_NEWLY_AVAILABLE; /** - * Initialize an MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams with a response-value dictionary + * 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 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index d1d8bfd771ed4c..7e03309d57cca3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -6714,7 +6714,7 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct: return CHIP_NO_ERROR; } @end -@implementation MTRRoboticVacuumOperationalStateClusterPauseParams +@implementation MTRRVCOperationalStateClusterPauseParams - (instancetype)init { if (self = [super init]) { @@ -6726,7 +6726,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRRoboticVacuumOperationalStateClusterPauseParams alloc] init]; + auto other = [[MTRRVCOperationalStateClusterPauseParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -6741,7 +6741,7 @@ - (NSString *)description } @end -@implementation MTRRoboticVacuumOperationalStateClusterStopParams +@implementation MTRRVCOperationalStateClusterStopParams - (instancetype)init { if (self = [super init]) { @@ -6753,7 +6753,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRRoboticVacuumOperationalStateClusterStopParams alloc] init]; + auto other = [[MTRRVCOperationalStateClusterStopParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -6768,7 +6768,7 @@ - (NSString *)description } @end -@implementation MTRRoboticVacuumOperationalStateClusterStartParams +@implementation MTRRVCOperationalStateClusterStartParams - (instancetype)init { if (self = [super init]) { @@ -6780,7 +6780,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRRoboticVacuumOperationalStateClusterStartParams alloc] init]; + auto other = [[MTRRVCOperationalStateClusterStartParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -6795,7 +6795,7 @@ - (NSString *)description } @end -@implementation MTRRoboticVacuumOperationalStateClusterResumeParams +@implementation MTRRVCOperationalStateClusterResumeParams - (instancetype)init { if (self = [super init]) { @@ -6807,7 +6807,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRRoboticVacuumOperationalStateClusterResumeParams alloc] init]; + auto other = [[MTRRVCOperationalStateClusterResumeParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -6822,19 +6822,19 @@ - (NSString *)description } @end -@implementation MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams +@implementation MTRRVCOperationalStateClusterOperationalCommandResponseParams - (instancetype)init { if (self = [super init]) { - _commandResponseState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + _commandResponseState = [MTRRVCOperationalStateClusterErrorStateStruct new]; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams alloc] init]; + auto other = [[MTRRVCOperationalStateClusterOperationalCommandResponseParams alloc] init]; other.commandResponseState = self.commandResponseState; @@ -6855,7 +6855,7 @@ - (nullable instancetype)initWithResponseValue:(NSDictionary *)r return nil; } - using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + using DecodableType = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue clusterID:DecodableType::GetClusterId() commandID:DecodableType::GetCommandId() @@ -6890,13 +6890,13 @@ - (nullable instancetype)initWithResponseValue:(NSDictionary *)r @end -@implementation MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams (InternalMethods) +@implementation MTRRVCOperationalStateClusterOperationalCommandResponseParams (InternalMethods) - (CHIP_ERROR)_setFieldsFromDecodableStruct: - (const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType &)decodableStruct + (const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType &)decodableStruct { { - self.commandResponseState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + self.commandResponseState = [MTRRVCOperationalStateClusterErrorStateStruct new]; self.commandResponseState.errorStateID = [NSNumber numberWithUnsignedChar:decodableStruct.commandResponseState.errorStateID]; if (decodableStruct.commandResponseState.errorStateLabel.HasValue()) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index f7058c2accf769..51c8bc30950138 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -224,11 +224,10 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams (InternalMethods) +@interface MTRRVCOperationalStateClusterOperationalCommandResponseParams (InternalMethods) - (CHIP_ERROR)_setFieldsFromDecodableStruct: - (const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType &) - decodableStruct; + (const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType &)decodableStruct; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 28390e012b6421..193a8a34012329 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1848,10 +1848,9 @@ static id _Nullable DecodeEventPayloadForOperationalStateCluster(EventId aEventI *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } -static id _Nullable DecodeEventPayloadForRoboticVacuumOperationalStateCluster( - EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeEventPayloadForRVCOperationalStateCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::RoboticVacuumOperationalState; + using namespace Clusters::RvcOperationalState; switch (aEventId) { case Events::OperationalError::Id: { Events::OperationalError::DecodableType cppValue; @@ -1860,11 +1859,11 @@ static id _Nullable DecodeEventPayloadForRoboticVacuumOperationalStateCluster( return nil; } - __auto_type * value = [MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent new]; + __auto_type * value = [MTRRVCOperationalStateClusterOperationalErrorEvent new]; do { - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull memberValue; - memberValue = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + 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()); @@ -1898,7 +1897,7 @@ static id _Nullable DecodeEventPayloadForRoboticVacuumOperationalStateCluster( return nil; } - __auto_type * value = [MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent new]; + __auto_type * value = [MTRRVCOperationalStateClusterOperationCompletionEvent new]; do { NSNumber * _Nonnull memberValue; @@ -3144,8 +3143,8 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::OperationalState::Id: { return DecodeEventPayloadForOperationalStateCluster(aPath.mEventId, aReader, aError); } - case Clusters::RoboticVacuumOperationalState::Id: { - return DecodeEventPayloadForRoboticVacuumOperationalStateCluster(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 d133b106aeac48..63264e74bdead1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -782,25 +782,25 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterErrorStateStruct : NSObject +@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 MTRRoboticVacuumOperationalStateClusterOperationalStateStruct : NSObject +@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 MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent : NSObject -@property (nonatomic, copy) MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull errorState MTR_NEWLY_AVAILABLE; +@interface MTRRVCOperationalStateClusterOperationalErrorEvent : NSObject +@property (nonatomic, copy) MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull errorState MTR_NEWLY_AVAILABLE; @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent : NSObject +@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; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 763a9a1a24549c..17046b2bc00ffb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -3104,7 +3104,7 @@ - (NSString *)description @end -@implementation MTRRoboticVacuumOperationalStateClusterErrorStateStruct +@implementation MTRRVCOperationalStateClusterErrorStateStruct - (instancetype)init { if (self = [super init]) { @@ -3120,7 +3120,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRRoboticVacuumOperationalStateClusterErrorStateStruct alloc] init]; + auto other = [[MTRRVCOperationalStateClusterErrorStateStruct alloc] init]; other.errorStateID = self.errorStateID; other.errorStateLabel = self.errorStateLabel; @@ -3138,7 +3138,7 @@ - (NSString *)description @end -@implementation MTRRoboticVacuumOperationalStateClusterOperationalStateStruct +@implementation MTRRVCOperationalStateClusterOperationalStateStruct - (instancetype)init { if (self = [super init]) { @@ -3152,7 +3152,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalStateStruct alloc] init]; + auto other = [[MTRRVCOperationalStateClusterOperationalStateStruct alloc] init]; other.operationalStateID = self.operationalStateID; other.operationalStateLabel = self.operationalStateLabel; @@ -3169,19 +3169,19 @@ - (NSString *)description @end -@implementation MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent +@implementation MTRRVCOperationalStateClusterOperationalErrorEvent - (instancetype)init { if (self = [super init]) { - _errorState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + _errorState = [MTRRVCOperationalStateClusterErrorStateStruct new]; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent alloc] init]; + auto other = [[MTRRVCOperationalStateClusterOperationalErrorEvent alloc] init]; other.errorState = self.errorState; @@ -3197,7 +3197,7 @@ - (NSString *)description @end -@implementation MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent +@implementation MTRRVCOperationalStateClusterOperationCompletionEvent - (instancetype)init { if (self = [super init]) { @@ -3213,7 +3213,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent alloc] init]; + auto other = [[MTRRVCOperationalStateClusterOperationCompletionEvent alloc] init]; other.completionErrorCode = self.completionErrorCode; other.totalOperationalTime = self.totalOperationalTime; 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 4ddd67331fdc36..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 @@ -9542,7 +9542,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Attributes { namespace CurrentPhase { @@ -9552,7 +9552,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::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -9574,7 +9574,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::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -9583,7 +9583,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -9605,7 +9605,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -9627,7 +9627,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::RoboticVacuumOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -9636,7 +9636,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -9658,7 +9658,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::RoboticVacuumOperationalState::Id, Id, readable, sizeof(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)) { @@ -9677,7 +9677,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::RoboticVacuumOperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -9689,7 +9689,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::RoboticVacuumOperationalState::Id, Id, readable, sizeof(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)) { @@ -9708,13 +9708,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::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace RoboticVacuumOperationalState +} // 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 0f6130f5a1687f..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 @@ -1787,7 +1787,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Attributes { namespace CurrentPhase { @@ -1815,7 +1815,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace RoboticVacuumOperationalState +} // 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 b912e82b0e24db..8a1dc67b15eeef 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -457,13 +457,13 @@ void emberAfSmokeCoAlarmClusterInitCallback(chip::EndpointId endpoint); */ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpoint); -/** @brief Robotic Vacuum Operational State Cluster Init +/** @brief RVC Operational State Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRoboticVacuumOperationalStateClusterInitCallback(chip::EndpointId endpoint); +void emberAfRvcOperationalStateClusterInitCallback(chip::EndpointId endpoint); /** @brief HEPA Filter Monitoring Cluster Init * @@ -5186,43 +5186,42 @@ void emberAfOperationalStateClusterServerTickCallback(chip::EndpointId endpoint) void emberAfOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); // -// Robotic Vacuum Operational State Cluster +// RVC Operational State Cluster // -/** @brief Robotic Vacuum Operational State Cluster Server Init +/** @brief RVC Operational State Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRoboticVacuumOperationalStateClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfRvcOperationalStateClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Robotic Vacuum Operational State Cluster Server Shutdown +/** @brief RVC Operational State Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterRoboticVacuumOperationalStateClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterRvcOperationalStateClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief Robotic Vacuum Operational State Cluster Client Init +/** @brief RVC Operational State Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRoboticVacuumOperationalStateClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfRvcOperationalStateClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief Robotic Vacuum Operational State Cluster Server Attribute Changed +/** @brief RVC Operational State Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterRoboticVacuumOperationalStateClusterServerAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath); +void MatterRvcOperationalStateClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief Robotic Vacuum Operational State Cluster Server Pre Attribute Changed +/** @brief RVC Operational State Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -5231,10 +5230,10 @@ void MatterRoboticVacuumOperationalStateClusterServerAttributeChangedCallback( * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterRoboticVacuumOperationalStateClusterServerPreAttributeChangedCallback( +chip::Protocols::InteractionModel::Status MatterRvcOperationalStateClusterServerPreAttributeChangedCallback( const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Robotic Vacuum Operational State Cluster Client Pre Attribute Changed +/** @brief RVC Operational State Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -5243,24 +5242,24 @@ chip::Protocols::InteractionModel::Status MatterRoboticVacuumOperationalStateClu * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterRoboticVacuumOperationalStateClusterClientPreAttributeChangedCallback( +chip::Protocols::InteractionModel::Status MatterRvcOperationalStateClusterClientPreAttributeChangedCallback( const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Robotic Vacuum Operational State Cluster Server Tick +/** @brief RVC Operational State Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfRoboticVacuumOperationalStateClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfRvcOperationalStateClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief Robotic Vacuum Operational State Cluster Client Tick +/** @brief RVC Operational State Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfRoboticVacuumOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfRvcOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); // // HEPA Filter Monitoring Cluster @@ -11785,29 +11784,29 @@ bool emberAfOperationalStateClusterResumeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OperationalState::Commands::Resume::DecodableType & commandData); /** - * @brief Robotic Vacuum Operational State Cluster Pause Command callback (from client) + * @brief RVC Operational State Cluster Pause Command callback (from client) */ -bool emberAfRoboticVacuumOperationalStateClusterPauseCallback( +bool emberAfRvcOperationalStateClusterPauseCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Pause::DecodableType & commandData); + const chip::app::Clusters::RvcOperationalState::Commands::Pause::DecodableType & commandData); /** - * @brief Robotic Vacuum Operational State Cluster Stop Command callback (from client) + * @brief RVC Operational State Cluster Stop Command callback (from client) */ -bool emberAfRoboticVacuumOperationalStateClusterStopCallback( +bool emberAfRvcOperationalStateClusterStopCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Stop::DecodableType & commandData); + const chip::app::Clusters::RvcOperationalState::Commands::Stop::DecodableType & commandData); /** - * @brief Robotic Vacuum Operational State Cluster Start Command callback (from client) + * @brief RVC Operational State Cluster Start Command callback (from client) */ -bool emberAfRoboticVacuumOperationalStateClusterStartCallback( +bool emberAfRvcOperationalStateClusterStartCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Start::DecodableType & commandData); + const chip::app::Clusters::RvcOperationalState::Commands::Start::DecodableType & commandData); /** - * @brief Robotic Vacuum Operational State Cluster Resume Command callback (from client) + * @brief RVC Operational State Cluster Resume Command callback (from client) */ -bool emberAfRoboticVacuumOperationalStateClusterResumeCallback( +bool emberAfRvcOperationalStateClusterResumeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Resume::DecodableType & commandData); + 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 ae43f68d2231d2..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 @@ -1466,9 +1466,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(OperationalState::Opera } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RoboticVacuumOperationalState::ErrorStateEnum val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcOperationalState::ErrorStateEnum val) { - using EnumType = RoboticVacuumOperationalState::ErrorStateEnum; + using EnumType = RvcOperationalState::ErrorStateEnum; switch (val) { case EnumType::kFailedToFindChargingDock: @@ -1484,9 +1484,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RoboticVacuumOperationa return static_cast(0); } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RoboticVacuumOperationalState::OperationalStateEnum val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcOperationalState::OperationalStateEnum val) { - using EnumType = RoboticVacuumOperationalState::OperationalStateEnum; + using EnumType = RvcOperationalState::OperationalStateEnum; switch (val) { case EnumType::kSeekingCharger: 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 3561c6fdb305e3..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 @@ -1796,7 +1796,7 @@ enum class OperationalStateEnum : uint8_t }; } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { // Enum for ErrorStateEnum enum class ErrorStateEnum : uint8_t @@ -1828,7 +1828,7 @@ enum class OperationalStateEnum : uint8_t // enum value. This specific should never be transmitted. kUnknownEnumValue = 0, }; -} // namespace RoboticVacuumOperationalState +} // namespace RvcOperationalState namespace HepaFilterMonitoring { 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 830f6bfbf77794..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 @@ -13325,7 +13325,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Structs {} // namespace Structs namespace Commands { @@ -13634,7 +13634,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace OperationCompletion. } // namespace Events -} // namespace RoboticVacuumOperationalState +} // namespace RvcOperationalState namespace HepaFilterMonitoring { namespace Commands { @@ -28200,7 +28200,7 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } - case Clusters::RoboticVacuumOperationalState::Id: { + case Clusters::RvcOperationalState::Id: { switch (aCommand) { default: 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 d54a2be325c224..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 @@ -16794,7 +16794,7 @@ struct DecodableType } // namespace OperationCompletion } // namespace Events } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Structs { namespace ErrorStateStruct = Clusters::detail::Structs::ErrorStateStruct; namespace OperationalStateStruct = Clusters::detail::Structs::OperationalStateStruct; @@ -16841,11 +16841,11 @@ 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::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -16854,7 +16854,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::Pause::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -16869,11 +16869,11 @@ 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::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -16882,7 +16882,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -16897,11 +16897,11 @@ 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::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -16910,7 +16910,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::Start::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -16925,11 +16925,11 @@ 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::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -16938,7 +16938,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::Resume::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -16954,7 +16954,7 @@ 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::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } Structs::ErrorStateStruct::Type commandResponseState; @@ -16969,7 +16969,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::OperationalCommandResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } Structs::ErrorStateStruct::DecodableType commandResponseState; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -16986,7 +16986,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable>; using DecodableArgType = const chip::app::DataModel::Nullable> &; - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::PhaseList::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -16998,7 +16998,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPhase::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -17010,7 +17010,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CountdownTime::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -17018,14 +17018,13 @@ struct TypeInfo namespace OperationalStateList { struct TypeInfo { - using Type = - chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType>; + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType>; using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> &; + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> &; - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OperationalStateList::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -17033,12 +17032,11 @@ struct TypeInfo namespace OperationalState { struct TypeInfo { - using Type = chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::Type; - using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType; - using DecodableArgType = - const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType &; + 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::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OperationalState::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -17046,11 +17044,11 @@ struct TypeInfo namespace OperationalError { struct TypeInfo { - using Type = chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::Type; - using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType; - using DecodableArgType = const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType &; + 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::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OperationalError::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -17058,37 +17056,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + 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::RoboticVacuumOperationalState::Id; } + 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::RoboticVacuumOperationalState::Id; } + 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::RoboticVacuumOperationalState::Id; } + 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::RoboticVacuumOperationalState::Id; } + 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::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } }; } // namespace ClusterRevision @@ -17096,7 +17094,7 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); @@ -17129,7 +17127,7 @@ struct Type public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return Events::OperationalError::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr bool kIsFabricScoped = false; Structs::ErrorStateStruct::Type errorState; @@ -17142,7 +17140,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return Events::OperationalError::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } Structs::ErrorStateStruct::DecodableType errorState; @@ -17164,7 +17162,7 @@ struct Type public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr bool kIsFabricScoped = false; uint8_t completionErrorCode = static_cast(0); @@ -17179,7 +17177,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } uint8_t completionErrorCode = static_cast(0); Optional> totalOperationalTime; @@ -17189,7 +17187,7 @@ struct DecodableType }; } // namespace OperationCompletion } // namespace Events -} // namespace RoboticVacuumOperationalState +} // 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 85ba1997e05139..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 @@ -3001,7 +3001,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Attributes { namespace PhaseList { @@ -3053,7 +3053,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace RoboticVacuumOperationalState +} // 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 349e007a1b96fa..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 @@ -184,9 +184,9 @@ static constexpr ClusterId Id = 0x0000005C; namespace OperationalState { static constexpr ClusterId Id = 0x00000060; } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { static constexpr ClusterId Id = 0x00000061; -} // namespace RoboticVacuumOperationalState +} // 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 bcc3bcd2b45fca..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 @@ -757,7 +757,7 @@ static constexpr CommandId Id = 0x00000004; } // namespace Commands } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Commands { namespace Pause { @@ -781,7 +781,7 @@ static constexpr CommandId Id = 0x00000004; } // namespace OperationalCommandResponse } // namespace Commands -} // namespace RoboticVacuumOperationalState +} // 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 1265841a3eabfe..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,7 +341,7 @@ static constexpr EventId Id = 0x00000001; } // namespace Events } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Events { namespace OperationalError { @@ -353,7 +353,7 @@ static constexpr EventId Id = 0x00000001; } // namespace OperationCompletion } // namespace Events -} // namespace RoboticVacuumOperationalState +} // 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 fdeb7b303f5c67..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 @@ -362,8 +362,7 @@ #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::RoboticVacuumOperationalState::Id, "Robotic Vacuum Operational State" }, +#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER { chip::app::Clusters::RvcOperationalState::Id, "RVC Operational State" }, #else #define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER #endif diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index ae6088ef5b9431..bc33ea2a4d5c96 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -85,7 +85,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | -| RoboticVacuumOperationalState | 0x0061 | +| RvcOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -4666,7 +4666,7 @@ class OperationalStateResume : public ClusterCommand }; /*----------------------------------------------------------------------------*\ -| Cluster RoboticVacuumOperationalState | 0x0061 | +| Cluster RvcOperationalState | 0x0061 | |------------------------------------------------------------------------------| | Commands: | | | * Pause | 0x00 | @@ -4696,10 +4696,10 @@ class OperationalStateResume : public ClusterCommand /* * Command Pause */ -class RoboticVacuumOperationalStatePause : public ClusterCommand +class RvcOperationalStatePause : public ClusterCommand { public: - RoboticVacuumOperationalStatePause(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("pause", credsIssuerConfig) + RvcOperationalStatePause(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("pause", credsIssuerConfig) { ClusterCommand::AddArguments(); } @@ -4719,16 +4719,16 @@ class RoboticVacuumOperationalStatePause : public ClusterCommand } private: - chip::app::Clusters::RoboticVacuumOperationalState::Commands::Pause::Type mRequest; + chip::app::Clusters::RvcOperationalState::Commands::Pause::Type mRequest; }; /* * Command Stop */ -class RoboticVacuumOperationalStateStop : public ClusterCommand +class RvcOperationalStateStop : public ClusterCommand { public: - RoboticVacuumOperationalStateStop(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("stop", credsIssuerConfig) + RvcOperationalStateStop(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("stop", credsIssuerConfig) { ClusterCommand::AddArguments(); } @@ -4748,16 +4748,16 @@ class RoboticVacuumOperationalStateStop : public ClusterCommand } private: - chip::app::Clusters::RoboticVacuumOperationalState::Commands::Stop::Type mRequest; + chip::app::Clusters::RvcOperationalState::Commands::Stop::Type mRequest; }; /* * Command Start */ -class RoboticVacuumOperationalStateStart : public ClusterCommand +class RvcOperationalStateStart : public ClusterCommand { public: - RoboticVacuumOperationalStateStart(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("start", credsIssuerConfig) + RvcOperationalStateStart(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("start", credsIssuerConfig) { ClusterCommand::AddArguments(); } @@ -4777,16 +4777,16 @@ class RoboticVacuumOperationalStateStart : public ClusterCommand } private: - chip::app::Clusters::RoboticVacuumOperationalState::Commands::Start::Type mRequest; + chip::app::Clusters::RvcOperationalState::Commands::Start::Type mRequest; }; /* * Command Resume */ -class RoboticVacuumOperationalStateResume : public ClusterCommand +class RvcOperationalStateResume : public ClusterCommand { public: - RoboticVacuumOperationalStateResume(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("resume", credsIssuerConfig) + RvcOperationalStateResume(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("resume", credsIssuerConfig) { ClusterCommand::AddArguments(); } @@ -4806,7 +4806,7 @@ class RoboticVacuumOperationalStateResume : public ClusterCommand } private: - chip::app::Clusters::RoboticVacuumOperationalState::Commands::Resume::Type mRequest; + chip::app::Clusters::RvcOperationalState::Commands::Resume::Type mRequest; }; /*----------------------------------------------------------------------------*\ @@ -15448,21 +15448,21 @@ void registerClusterOperationalState(Commands & commands, CredentialIssuerComman commands.Register(clusterName, clusterCommands); } -void registerClusterRoboticVacuumOperationalState(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterRvcOperationalState(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::RoboticVacuumOperationalState; + using namespace chip::app::Clusters::RvcOperationalState; - const char * clusterName = "RoboticVacuumOperationalState"; + const char * clusterName = "RvcOperationalState"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // @@ -15487,14 +15487,13 @@ void registerClusterRoboticVacuumOperationalState(Commands & commands, Credentia make_unique>>(Id, "countdown-time", 0, UINT32_MAX, Attributes::CountdownTime::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( + make_unique>>( Id, "operational-state-list", Attributes::OperationalStateList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique< - WriteAttributeAsComplex>( + make_unique>( Id, "operational-state", Attributes::OperationalState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>( + make_unique>( Id, "operational-error", Attributes::OperationalError::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, @@ -24454,7 +24453,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterAirQuality(commands, credsIssuerConfig); registerClusterSmokeCoAlarm(commands, credsIssuerConfig); registerClusterOperationalState(commands, credsIssuerConfig); - registerClusterRoboticVacuumOperationalState(commands, credsIssuerConfig); + registerClusterRvcOperationalState(commands, credsIssuerConfig); registerClusterHepaFilterMonitoring(commands, credsIssuerConfig); registerClusterActivatedCarbonFilterMonitoring(commands, credsIssuerConfig); registerClusterCeramicFilterMonitoring(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index ed66ba0b66efa0..071648f097ff34 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -3763,7 +3763,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 RoboticVacuumOperationalState::Events::OperationalError::DecodableType & value) + const RvcOperationalState::Events::OperationalError::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -3779,7 +3779,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 RoboticVacuumOperationalState::Events::OperationCompletion::DecodableType & value) + const RvcOperationalState::Events::OperationCompletion::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -4582,9 +4582,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 RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("commandResponseState", indent + 1, value.commandResponseState)); @@ -8552,67 +8551,67 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case RoboticVacuumOperationalState::Id: { + case RvcOperationalState::Id: { switch (path.mAttributeId) { - case RoboticVacuumOperationalState::Attributes::PhaseList::Id: { + case RvcOperationalState::Attributes::PhaseList::Id: { chip::app::DataModel::Nullable> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PhaseList", 1, value); } - case RoboticVacuumOperationalState::Attributes::CurrentPhase::Id: { + case RvcOperationalState::Attributes::CurrentPhase::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentPhase", 1, value); } - case RoboticVacuumOperationalState::Attributes::CountdownTime::Id: { + case RvcOperationalState::Attributes::CountdownTime::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CountdownTime", 1, value); } - case RoboticVacuumOperationalState::Attributes::OperationalStateList::Id: { + case RvcOperationalState::Attributes::OperationalStateList::Id: { chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationalStateList", 1, value); } - case RoboticVacuumOperationalState::Attributes::OperationalState::Id: { - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType 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 RoboticVacuumOperationalState::Attributes::OperationalError::Id: { - chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType 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 RoboticVacuumOperationalState::Attributes::GeneratedCommandList::Id: { + case RvcOperationalState::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case RoboticVacuumOperationalState::Attributes::AcceptedCommandList::Id: { + case RvcOperationalState::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case RoboticVacuumOperationalState::Attributes::EventList::Id: { + case RvcOperationalState::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case RoboticVacuumOperationalState::Attributes::AttributeList::Id: { + case RvcOperationalState::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case RoboticVacuumOperationalState::Attributes::FeatureMap::Id: { + case RvcOperationalState::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case RoboticVacuumOperationalState::Attributes::ClusterRevision::Id: { + case RvcOperationalState::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16434,11 +16433,11 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } - case RoboticVacuumOperationalState::Id: { + case RvcOperationalState::Id: { switch (path.mCommandId) { - case RoboticVacuumOperationalState::Commands::OperationalCommandResponse::Id: { - RoboticVacuumOperationalState::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); } @@ -17057,16 +17056,16 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } - case RoboticVacuumOperationalState::Id: { + case RvcOperationalState::Id: { switch (header.mPath.mEventId) { - case RoboticVacuumOperationalState::Events::OperationalError::Id: { - chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationalError::DecodableType value; + 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 RoboticVacuumOperationalState::Events::OperationCompletion::Id: { - chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationCompletion::DecodableType 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); } 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 09c46ddfd391b9..c259176393d7f8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -336,12 +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::RoboticVacuumOperationalState::Events::OperationalError::DecodableType & value); -static CHIP_ERROR -LogValue(const char * label, size_t indent, - const chip::app::Clusters::RoboticVacuumOperationalState::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, @@ -484,7 +482,7 @@ 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::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & value); + 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 ef2484b64c1f93..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: @@ -127144,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 4132917502ec2a..a0ad2c6fd475b1 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -88,7 +88,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | -| RoboticVacuumOperationalState | 0x0061 | +| RvcOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -45033,7 +45033,7 @@ class SubscribeAttributeOperationalStateClusterRevision : public SubscribeAttrib }; /*----------------------------------------------------------------------------*\ -| Cluster RoboticVacuumOperationalState | 0x0061 | +| Cluster RvcOperationalState | 0x0061 | |------------------------------------------------------------------------------| | Commands: | | | * Pause | 0x00 | @@ -45063,9 +45063,9 @@ class SubscribeAttributeOperationalStateClusterRevision : public SubscribeAttrib /* * Command Pause */ -class RoboticVacuumOperationalStatePause : public ClusterCommand { +class RvcOperationalStatePause : public ClusterCommand { public: - RoboticVacuumOperationalStatePause() + RvcOperationalStatePause() : ClusterCommand("pause") { ClusterCommand::AddArguments(); @@ -45076,17 +45076,17 @@ class RoboticVacuumOperationalStatePause : public ClusterCommand { 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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterPauseParams alloc] init]; + __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:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); responsesNeeded--; @@ -45108,9 +45108,9 @@ class RoboticVacuumOperationalStatePause : public ClusterCommand { /* * Command Stop */ -class RoboticVacuumOperationalStateStop : public ClusterCommand { +class RvcOperationalStateStop : public ClusterCommand { public: - RoboticVacuumOperationalStateStop() + RvcOperationalStateStop() : ClusterCommand("stop") { ClusterCommand::AddArguments(); @@ -45121,17 +45121,17 @@ class RoboticVacuumOperationalStateStop : public ClusterCommand { 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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterStopParams alloc] init]; + __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:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); responsesNeeded--; @@ -45153,9 +45153,9 @@ class RoboticVacuumOperationalStateStop : public ClusterCommand { /* * Command Start */ -class RoboticVacuumOperationalStateStart : public ClusterCommand { +class RvcOperationalStateStart : public ClusterCommand { public: - RoboticVacuumOperationalStateStart() + RvcOperationalStateStart() : ClusterCommand("start") { ClusterCommand::AddArguments(); @@ -45166,17 +45166,17 @@ class RoboticVacuumOperationalStateStart : public ClusterCommand { 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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterStartParams alloc] init]; + __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:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); responsesNeeded--; @@ -45198,9 +45198,9 @@ class RoboticVacuumOperationalStateStart : public ClusterCommand { /* * Command Resume */ -class RoboticVacuumOperationalStateResume : public ClusterCommand { +class RvcOperationalStateResume : public ClusterCommand { public: - RoboticVacuumOperationalStateResume() + RvcOperationalStateResume() : ClusterCommand("resume") { ClusterCommand::AddArguments(); @@ -45211,17 +45211,17 @@ class RoboticVacuumOperationalStateResume : public ClusterCommand { 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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterResumeParams alloc] init]; + __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:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); responsesNeeded--; @@ -45243,27 +45243,27 @@ class RoboticVacuumOperationalStateResume : public ClusterCommand { /* * Attribute PhaseList */ -class ReadRoboticVacuumOperationalStatePhaseList : public ReadAttribute { +class ReadRvcOperationalStatePhaseList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStatePhaseList() + ReadRvcOperationalStatePhaseList() : ReadAttribute("phase-list") { } - ~ReadRoboticVacuumOperationalStatePhaseList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributePhaseListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.PhaseList response %@", [value description]); + NSLog(@"RVCOperationalState.PhaseList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState PhaseList read Error", error); + LogNSError("RVCOperationalState PhaseList read Error", error); } SetCommandExitStatus(error); }]; @@ -45271,22 +45271,22 @@ class ReadRoboticVacuumOperationalStatePhaseList : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStatePhaseList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStatePhaseList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStatePhaseList() + SubscribeAttributeRvcOperationalStatePhaseList() : SubscribeAttribute("phase-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStatePhaseList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -45302,7 +45302,7 @@ class SubscribeAttributeRoboticVacuumOperationalStatePhaseList : public Subscrib mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.PhaseList response %@", [value description]); + NSLog(@"RVCOperationalState.PhaseList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45313,27 +45313,27 @@ class SubscribeAttributeRoboticVacuumOperationalStatePhaseList : public Subscrib /* * Attribute CurrentPhase */ -class ReadRoboticVacuumOperationalStateCurrentPhase : public ReadAttribute { +class ReadRvcOperationalStateCurrentPhase : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateCurrentPhase() + ReadRvcOperationalStateCurrentPhase() : ReadAttribute("current-phase") { } - ~ReadRoboticVacuumOperationalStateCurrentPhase() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeCurrentPhaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.CurrentPhase response %@", [value description]); + NSLog(@"RVCOperationalState.CurrentPhase response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState CurrentPhase read Error", error); + LogNSError("RVCOperationalState CurrentPhase read Error", error); } SetCommandExitStatus(error); }]; @@ -45341,22 +45341,22 @@ class ReadRoboticVacuumOperationalStateCurrentPhase : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateCurrentPhase : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase() + SubscribeAttributeRvcOperationalStateCurrentPhase() : SubscribeAttribute("current-phase") { } - ~SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -45372,7 +45372,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase : public Subsc mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.CurrentPhase response %@", [value description]); + NSLog(@"RVCOperationalState.CurrentPhase response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45383,27 +45383,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase : public Subsc /* * Attribute CountdownTime */ -class ReadRoboticVacuumOperationalStateCountdownTime : public ReadAttribute { +class ReadRvcOperationalStateCountdownTime : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateCountdownTime() + ReadRvcOperationalStateCountdownTime() : ReadAttribute("countdown-time") { } - ~ReadRoboticVacuumOperationalStateCountdownTime() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeCountdownTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.CountdownTime response %@", [value description]); + NSLog(@"RVCOperationalState.CountdownTime response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState CountdownTime read Error", error); + LogNSError("RVCOperationalState CountdownTime read Error", error); } SetCommandExitStatus(error); }]; @@ -45411,22 +45411,22 @@ class ReadRoboticVacuumOperationalStateCountdownTime : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateCountdownTime : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateCountdownTime : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateCountdownTime() + SubscribeAttributeRvcOperationalStateCountdownTime() : SubscribeAttribute("countdown-time") { } - ~SubscribeAttributeRoboticVacuumOperationalStateCountdownTime() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -45442,7 +45442,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateCountdownTime : public Subs mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.CountdownTime response %@", [value description]); + NSLog(@"RVCOperationalState.CountdownTime response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45453,27 +45453,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateCountdownTime : public Subs /* * Attribute OperationalStateList */ -class ReadRoboticVacuumOperationalStateOperationalStateList : public ReadAttribute { +class ReadRvcOperationalStateOperationalStateList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateOperationalStateList() + ReadRvcOperationalStateOperationalStateList() : ReadAttribute("operational-state-list") { } - ~ReadRoboticVacuumOperationalStateOperationalStateList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeOperationalStateListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalStateList response %@", [value description]); + NSLog(@"RVCOperationalState.OperationalStateList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState OperationalStateList read Error", error); + LogNSError("RVCOperationalState OperationalStateList read Error", error); } SetCommandExitStatus(error); }]; @@ -45481,22 +45481,22 @@ class ReadRoboticVacuumOperationalStateOperationalStateList : public ReadAttribu } }; -class SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateOperationalStateList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList() + SubscribeAttributeRvcOperationalStateOperationalStateList() : SubscribeAttribute("operational-state-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -45512,7 +45512,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList : publ mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalStateList response %@", [value description]); + NSLog(@"RVCOperationalState.OperationalStateList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45523,28 +45523,28 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList : publ /* * Attribute OperationalState */ -class ReadRoboticVacuumOperationalStateOperationalState : public ReadAttribute { +class ReadRvcOperationalStateOperationalState : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateOperationalState() + ReadRvcOperationalStateOperationalState() : ReadAttribute("operational-state") { } - ~ReadRoboticVacuumOperationalStateOperationalState() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeOperationalStateWithCompletion:^( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalState response %@", [value description]); + MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalState response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState OperationalState read Error", error); + LogNSError("RVCOperationalState OperationalState read Error", error); } SetCommandExitStatus(error); }]; @@ -45552,22 +45552,22 @@ class ReadRoboticVacuumOperationalStateOperationalState : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateOperationalState : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateOperationalState : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateOperationalState() + SubscribeAttributeRvcOperationalStateOperationalState() : SubscribeAttribute("operational-state") { } - ~SubscribeAttributeRoboticVacuumOperationalStateOperationalState() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -45582,9 +45582,8 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalState : public S subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalState response %@", [value description]); + reportHandler:^(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalState response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45595,28 +45594,28 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalState : public S /* * Attribute OperationalError */ -class ReadRoboticVacuumOperationalStateOperationalError : public ReadAttribute { +class ReadRvcOperationalStateOperationalError : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateOperationalError() + ReadRvcOperationalStateOperationalError() : ReadAttribute("operational-error") { } - ~ReadRoboticVacuumOperationalStateOperationalError() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeOperationalErrorWithCompletion:^( - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalError response %@", [value description]); + MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalError response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState OperationalError read Error", error); + LogNSError("RVCOperationalState OperationalError read Error", error); } SetCommandExitStatus(error); }]; @@ -45624,22 +45623,22 @@ class ReadRoboticVacuumOperationalStateOperationalError : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateOperationalError : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateOperationalError : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateOperationalError() + SubscribeAttributeRvcOperationalStateOperationalError() : SubscribeAttribute("operational-error") { } - ~SubscribeAttributeRoboticVacuumOperationalStateOperationalError() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -45654,8 +45653,8 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalError : public S subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalError response %@", [value description]); + reportHandler:^(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalError response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45666,27 +45665,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalError : public S /* * Attribute GeneratedCommandList */ -class ReadRoboticVacuumOperationalStateGeneratedCommandList : public ReadAttribute { +class ReadRvcOperationalStateGeneratedCommandList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateGeneratedCommandList() + ReadRvcOperationalStateGeneratedCommandList() : ReadAttribute("generated-command-list") { } - ~ReadRoboticVacuumOperationalStateGeneratedCommandList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.GeneratedCommandList response %@", [value description]); + NSLog(@"RVCOperationalState.GeneratedCommandList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState GeneratedCommandList read Error", error); + LogNSError("RVCOperationalState GeneratedCommandList read Error", error); } SetCommandExitStatus(error); }]; @@ -45694,22 +45693,22 @@ class ReadRoboticVacuumOperationalStateGeneratedCommandList : public ReadAttribu } }; -class SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList() + SubscribeAttributeRvcOperationalStateGeneratedCommandList() : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -45725,7 +45724,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList : publ mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.GeneratedCommandList response %@", [value description]); + NSLog(@"RVCOperationalState.GeneratedCommandList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45736,27 +45735,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList : publ /* * Attribute AcceptedCommandList */ -class ReadRoboticVacuumOperationalStateAcceptedCommandList : public ReadAttribute { +class ReadRvcOperationalStateAcceptedCommandList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateAcceptedCommandList() + ReadRvcOperationalStateAcceptedCommandList() : ReadAttribute("accepted-command-list") { } - ~ReadRoboticVacuumOperationalStateAcceptedCommandList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.AcceptedCommandList response %@", [value description]); + NSLog(@"RVCOperationalState.AcceptedCommandList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState AcceptedCommandList read Error", error); + LogNSError("RVCOperationalState AcceptedCommandList read Error", error); } SetCommandExitStatus(error); }]; @@ -45764,22 +45763,22 @@ class ReadRoboticVacuumOperationalStateAcceptedCommandList : public ReadAttribut } }; -class SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList() + SubscribeAttributeRvcOperationalStateAcceptedCommandList() : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -45795,7 +45794,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList : publi mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.AcceptedCommandList response %@", [value description]); + NSLog(@"RVCOperationalState.AcceptedCommandList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45806,27 +45805,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList : publi /* * Attribute EventList */ -class ReadRoboticVacuumOperationalStateEventList : public ReadAttribute { +class ReadRvcOperationalStateEventList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateEventList() + ReadRvcOperationalStateEventList() : ReadAttribute("event-list") { } - ~ReadRoboticVacuumOperationalStateEventList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.EventList response %@", [value description]); + NSLog(@"RVCOperationalState.EventList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState EventList read Error", error); + LogNSError("RVCOperationalState EventList read Error", error); } SetCommandExitStatus(error); }]; @@ -45834,22 +45833,22 @@ class ReadRoboticVacuumOperationalStateEventList : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateEventList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateEventList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateEventList() + SubscribeAttributeRvcOperationalStateEventList() : SubscribeAttribute("event-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStateEventList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -45865,7 +45864,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateEventList : public Subscrib mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.EventList response %@", [value description]); + NSLog(@"RVCOperationalState.EventList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45876,27 +45875,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateEventList : public Subscrib /* * Attribute AttributeList */ -class ReadRoboticVacuumOperationalStateAttributeList : public ReadAttribute { +class ReadRvcOperationalStateAttributeList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateAttributeList() + ReadRvcOperationalStateAttributeList() : ReadAttribute("attribute-list") { } - ~ReadRoboticVacuumOperationalStateAttributeList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.AttributeList response %@", [value description]); + NSLog(@"RVCOperationalState.AttributeList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState AttributeList read Error", error); + LogNSError("RVCOperationalState AttributeList read Error", error); } SetCommandExitStatus(error); }]; @@ -45904,22 +45903,22 @@ class ReadRoboticVacuumOperationalStateAttributeList : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateAttributeList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateAttributeList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateAttributeList() + SubscribeAttributeRvcOperationalStateAttributeList() : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStateAttributeList() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -45935,7 +45934,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateAttributeList : public Subs mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.AttributeList response %@", [value description]); + NSLog(@"RVCOperationalState.AttributeList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45946,27 +45945,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateAttributeList : public Subs /* * Attribute FeatureMap */ -class ReadRoboticVacuumOperationalStateFeatureMap : public ReadAttribute { +class ReadRvcOperationalStateFeatureMap : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateFeatureMap() + ReadRvcOperationalStateFeatureMap() : ReadAttribute("feature-map") { } - ~ReadRoboticVacuumOperationalStateFeatureMap() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.FeatureMap response %@", [value description]); + NSLog(@"RVCOperationalState.FeatureMap response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState FeatureMap read Error", error); + LogNSError("RVCOperationalState FeatureMap read Error", error); } SetCommandExitStatus(error); }]; @@ -45974,22 +45973,22 @@ class ReadRoboticVacuumOperationalStateFeatureMap : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateFeatureMap : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateFeatureMap() + SubscribeAttributeRvcOperationalStateFeatureMap() : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeRoboticVacuumOperationalStateFeatureMap() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -46005,7 +46004,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateFeatureMap : public Subscri mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.FeatureMap response %@", [value description]); + NSLog(@"RVCOperationalState.FeatureMap response %@", [value description]); SetCommandExitStatus(error); }]; @@ -46016,27 +46015,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateFeatureMap : public Subscri /* * Attribute ClusterRevision */ -class ReadRoboticVacuumOperationalStateClusterRevision : public ReadAttribute { +class ReadRvcOperationalStateClusterRevision : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateClusterRevision() + ReadRvcOperationalStateClusterRevision() : ReadAttribute("cluster-revision") { } - ~ReadRoboticVacuumOperationalStateClusterRevision() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.ClusterRevision response %@", [value description]); + NSLog(@"RVCOperationalState.ClusterRevision response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState ClusterRevision read Error", error); + LogNSError("RVCOperationalState ClusterRevision read Error", error); } SetCommandExitStatus(error); }]; @@ -46044,22 +46043,22 @@ class ReadRoboticVacuumOperationalStateClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateClusterRevision : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateClusterRevision() + SubscribeAttributeRvcOperationalStateClusterRevision() : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeRoboticVacuumOperationalStateClusterRevision() {} + ~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 = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __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(); @@ -46075,7 +46074,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateClusterRevision : public Su mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.ClusterRevision response %@", [value description]); + NSLog(@"RVCOperationalState.ClusterRevision response %@", [value description]); SetCommandExitStatus(error); }]; @@ -123646,45 +123645,45 @@ void registerClusterOperationalState(Commands & commands) commands.Register(clusterName, clusterCommands); } -void registerClusterRoboticVacuumOperationalState(Commands & commands) +void registerClusterRvcOperationalState(Commands & commands) { - using namespace chip::app::Clusters::RoboticVacuumOperationalState; + using namespace chip::app::Clusters::RvcOperationalState; - const char * clusterName = "RoboticVacuumOperationalState"; + const char * clusterName = "RvcOperationalState"; commands_list clusterCommands = { make_unique(Id), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(Id), // - make_unique(), // + 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(), // + 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), // }; @@ -126397,7 +126396,7 @@ void registerClusters(Commands & commands) registerClusterAirQuality(commands); registerClusterSmokeCoAlarm(commands); registerClusterOperationalState(commands); - registerClusterRoboticVacuumOperationalState(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 8e63582212e6a6..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 @@ -148029,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(),