diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index 6e076c8d97e799..83adb93e91fffc 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -38,6 +38,14 @@ "Disabled because the power source configuration cluster is now deprecated and not present in all-clusters", "Test_TC_PSCFG_1_1", "Test_TC_PSCFG_2_1", - "Test_TC_PSCFG_2_2" + "Test_TC_PSCFG_2_2", + "Disabled due to SmokeCOAlarm not being enabled in Matter.framework for now:", + "Test_TC_SMCO_1_1", + "Test_TC_SMCO_2_1", + "Test_TC_SMCO_2_2", + "Test_TC_SMCO_2_3", + "Test_TC_SMCO_2_4", + "Test_TC_SMCO_2_5", + "Test_TC_SMCO_2_6" ] } diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index f3a361a71119e9..fd4e3ef135a2ca 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -1725,223 +1725,6 @@ server cluster SmokeCoAlarm = 92 { command SelfTestRequest(): DefaultSuccess = 0; } -/** The Test Cluster is meant to validate the generated code */ -server cluster UnitTesting = 4294048773 { - enum SimpleEnum : ENUM8 { - kUnspecified = 0; - kValueA = 1; - kValueB = 2; - kValueC = 3; - } - - bitmap Bitmap16MaskMap : BITMAP16 { - kMaskVal1 = 0x1; - kMaskVal2 = 0x2; - kMaskVal3 = 0x4; - kMaskVal4 = 0x4000; - } - - bitmap Bitmap32MaskMap : BITMAP32 { - kMaskVal1 = 0x1; - kMaskVal2 = 0x2; - kMaskVal3 = 0x4; - kMaskVal4 = 0x40000000; - } - - bitmap Bitmap64MaskMap : BITMAP64 { - kMaskVal1 = 0x1; - kMaskVal2 = 0x2; - kMaskVal3 = 0x4; - kMaskVal4 = 0x4000000000000000; - } - - bitmap Bitmap8MaskMap : BITMAP8 { - kMaskVal1 = 0x1; - kMaskVal2 = 0x2; - kMaskVal3 = 0x4; - kMaskVal4 = 0x40; - } - - bitmap SimpleBitmap : BITMAP8 { - kValueA = 0x1; - kValueB = 0x2; - kValueC = 0x4; - } - - struct SimpleStruct { - int8u a = 0; - boolean b = 1; - SimpleEnum c = 2; - octet_string d = 3; - char_string e = 4; - SimpleBitmap f = 5; - single g = 6; - double h = 7; - } - - fabric_scoped struct TestFabricScoped { - fabric_sensitive int8u fabricSensitiveInt8u = 1; - optional fabric_sensitive int8u optionalFabricSensitiveInt8u = 2; - nullable fabric_sensitive int8u nullableFabricSensitiveInt8u = 3; - optional nullable fabric_sensitive int8u nullableOptionalFabricSensitiveInt8u = 4; - fabric_sensitive char_string fabricSensitiveCharString = 5; - fabric_sensitive SimpleStruct fabricSensitiveStruct = 6; - fabric_sensitive int8u fabricSensitiveInt8uList[] = 7; - fabric_idx fabricIndex = 254; - } - - struct NullablesAndOptionalsStruct { - nullable int16u nullableInt = 0; - optional int16u optionalInt = 1; - optional nullable int16u nullableOptionalInt = 2; - nullable char_string nullableString = 3; - optional char_string optionalString = 4; - optional nullable char_string nullableOptionalString = 5; - nullable SimpleStruct nullableStruct = 6; - optional SimpleStruct optionalStruct = 7; - optional nullable SimpleStruct nullableOptionalStruct = 8; - nullable SimpleEnum nullableList[] = 9; - optional SimpleEnum optionalList[] = 10; - optional nullable SimpleEnum nullableOptionalList[] = 11; - } - - struct NestedStruct { - int8u a = 0; - boolean b = 1; - SimpleStruct c = 2; - } - - struct NestedStructList { - int8u a = 0; - boolean b = 1; - SimpleStruct c = 2; - SimpleStruct d[] = 3; - int32u e[] = 4; - octet_string f[] = 5; - int8u g[] = 6; - } - - struct DoubleNestedStructList { - NestedStructList a[] = 0; - } - - struct TestListStructOctet { - int64u member1 = 0; - octet_string<32> member2 = 1; - } - - info event TestEvent = 1 { - INT8U arg1 = 1; - SimpleEnum arg2 = 2; - BOOLEAN arg3 = 3; - SimpleStruct arg4 = 4; - SimpleStruct arg5[] = 5; - SimpleEnum arg6[] = 6; - } - - fabric_sensitive info event TestFabricScopedEvent = 2 { - fabric_idx fabricIndex = 254; - } - - attribute boolean boolean = 0; - attribute Bitmap8MaskMap bitmap8 = 1; - attribute Bitmap16MaskMap bitmap16 = 2; - attribute Bitmap32MaskMap bitmap32 = 3; - attribute Bitmap64MaskMap bitmap64 = 4; - attribute int8u int8u = 5; - attribute int16u int16u = 6; - attribute int24u int24u = 7; - attribute int32u int32u = 8; - attribute int40u int40u = 9; - attribute int48u int48u = 10; - attribute int56u int56u = 11; - attribute int64u int64u = 12; - attribute int8s int8s = 13; - attribute int16s int16s = 14; - attribute int24s int24s = 15; - attribute int32s int32s = 16; - attribute int40s int40s = 17; - attribute int48s int48s = 18; - attribute int56s int56s = 19; - attribute int64s int64s = 20; - attribute enum8 enum8 = 21; - attribute enum16 enum16 = 22; - attribute single floatSingle = 23; - attribute double floatDouble = 24; - attribute octet_string<10> octetString = 25; - attribute INT8U listInt8u[] = 26; - attribute OCTET_STRING listOctetString[] = 27; - attribute TestListStructOctet listStructOctetString[] = 28; - attribute long_octet_string<1000> longOctetString = 29; - attribute char_string<10> charString = 30; - attribute long_char_string<1000> longCharString = 31; - attribute epoch_us epochUs = 32; - attribute epoch_s epochS = 33; - attribute vendor_id vendorId = 34; - attribute NullablesAndOptionalsStruct listNullablesAndOptionalsStruct[] = 35; - attribute SimpleEnum enumAttr = 36; - attribute SimpleStruct structAttr = 37; - attribute int8u rangeRestrictedInt8u = 38; - attribute int8s rangeRestrictedInt8s = 39; - attribute int16u rangeRestrictedInt16u = 40; - attribute int16s rangeRestrictedInt16s = 41; - attribute LONG_OCTET_STRING listLongOctetString[] = 42; - attribute TestFabricScoped listFabricScoped[] = 43; - timedwrite attribute boolean timedWriteBoolean = 48; - attribute boolean generalErrorBoolean = 49; - attribute boolean clusterErrorBoolean = 50; - attribute nullable boolean nullableBoolean = 16384; - attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385; - attribute nullable Bitmap16MaskMap nullableBitmap16 = 16386; - attribute nullable Bitmap32MaskMap nullableBitmap32 = 16387; - attribute nullable Bitmap64MaskMap nullableBitmap64 = 16388; - attribute nullable int8u nullableInt8u = 16389; - attribute nullable int16u nullableInt16u = 16390; - attribute nullable int24u nullableInt24u = 16391; - attribute nullable int32u nullableInt32u = 16392; - attribute nullable int40u nullableInt40u = 16393; - attribute nullable int48u nullableInt48u = 16394; - attribute nullable int56u nullableInt56u = 16395; - attribute nullable int64u nullableInt64u = 16396; - attribute nullable int8s nullableInt8s = 16397; - attribute nullable int16s nullableInt16s = 16398; - attribute nullable int24s nullableInt24s = 16399; - attribute nullable int32s nullableInt32s = 16400; - attribute nullable int40s nullableInt40s = 16401; - attribute nullable int48s nullableInt48s = 16402; - attribute nullable int56s nullableInt56s = 16403; - attribute nullable int64s nullableInt64s = 16404; - attribute nullable enum8 nullableEnum8 = 16405; - attribute nullable enum16 nullableEnum16 = 16406; - attribute nullable single nullableFloatSingle = 16407; - attribute nullable double nullableFloatDouble = 16408; - attribute nullable octet_string<10> nullableOctetString = 16409; - attribute nullable char_string<10> nullableCharString = 16414; - attribute nullable SimpleEnum nullableEnumAttr = 16420; - attribute nullable SimpleStruct nullableStruct = 16421; - attribute nullable int8u nullableRangeRestrictedInt8u = 16422; - attribute nullable int8s nullableRangeRestrictedInt8s = 16423; - attribute nullable int16u nullableRangeRestrictedInt16u = 16424; - attribute nullable int16s nullableRangeRestrictedInt16s = 16425; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct TestEmitTestEventRequestRequest { - INT8U arg1 = 0; - SimpleEnum arg2 = 1; - BOOLEAN arg3 = 2; - } - - command Test(): DefaultSuccess = 0; - command TestNotHandled(): DefaultSuccess = 1; - command TestSpecific(): TestSpecificResponse = 2; - command TestEmitTestEventRequest(TestEmitTestEventRequestRequest): TestEmitTestEventResponse = 20; -} - endpoint 0 { device type rootdevice = 22, version 1; binding cluster OtaSoftwareUpdateProvider; @@ -2245,92 +2028,6 @@ endpoint 1 { ram attribute featureMap default = 3; ram attribute clusterRevision default = 1; } - - server cluster UnitTesting { - emits event TestEvent; - ram attribute boolean default = false; - ram attribute bitmap8 default = 0; - ram attribute bitmap16 default = 0; - ram attribute bitmap32 default = 0; - ram attribute bitmap64 default = 0; - ram attribute int8u default = 0; - ram attribute int16u default = 0; - ram attribute int24u default = 0; - ram attribute int32u default = 0; - ram attribute int40u default = 0; - ram attribute int48u default = 0; - ram attribute int56u default = 0; - ram attribute int64u default = 0; - ram attribute int8s default = 0; - ram attribute int16s default = 0; - ram attribute int24s default = 0; - ram attribute int32s default = 0; - ram attribute int40s default = 0; - ram attribute int48s default = 0; - ram attribute int56s default = 0; - ram attribute int64s default = 0; - ram attribute enum8 default = 0; - ram attribute enum16 default = 0; - ram attribute floatSingle default = 0; - ram attribute floatDouble default = 0; - ram attribute octetString; - callback attribute listInt8u; - callback attribute listOctetString; - callback attribute listStructOctetString; - ram attribute longOctetString; - ram attribute charString; - ram attribute longCharString; - ram attribute epochUs; - ram attribute epochS; - ram attribute vendorId default = 0; - callback attribute listNullablesAndOptionalsStruct; - ram attribute enumAttr; - callback attribute structAttr; - ram attribute rangeRestrictedInt8u default = 70; - ram attribute rangeRestrictedInt8s default = -5; - ram attribute rangeRestrictedInt16u default = 200; - ram attribute rangeRestrictedInt16s default = -5; - callback attribute listLongOctetString; - callback attribute listFabricScoped; - ram attribute timedWriteBoolean; - callback attribute generalErrorBoolean; - callback attribute clusterErrorBoolean; - ram attribute nullableBoolean default = false; - ram attribute nullableBitmap8 default = 0; - ram attribute nullableBitmap16 default = 0; - ram attribute nullableBitmap32 default = 0; - ram attribute nullableBitmap64 default = 0; - ram attribute nullableInt8u default = 0; - ram attribute nullableInt16u default = 0; - ram attribute nullableInt24u default = 0; - ram attribute nullableInt32u default = 0; - ram attribute nullableInt40u default = 0; - ram attribute nullableInt48u default = 0; - ram attribute nullableInt56u default = 0; - ram attribute nullableInt64u default = 0; - ram attribute nullableInt8s default = 0; - ram attribute nullableInt16s default = 0; - ram attribute nullableInt24s default = 0; - ram attribute nullableInt32s default = 0; - ram attribute nullableInt40s default = 0; - ram attribute nullableInt48s default = 0; - ram attribute nullableInt56s default = 0; - ram attribute nullableInt64s default = 0; - ram attribute nullableEnum8 default = 0; - ram attribute nullableEnum16 default = 0; - ram attribute nullableFloatSingle default = 0; - ram attribute nullableFloatDouble default = 0; - ram attribute nullableOctetString; - ram attribute nullableCharString; - ram attribute nullableEnumAttr; - callback attribute nullableStruct; - ram attribute nullableRangeRestrictedInt8u default = 70; - ram attribute nullableRangeRestrictedInt8s default = -5; - ram attribute nullableRangeRestrictedInt16u default = 200; - ram attribute nullableRangeRestrictedInt16s default = -5; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } } diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap index 938cb271bacc04..8a4bba62e7b8ab 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap @@ -7109,1509 +7109,6 @@ "included": 1 } ] - }, - { - "name": "Unit Testing", - "code": 4294048773, - "mfgCode": null, - "define": "UNIT_TESTING_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "Test", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "TestNotHandled", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "TestSpecific", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "TestEmitTestEventRequest", - "code": 20, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Unit Testing", - "code": 4294048773, - "mfgCode": null, - "define": "UNIT_TESTING_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "boolean", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "false", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "bitmap8", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "Bitmap8MaskMap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "bitmap16", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "Bitmap16MaskMap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "bitmap32", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "Bitmap32MaskMap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "bitmap64", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "Bitmap64MaskMap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int8u", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int16u", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int24u", - "code": 7, - "mfgCode": null, - "side": "server", - "type": "int24u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int32u", - "code": 8, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int40u", - "code": 9, - "mfgCode": null, - "side": "server", - "type": "int40u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int48u", - "code": 10, - "mfgCode": null, - "side": "server", - "type": "int48u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int56u", - "code": 11, - "mfgCode": null, - "side": "server", - "type": "int56u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int64u", - "code": 12, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int8s", - "code": 13, - "mfgCode": null, - "side": "server", - "type": "int8s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int16s", - "code": 14, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int24s", - "code": 15, - "mfgCode": null, - "side": "server", - "type": "int24s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int32s", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "int32s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int40s", - "code": 17, - "mfgCode": null, - "side": "server", - "type": "int40s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int48s", - "code": 18, - "mfgCode": null, - "side": "server", - "type": "int48s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int56s", - "code": 19, - "mfgCode": null, - "side": "server", - "type": "int56s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "int64s", - "code": 20, - "mfgCode": null, - "side": "server", - "type": "int64s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "enum8", - "code": 21, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "enum16", - "code": 22, - "mfgCode": null, - "side": "server", - "type": "enum16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "float_single", - "code": 23, - "mfgCode": null, - "side": "server", - "type": "single", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "float_double", - "code": 24, - "mfgCode": null, - "side": "server", - "type": "double", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "octet_string", - "code": 25, - "mfgCode": null, - "side": "server", - "type": "octet_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "list_int8u", - "code": 26, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "list_octet_string", - "code": 27, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "list_struct_octet_string", - "code": 28, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "long_octet_string", - "code": 29, - "mfgCode": null, - "side": "server", - "type": "long_octet_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "char_string", - "code": 30, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "long_char_string", - "code": 31, - "mfgCode": null, - "side": "server", - "type": "long_char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "epoch_us", - "code": 32, - "mfgCode": null, - "side": "server", - "type": "epoch_us", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "epoch_s", - "code": 33, - "mfgCode": null, - "side": "server", - "type": "epoch_s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "vendor_id", - "code": 34, - "mfgCode": null, - "side": "server", - "type": "vendor_id", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "list_nullables_and_optionals_struct", - "code": 35, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "enum_attr", - "code": 36, - "mfgCode": null, - "side": "server", - "type": "SimpleEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "struct_attr", - "code": 37, - "mfgCode": null, - "side": "server", - "type": "SimpleStruct", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "range_restricted_int8u", - "code": 38, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "70", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "range_restricted_int8s", - "code": 39, - "mfgCode": null, - "side": "server", - "type": "int8s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "-5", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "range_restricted_int16u", - "code": 40, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "200", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "range_restricted_int16s", - "code": 41, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "-5", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "list_long_octet_string", - "code": 42, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "list_fabric_scoped", - "code": 43, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "timed_write_boolean", - "code": 48, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "general_error_boolean", - "code": 49, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "cluster_error_boolean", - "code": 50, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "unsupported", - "code": 255, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_boolean", - "code": 16384, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "false", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_bitmap8", - "code": 16385, - "mfgCode": null, - "side": "server", - "type": "Bitmap8MaskMap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_bitmap16", - "code": 16386, - "mfgCode": null, - "side": "server", - "type": "Bitmap16MaskMap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_bitmap32", - "code": 16387, - "mfgCode": null, - "side": "server", - "type": "Bitmap32MaskMap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_bitmap64", - "code": 16388, - "mfgCode": null, - "side": "server", - "type": "Bitmap64MaskMap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int8u", - "code": 16389, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int16u", - "code": 16390, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int24u", - "code": 16391, - "mfgCode": null, - "side": "server", - "type": "int24u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int32u", - "code": 16392, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int40u", - "code": 16393, - "mfgCode": null, - "side": "server", - "type": "int40u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int48u", - "code": 16394, - "mfgCode": null, - "side": "server", - "type": "int48u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int56u", - "code": 16395, - "mfgCode": null, - "side": "server", - "type": "int56u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int64u", - "code": 16396, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int8s", - "code": 16397, - "mfgCode": null, - "side": "server", - "type": "int8s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int16s", - "code": 16398, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int24s", - "code": 16399, - "mfgCode": null, - "side": "server", - "type": "int24s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int32s", - "code": 16400, - "mfgCode": null, - "side": "server", - "type": "int32s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int40s", - "code": 16401, - "mfgCode": null, - "side": "server", - "type": "int40s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int48s", - "code": 16402, - "mfgCode": null, - "side": "server", - "type": "int48s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int56s", - "code": 16403, - "mfgCode": null, - "side": "server", - "type": "int56s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_int64s", - "code": 16404, - "mfgCode": null, - "side": "server", - "type": "int64s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_enum8", - "code": 16405, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_enum16", - "code": 16406, - "mfgCode": null, - "side": "server", - "type": "enum16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_float_single", - "code": 16407, - "mfgCode": null, - "side": "server", - "type": "single", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_float_double", - "code": 16408, - "mfgCode": null, - "side": "server", - "type": "double", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_octet_string", - "code": 16409, - "mfgCode": null, - "side": "server", - "type": "octet_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_char_string", - "code": 16414, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_enum_attr", - "code": 16420, - "mfgCode": null, - "side": "server", - "type": "SimpleEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_struct", - "code": 16421, - "mfgCode": null, - "side": "server", - "type": "SimpleStruct", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int8u", - "code": 16422, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "70", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int8s", - "code": 16423, - "mfgCode": null, - "side": "server", - "type": "int8s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "-5", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int16u", - "code": 16424, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "200", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int16s", - "code": 16425, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "-5", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "write_only_int8u", - "code": 16426, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ], - "events": [ - { - "name": "TestEvent", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1 - } - ] } ] } diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index e88d246ed74339..87c308c60030f6 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -143,6 +143,11 @@ def _GetInDevelopmentTests() -> Set[str]: "Test_TC_PSCFG_1_1.yaml", # Power source configuration cluster is deprecated and removed from all-clusters "Test_TC_PSCFG_2_1.yaml", # Power source configuration cluster is deprecated and removed from all-clusters "Test_TC_PSCFG_2_2.yaml", # Power source configuration cluster is deprecated and removed from all-clusters + "Test_TC_SMCO_2_2.yaml", # chip-repl does not support timeout (07/20/2023) + "Test_TC_SMCO_2_3.yaml", # chip-repl does not support timeout (07/20/2023) + "Test_TC_SMCO_2_4.yaml", # chip-repl does not support timeout (07/20/2023) + "Test_TC_SMCO_2_5.yaml", # chip-repl does not support timeout (07/20/2023) + "Test_TC_SMCO_2_6.yaml", # chip-repl does not support timeout (07/20/2023) } diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 7bc663fe5f54bd..25ebac3b8dde39 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -5903,6 +5903,119 @@ PICS: - label: "Read all supported mandatory attribute" id: S.C.AM-READ + # Smoke CO Alarm Cluster Test Plan + - label: "Does the device implement the SMOKECO cluster as a server?" + id: SMOKECO.S + + - label: "Does the device implement the SMOKECO cluster as a client?" + id: SMOKECO.C + + # + # server / features + # + - label: "Does the device support this specific cluster feature?" + id: SMOKECO.S.F00 + + - label: "Does the device support this specific cluster feature?" + id: SMOKECO.S.F01 + + # + # server / attributes + # + - label: "Does the device implement the ExpressedState attribute?" + id: SMOKECO.S.A0000 + + - label: "Does the device implement the SmokeState attribute?" + id: SMOKECO.S.A0001 + + - label: "Does the device implement the COState attribute?" + id: SMOKECO.S.A0002 + + - label: "Does the device implement the BatteryAlert attribute?" + id: SMOKECO.S.A0003 + + - label: "Does the device implement the DeviceMuted attribute?" + id: SMOKECO.S.A0004 + + - label: "Does the device implement the TestInProgress attribute?" + id: SMOKECO.S.A0005 + + - label: "Does the device implement the HardwareFaultAlert attribute?" + id: SMOKECO.S.A0006 + + - label: "Does the device implement the EndOfServiceAlert attribute?" + id: SMOKECO.S.A0007 + + - label: "Does the device implement the InterconnectSmokeAlarm attribute?" + id: SMOKECO.S.A0008 + + - label: "Does the device implement the InterconnectCOAlarm attribute?" + id: SMOKECO.S.A0009 + + - label: "Does the device implement the ContaminationState attribute?" + id: SMOKECO.S.A000a + + - label: "Does the device implement the SensitivityLevel attribute?" + id: SMOKECO.S.A000b + + - label: "Does the device implement the ExpiryDate attribute?" + id: SMOKECO.S.A000c + + # + # server / Events + # + - label: "Does the device implement the SmokeAlarm event?" + id: SMOKECO.S.E00 + + - label: "Does the device implement the COAlarm event?" + id: SMOKECO.S.E01 + + - label: "Does the device implement the LowBattery event?" + id: SMOKECO.S.E02 + + - label: "Does the device implement the HardwareFault event?" + id: SMOKECO.S.E03 + + - label: "Does the device implement the EndOfService event?" + id: SMOKECO.S.E04 + + - label: "Does the device implement the SelfTestComplete event?" + id: SMOKECO.S.E05 + + - label: "Does the device implement the AlarmMuted event?" + id: SMOKECO.S.E06 + + - label: "Does the device implement the MuteEnded event?" + id: SMOKECO.S.E07 + + - label: "Does the device implement the InterconnectSmokeAlarm event?" + id: SMOKECO.S.E08 + + - label: "Does the device implement the InterconnectCOAlarm event?" + id: SMOKECO.S.E09 + + - label: "Does the device implement the AllClear event?" + id: SMOKECO.S.E0a + + # + # server / manually + # + - label: + "Can the TestInProgress attribute be changed by physical control at + the device?" + id: SMOKECO.M.ManuallyControlledTest + + - label: + "Can the DeviceMuted attribute be changed by physical control at the + device?" + id: SMOKECO.M.ManuallyControlledMute + + # + # server / commandsReceived + # + - label: "Does the device implement receiving the SelfTestRequest command?" + id: SMOKECO.S.C00.Rsp + # Software Diagnostics Cluster Test Plan - label: "Does the device implement the Software Diagnostics cluster as a diff --git a/src/app/tests/suites/certification/Test_TC_SMCO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_SMCO_1_1.yaml new file mode 100644 index 00000000000000..07730f59f0e57d --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SMCO_1_1.yaml @@ -0,0 +1,255 @@ +# 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: 4.1.1. [TC-SMCO-1.1] Global Attributes with DUT as Server + +PICS: + - SMOKECO.S + +config: + nodeId: 0x12344321 + cluster: "Smoke CO Alarm" + endpoint: 1 + +tests: + - label: "Commission DUT to TH" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads the ClusterRevision attribute from the DUT" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + - label: "TH reads from the DUT the FeatureMap attribute" + PICS: "!SMOKECO.S.F00 && !SMOKECO.S.F01" + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "TH reads from the DUT the FeatureMap attribute(Smoke Alarm)" + PICS: SMOKECO.S.F00 && !SMOKECO.S.F01 + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 1 + constraints: + type: bitmap32 + + - label: "TH reads from the DUT the FeatureMap attribute(CO Alarm)" + PICS: SMOKECO.S.F01 && !SMOKECO.S.F00 + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 2 + constraints: + type: bitmap32 + + - label: + "TH reads from the DUT the FeatureMap attribute(Smoke Alarm & CO + Alarm)" + PICS: SMOKECO.S.F00 && SMOKECO.S.F01 + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 3 + constraints: + type: bitmap32 + + - label: "TH reads from the DUT the AttributeList attribute" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 3, 5, 6, 7] + + - label: "TH reads from the DUT the AttributeList attribute(SmokeState)" + PICS: SMOKECO.S.A0001 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [1] + + - label: "TH reads from the DUT the AttributeList attribute(COState)" + PICS: SMOKECO.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] + + - label: "TH reads from the DUT the AttributeList attribute(DeviceMuted)" + PICS: SMOKECO.S.A0004 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [4] + + - label: + "TH reads from the DUT the AttributeList + attribute(InterconnectSmokeAlarm)" + PICS: SMOKECO.S.A0008 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [8] + + - label: + "TH reads from the DUT the AttributeList + attribute(InterconnectCOAlarm)" + PICS: SMOKECO.S.A0009 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [9] + + - label: + "TH reads from the DUT the AttributeList attribute(ContaminationState)" + PICS: SMOKECO.S.A000a + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [10] + + - label: + "TH reads from the DUT the AttributeList + attribute(SmokeSensitivityLevel)" + PICS: SMOKECO.S.A000b + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [11] + + - label: "TH reads from the DUT the AttributeList attribute(ExpiryDate)" + PICS: SMOKECO.S.A000c + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [12] + + - label: "TH reads from the DUT the EventList attribute" + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + contains: [2, 3, 4, 5, 10] + + - label: "TH reads from the DUT the EventList attribute(SmokeAlarm)" + PICS: SMOKECO.S.E00 + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + contains: [0] + + - label: "TH reads from the DUT the EventList attribute(COAlarm)" + PICS: SMOKECO.S.E01 + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + contains: [1] + + - label: "TH reads from the DUT the EventList attribute(AlarmMuted)" + PICS: SMOKECO.S.E06 + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + contains: [6] + + - label: "TH reads from the DUT the EventList attribute(MuteEnded)" + PICS: SMOKECO.S.E07 + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + contains: [7] + + - label: + "TH reads from the DUT the EventList attribute(InterconnectSmokeAlarm)" + PICS: SMOKECO.S.E08 + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + contains: [8] + + - label: + "TH reads from the DUT the EventList attribute(InterconnectCOAlarm)" + PICS: SMOKECO.S.E09 + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + contains: [9] + + - label: "TH reads from the DUT the AcceptedCommandList attribute" + PICS: "!SMOKECO.S.C00.Rsp" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads from the DUT the AcceptedCommandList attribute" + PICS: SMOKECO.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + + - label: "TH reads from the DUT the GeneratedCommandList attribute" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_SMCO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_SMCO_2_1.yaml new file mode 100644 index 00000000000000..5eeb7084800ab7 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SMCO_2_1.yaml @@ -0,0 +1,156 @@ +# 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: 4.2.1. [TC-SMCO-2.1] Attributes with DUT as Server + +PICS: + - SMOKECO.S + +config: + nodeId: 0x12344321 + cluster: "Smoke CO Alarm" + endpoint: 1 + +tests: + - label: "Commission DUT to TH" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the ExpressedState attribute" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 8 + + - label: "TH reads from the DUT the SmokeState attribute" + PICS: SMOKECO.S.A0001 + command: "readAttribute" + attribute: "SmokeState" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the COState attribute" + PICS: SMOKECO.S.A0002 + command: "readAttribute" + attribute: "COState" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the BatteryAlert attribute" + PICS: SMOKECO.S.A0003 + command: "readAttribute" + attribute: "BatteryAlert" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the DeviceMuted attribute" + PICS: SMOKECO.S.A0004 + command: "readAttribute" + attribute: "DeviceMuted" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the TestInProgress attribute" + PICS: SMOKECO.S.A0005 + command: "readAttribute" + attribute: "TestInProgress" + response: + constraints: + type: boolean + + - label: "TH reads from the DUT the HardwareFaultAlert attribute" + PICS: SMOKECO.S.A0006 + command: "readAttribute" + attribute: "HardwareFaultAlert" + response: + constraints: + type: boolean + + - label: "TH reads from the DUT the EndOfServiceAlert attribute" + PICS: SMOKECO.S.A0007 + command: "readAttribute" + attribute: "EndOfServiceAlert" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the InterconnectSmokeAlarm attribute" + PICS: SMOKECO.S.A0008 + command: "readAttribute" + attribute: "InterconnectSmokeAlarm" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InterconnectCOAlarm attribute" + PICS: SMOKECO.S.A0009 + command: "readAttribute" + attribute: "InterconnectCOAlarm" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the ContaminationState attribute" + PICS: SMOKECO.S.A000a + command: "readAttribute" + attribute: "ContaminationState" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 3 + + - label: "TH reads from the DUT the SmokeSensitivityLevel attribute" + PICS: SMOKECO.S.A000b + command: "readAttribute" + attribute: "SmokeSensitivityLevel" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the ExpiryDate attribute" + PICS: SMOKECO.S.A000c + command: "readAttribute" + attribute: "ExpiryDate" + response: + constraints: + type: epoch_s diff --git a/src/app/tests/suites/certification/Test_TC_SMCO_2_2.yaml b/src/app/tests/suites/certification/Test_TC_SMCO_2_2.yaml new file mode 100644 index 00000000000000..a36cb1a46944cf --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SMCO_2_2.yaml @@ -0,0 +1,250 @@ +# 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: + 4.2.2. [TC-SMCO-2.2] Primary Functionality - Smoke Alarm with DUT as Server + +PICS: + - SMOKECO.S + +config: + nodeId: 0x12344321 + cluster: "Smoke CO Alarm" + endpoint: 1 + timeout: 990 + TEST_EVENT_TRIGGER_KEY: + type: octet_string + defaultValue: "hex:00112233445566778899aabbccddeeff" + TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM: + type: int64u + defaultValue: "0xffffffff00000090" + TEST_EVENT_TRIGGER_CRITICAL_SMOKE_ALARM: + type: int64u + defaultValue: "0xffffffff0000009c" + TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a0" + EVENT_NUMBER: + type: int64u + defaultValue: 0 + +tests: + - label: "Commission DUT to TH" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH subscribes to SmokeState attribute from DUT" + PICS: SMOKECO.S.A0001 + command: "subscribeAttribute" + attribute: "SmokeState" + minInterval: 3 + maxInterval: 30 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH reads TestEventTriggersEnabled attribute from General Diagnostics + Cluster" + PICS: DGGEN.S.A0008 + cluster: "General Diagnostics" + endpoint: 0 + command: "readAttribute" + attribute: "TestEventTriggersEnabled" + response: + value: 1 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Warning Smoke Alarm Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM + + - label: + "TH waits for a report of SmokeState attribute from DUT with a timeout + of 300 seconds" + PICS: SMOKECO.S.A0001 + command: "waitForReport" + attribute: "SmokeState" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 1 + constraints: + type: enum8 + + - label: "TH reads SmokeAlarm event from DUT" + PICS: SMOKECO.S.E00 + command: "readEvent" + event: "SmokeAlarm" + EVENT_NUMBER: EVENT_NUMBER + 1 + response: + value: { AlarmSeverityLevel: 1 } + + - label: "Start manually DUT self-test" + cluster: "LogCommands" + PICS: PICS_USER_PROMPT && SMOKECO.M.ManuallyControlledTest + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH reads TestInProgress attribute from DUT" + PICS: SMOKECO.S.A0005 + command: "readAttribute" + attribute: "TestInProgress" + response: + value: 0 + constraints: + type: boolean + + - label: "TH sends SelfTestRequest command to DUT" + PICS: SMOKECO.S.C00.Rsp + command: "SelfTestRequest" + response: + error: BUSY + + - label: "TH reads TestInProgress attribute from DUT" + PICS: SMOKECO.S.A0005 + command: "readAttribute" + attribute: "TestInProgress" + response: + value: 0 + constraints: + type: boolean + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Critical Smoke Alarm Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_CRITICAL_SMOKE_ALARM + + - label: + "TH waits for a report of SmokeState attribute from DUT with a timeout + of 300 seconds" + PICS: SMOKECO.S.A0001 + command: "waitForReport" + attribute: "SmokeState" + timeout: 300 + response: + value: 2 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 1 + constraints: + type: enum8 + + - label: "TH reads SmokeAlarm event from DUT" + PICS: SMOKECO.S.E00 + command: "readEvent" + event: "SmokeAlarm" + EVENT_NUMBER: EVENT_NUMBER + 2 + response: + value: { AlarmSeverityLevel: 2 } + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke Alarm Test Event Clear" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR + + - label: + "TH waits for a report of SmokeState attribute from DUT with a timeout + of 300 seconds" + PICS: SMOKECO.S.A0001 + command: "waitForReport" + attribute: "SmokeState" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads AllClear event from DUT" + PICS: SMOKECO.S.E0a + command: "readEvent" + event: "AllClear" + EVENT_NUMBER: EVENT_NUMBER + 3 + response: + value: {} diff --git a/src/app/tests/suites/certification/Test_TC_SMCO_2_3.yaml b/src/app/tests/suites/certification/Test_TC_SMCO_2_3.yaml new file mode 100644 index 00000000000000..96d3f41e2047d8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SMCO_2_3.yaml @@ -0,0 +1,249 @@ +# 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: 4.2.3. [TC-SMCO-2.3] Primary Functionality - CO Alarm with DUT as Server + +PICS: + - SMOKECO.S + +config: + nodeId: 0x12344321 + cluster: "Smoke CO Alarm" + endpoint: 1 + timeout: 990 + TEST_EVENT_TRIGGER_KEY: + type: octet_string + defaultValue: "hex:00112233445566778899aabbccddeeff" + TEST_EVENT_TRIGGER_WARNING_CO_ALARM: + type: int64u + defaultValue: "0xffffffff00000091" + TEST_EVENT_TRIGGER_CRITICAL_CO_ALARM: + type: int64u + defaultValue: "0xffffffff0000009d" + TEST_EVENT_TRIGGER_CO_ALARM_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a1" + EVENT_NUMBER: + type: int64u + defaultValue: 0 + +tests: + - label: "Commission DUT to TH" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH subscribes to COState attribute from DUT" + PICS: SMOKECO.S.A0002 + command: "subscribeAttribute" + attribute: "COState" + minInterval: 3 + maxInterval: 30 + response: + Value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH reads TestEventTriggersEnabled attribute from General Diagnostics + Cluster" + PICS: DGGEN.S.A0008 + cluster: "General Diagnostics" + endpoint: 0 + command: "readAttribute" + attribute: "TestEventTriggersEnabled" + response: + value: 1 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Warning CO Alarm Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_WARNING_CO_ALARM + + - label: + "TH waits for a report of COState attribute from DUT with a timeout of + 300 seconds" + PICS: SMOKECO.S.A0002 + command: "waitForReport" + attribute: "COState" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 2 + constraints: + type: enum8 + + - label: "TH reads COAlarm event from DUT" + PICS: SMOKECO.S.E01 + command: "readEvent" + event: "COAlarm" + EVENT_NUMBER: EVENT_NUMBER + 1 + response: + value: { AlarmSeverityLevel: 1 } + + - label: "Start manually DUT self-test" + cluster: "LogCommands" + PICS: PICS_USER_PROMPT && SMOKECO.M.ManuallyControlledTest + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH reads TestInProgress attribute from DUT" + PICS: SMOKECO.S.A0005 + command: "readAttribute" + attribute: "TestInProgress" + response: + value: 0 + constraints: + type: boolean + + - label: "TH sends SelfTestRequest command to DUT" + PICS: SMOKECO.S.C00.Rsp + command: "SelfTestRequest" + response: + error: BUSY + + - label: "TH reads TestInProgress attribute from DUT" + PICS: SMOKECO.S.A0005 + command: "readAttribute" + attribute: "TestInProgress" + response: + value: 0 + constraints: + type: boolean + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Critical CO Alarm Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_CRITICAL_CO_ALARM + + - label: + "TH waits for a report of COState attribute from DUT with a timeout of + 300 seconds" + PICS: SMOKECO.S.A0002 + command: "waitForReport" + attribute: "COState" + timeout: 300 + response: + value: 2 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 2 + constraints: + type: enum8 + + - label: "TH reads COAlarm event from DUT" + PICS: SMOKECO.S.E01 + command: "readEvent" + event: "COAlarm" + EVENT_NUMBER: EVENT_NUMBER + 2 + response: + value: { AlarmSeverityLevel: 2 } + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for CO Alarm Test Event Clear" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_CO_ALARM_CLEAR + + - label: + "TH waits for a report of COState attribute from DUT with a timeout of + 300 seconds" + PICS: SMOKECO.S.A0002 + command: "waitForReport" + attribute: "COState" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads AllClear event from DUT" + PICS: SMOKECO.S.E0a + command: "readEvent" + event: "AllClear" + EVENT_NUMBER: EVENT_NUMBER + 3 + response: + value: {} diff --git a/src/app/tests/suites/certification/Test_TC_SMCO_2_4.yaml b/src/app/tests/suites/certification/Test_TC_SMCO_2_4.yaml new file mode 100644 index 00000000000000..353826179b1d74 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SMCO_2_4.yaml @@ -0,0 +1,582 @@ +# 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: + 4.2.4. [TC-SMCO-2.4] Secondary Functionality - Mandatory with DUT as Server + +PICS: + - SMOKECO.S + +config: + nodeId: 0x12344321 + cluster: "Smoke CO Alarm" + endpoint: 1 + timeout: 2910 + TEST_EVENT_TRIGGER_KEY: + type: octet_string + defaultValue: "hex:00112233445566778899aabbccddeeff" + TEST_EVENT_TRIGGER_WARNING_BATTERY_ALERT: + type: int64u + defaultValue: "0xffffffff00000095" + TEST_EVENT_TRIGGER_CRITICAL_BATTERY_ALERT: + type: int64u + defaultValue: "0xffffffff0000009e" + TEST_EVENT_TRIGGER_BATTERY_ALERT_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a5" + TEST_EVENT_TRIGGER_HARDWARE_FAULT_ALERT: + type: int64u + defaultValue: "0xffffffff00000093" + TEST_EVENT_TRIGGER_HARDWARE_FAULT_ALERT_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a3" + TEST_EVENT_TRIGGER_END_OF_SERVICE_ALERT: + type: int64u + defaultValue: "0xffffffff0000009a" + TEST_EVENT_TRIGGER_END_OF_SERVICE_ALERT_CLEAR: + type: int64u + defaultValue: "0xffffffff000000aa" + EVENT_NUMBER: + type: int64u + defaultValue: 0 + +tests: + - label: "Commission DUT to TH" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH subscribes to BatteryAlert attribute from DUT" + PICS: SMOKECO.S.A0003 + command: "subscribeAttribute" + attribute: "BatteryAlert" + minInterval: 3 + maxInterval: 30 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH reads TestEventTriggersEnabled attribute from General Diagnostics + Cluster" + PICS: DGGEN.S.A0008 + cluster: "General Diagnostics" + endpoint: 0 + command: "readAttribute" + attribute: "TestEventTriggersEnabled" + response: + value: 1 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Warning Battery Alert Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_WARNING_BATTERY_ALERT + + - label: + "TH waits for a report of BatteryAlert attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A0003 + command: "waitForReport" + attribute: "BatteryAlert" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 3 + constraints: + type: enum8 + + - label: "TH reads LowBattery event from DUT" + PICS: SMOKECO.S.E02 + command: "readEvent" + event: "LowBattery" + EVENT_NUMBER: EVENT_NUMBER + 1 + response: + value: { AlarmSeverityLevel: 1 } + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Critical Battery Alert Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_CRITICAL_BATTERY_ALERT + + - label: + "TH waits for a report of BatteryAlert attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A0003 + command: "waitForReport" + attribute: "BatteryAlert" + timeout: 300 + response: + value: 2 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 3 + constraints: + type: enum8 + + - label: "TH reads LowBattery event from DUT" + PICS: SMOKECO.S.E02 + command: "readEvent" + event: "LowBattery" + EVENT_NUMBER: EVENT_NUMBER + 2 + response: + value: { AlarmSeverityLevel: 2 } + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Battery Alert Test Event Clear" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_BATTERY_ALERT_CLEAR + + - label: + "TH waits for a report of BatteryAlert attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A0003 + command: "waitForReport" + attribute: "BatteryAlert" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads AllClear event from DUT" + PICS: SMOKECO.S.E0a + command: "readEvent" + event: "AllClear" + EVENT_NUMBER: EVENT_NUMBER + 3 + response: + value: {} + + - label: "TH subscribes to HardwareFaultAlert attribute from DUT" + PICS: SMOKECO.S.A0006 + command: "subscribeAttribute" + attribute: "HardwareFaultAlert" + minInterval: 3 + maxInterval: 30 + response: + value: 0 + constraints: + type: boolean + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Hardware Fault Alert Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_HARDWARE_FAULT_ALERT + + - label: + "TH waits for a report of HardwareFaultAlert attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A0006 + command: "waitForReport" + attribute: "HardwareFaultAlert" + timeout: 300 + response: + value: 1 + constraints: + type: boolean + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 5 + constraints: + type: enum8 + + - label: "TH reads HardwareFault event from DUT" + PICS: SMOKECO.S.E03 + command: "readEvent" + event: "HardwareFault" + EVENT_NUMBER: EVENT_NUMBER + 4 + response: + value: {} + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Hardware Fault Alert Test Event + Clear" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_HARDWARE_FAULT_ALERT_CLEAR + + - label: + "TH waits for a report of HardwareFaultAlert attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A0006 + command: "waitForReport" + attribute: "HardwareFaultAlert" + timeout: 300 + response: + value: 0 + constraints: + type: boolean + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads AllClear event from DUT" + PICS: SMOKECO.S.E0a + command: "readEvent" + event: "AllClear" + EVENT_NUMBER: EVENT_NUMBER + 5 + response: + value: {} + + - label: "TH subscribes to EndOfServiceAlert attribute from DUT" + PICS: SMOKECO.S.A0007 + command: "subscribeAttribute" + attribute: "EndOfServiceAlert" + minInterval: 3 + maxInterval: 30 + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for End of Service Alert Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_END_OF_SERVICE_ALERT + + - label: + "TH waits for a report of EndOfServiceAlert attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A0007 + command: "waitForReport" + attribute: "EndOfServiceAlert" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 6 + constraints: + type: enum8 + + - label: "TH reads EndOfService event from DUT" + PICS: SMOKECO.S.E04 + command: "readEvent" + event: "EndOfService" + EVENT_NUMBER: EVENT_NUMBER + 6 + response: + value: {} + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for End of Service Alert Test Event + Clear" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_END_OF_SERVICE_ALERT_CLEAR + + - label: + "TH waits for a report of EndOfServiceAlert attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A0007 + command: "waitForReport" + attribute: "EndOfServiceAlert" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads AllClear event from DUT" + PICS: SMOKECO.S.E0a + command: "readEvent" + event: "AllClear" + EVENT_NUMBER: EVENT_NUMBER + 7 + response: + value: {} + + - label: "TH subscribes to TestInProgress attribute from DUT" + PICS: SMOKECO.S.A0005 + command: "subscribeAttribute" + attribute: "TestInProgress" + minInterval: 3 + maxInterval: 30 + response: + value: 0 + constraints: + type: boolean + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: "Start manually DUT self-test" + cluster: "LogCommands" + PICS: PICS_USER_PROMPT && SMOKECO.M.ManuallyControlledTest + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: + "TH waits for a report of TestInProgress attribute from DUT with a + timeout of 180 seconds" + PICS: SMOKECO.S.A0005 + command: "waitForReport" + attribute: "TestInProgress" + timeout: 180 + response: + value: 1 + constraints: + type: boolean + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 4 + constraints: + type: enum8 + + - label: + "TH waits for a report of TestInProgress attribute from DUT with a + timeout of 180 seconds" + PICS: SMOKECO.S.A0005 + command: "waitForReport" + attribute: "TestInProgress" + timeout: 180 + response: + value: 0 + constraints: + type: boolean + + - label: "TH reads SelfTestComplete event from DUT" + PICS: SMOKECO.S.E05 + command: "readEvent" + event: "SelfTestComplete" + EVENT_NUMBER: EVENT_NUMBER + 8 + response: + value: {} + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads AllClear event from DUT" + PICS: SMOKECO.S.E0a + command: "readEvent" + event: "AllClear" + EVENT_NUMBER: EVENT_NUMBER + 9 + response: + value: {} + + - label: "TH sends SelfTestRequest command to DUT" + PICS: SMOKECO.S.C00.Rsp + command: "SelfTestRequest" + + - label: + "TH waits for a report of TestInProgress attribute from DUT with a + timeout of 180 seconds" + PICS: SMOKECO.S.A0005 + command: "waitForReport" + attribute: "TestInProgress" + timeout: 180 + response: + value: 1 + constraints: + type: boolean + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 4 + constraints: + type: enum8 + + - label: + "TH waits for a report of TestInProgress attribute from DUT with a + timeout of 180 seconds" + PICS: SMOKECO.S.A0005 + command: "waitForReport" + attribute: "TestInProgress" + timeout: 180 + response: + value: 0 + constraints: + type: boolean + + - label: "TH reads SelfTestComplete event from DUT" + PICS: SMOKECO.S.E05 + command: "readEvent" + event: "SelfTestComplete" + EVENT_NUMBER: EVENT_NUMBER + 10 + response: + value: {} + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads AllClear event from DUT" + PICS: SMOKECO.S.E0a + command: "readEvent" + event: "AllClear" + EVENT_NUMBER: EVENT_NUMBER + 11 + response: + value: {} diff --git a/src/app/tests/suites/certification/Test_TC_SMCO_2_5.yaml b/src/app/tests/suites/certification/Test_TC_SMCO_2_5.yaml new file mode 100644 index 00000000000000..edb7e6d8cf3021 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SMCO_2_5.yaml @@ -0,0 +1,1021 @@ +# 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: 4.2.5. [TC-SMCO-2.5] Secondary Functionality - Optional with DUT as Server + +PICS: + - SMOKECO.S + +config: + nodeId: 0x12344321 + cluster: "Smoke CO Alarm" + endpoint: 1 + timeout: 6090 + TEST_EVENT_TRIGGER_KEY: + type: octet_string + defaultValue: "hex:00112233445566778899aabbccddeeff" + TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM: + type: int64u + defaultValue: "0xffffffff00000090" + TEST_EVENT_TRIGGER_CRITICAL_SMOKE_ALARM: + type: int64u + defaultValue: "0xffffffff0000009c" + TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a0" + TEST_EVENT_TRIGGER_WARNING_CO_ALARM: + type: int64u + defaultValue: "0xffffffff00000091" + TEST_EVENT_TRIGGER_CRITICAL_CO_ALARM: + type: int64u + defaultValue: "0xffffffff0000009d" + TEST_EVENT_TRIGGER_CO_ALARM_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a1" + TEST_EVENT_TRIGGER_DEVICE_MUTED: + type: int64u + defaultValue: "0xffffffff0000009b" + TEST_EVENT_TRIGGER_DEVICE_MUTED_CLEAR: + type: int64u + defaultValue: "0xffffffff000000ab" + TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM: + type: int64u + defaultValue: "0xffffffff00000092" + TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a2" + TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM: + type: int64u + defaultValue: "0xffffffff00000094" + TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a4" + TEST_EVENT_TRIGGER_CONTAMINATION_STATE_HIGH: + type: int64u + defaultValue: "0xffffffff00000096" + TEST_EVENT_TRIGGER_CONTAMINATION_STATE_LOW: + type: int64u + defaultValue: "0xffffffff00000097" + TTEST_EVENT_TRIGGER_CONTAMINATION_STATE_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a6" + TEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_HIGH: + type: int64u + defaultValue: "0xffffffff00000098" + TEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_LOW: + type: int64u + defaultValue: "0xffffffff00000099" + TTEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a8" + EVENT_NUMBER: + type: int64u + defaultValue: 0 + +tests: + - label: "Commission DUT to TH" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH subscribes to InterconnectSmokeAlarm attribute from DUT" + PICS: SMOKECO.S.A0008 + command: "subscribeAttribute" + attribute: "InterconnectSmokeAlarm" + minInterval: 3 + maxInterval: 30 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0008 && SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH reads TestEventTriggersEnabled attribute from General Diagnostics + Cluster" + PICS: SMOKECO.S.A0008 && DGGEN.S.A0008 + cluster: "General Diagnostics" + endpoint: 0 + command: "readAttribute" + attribute: "TestEventTriggersEnabled" + response: + value: 1 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Interconnect Smoke Alarm Test + Event" + PICS: SMOKECO.S.A0008 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM + + - label: + "TH waits for a report of InterconnectSmokeAlarm attribute from DUT + with a timeout of 300 seconds" + PICS: SMOKECO.S.A0008 + command: "waitForReport" + attribute: "InterconnectSmokeAlarm" + timeout: 300 + response: + saveAs: interconnectSmokeAlarmSeverityLevel + constraints: + type: enum8 + minValue: 1 + maxValue: 2 + + - label: "TH reads InterconnectSmokeAlarm event from DUT" + PICS: SMOKECO.S.A0008 && SMOKECO.S.E08 + command: "readEvent" + event: "InterconnectSmokeAlarm" + EVENT_NUMBER: EVENT_NUMBER + 1 + response: + value: { AlarmSeverityLevel: interconnectSmokeAlarmSeverityLevel } + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0008 && SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 7 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Interconnect Smoke Alarm Test + Event Clear" + PICS: SMOKECO.S.A0008 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM_CLEAR + + - label: + "TH waits for a report of InterconnectSmokeAlarm attribute from DUT + with a timeout of 300 seconds" + PICS: SMOKECO.S.A0008 + command: "waitForReport" + attribute: "InterconnectSmokeAlarm" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0008 && SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads AllClear event from DUT" + PICS: SMOKECO.S.A0008 && SMOKECO.S.E0a + command: "readEvent" + event: "AllClear" + EVENT_NUMBER: EVENT_NUMBER + 2 + response: + value: {} + + - label: "TH subscribes to InterconnectCOAlarm attribute from DUT" + PICS: SMOKECO.S.A0009 + command: "subscribeAttribute" + attribute: "InterconnectCOAlarm" + minInterval: 3 + maxInterval: 30 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0009 && SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Interconnect CO Alarm Test Event" + PICS: SMOKECO.S.A0009 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM + + - label: + "TH waits for a report of InterconnectCOAlarm attribute from DUT with + a timeout of 300 seconds" + PICS: SMOKECO.S.A0009 + command: "waitForReport" + attribute: "InterconnectCOAlarm" + timeout: 300 + response: + saveAs: interconnectCOAlarmSeverityLevel + constraints: + type: enum8 + minValue: 1 + maxValue: 2 + + - label: "TH reads InterconnectCOAlarm event from DUT" + PICS: SMOKECO.S.A0009 && SMOKECO.S.E09 + command: "readEvent" + event: "InterconnectCOAlarm" + EVENT_NUMBER: EVENT_NUMBER + 3 + response: + value: { AlarmSeverityLevel: interconnectCOAlarmSeverityLevel } + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0009 && SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 8 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Interconnect CO Alarm Test Event + Clear" + PICS: SMOKECO.S.A0009 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM_CLEAR + + - label: + "TH waits for a report of InterconnectCOAlarm attribute from DUT with + a timeout of 300 seconds" + PICS: SMOKECO.S.A0009 + command: "waitForReport" + attribute: "InterconnectCOAlarm" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0009 && SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads AllClear event from DUT" + PICS: SMOKECO.S.E0a + command: "readEvent" + event: "AllClear" + EVENT_NUMBER: EVENT_NUMBER + 4 + response: + value: {} + + - label: "TH subscribes to ContaminationState attribute from DUT" + PICS: SMOKECO.S.A000a + command: "subscribeAttribute" + attribute: "ContaminationState" + minInterval: 3 + maxInterval: 30 + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Contamination State (High) Test + Event" + PICS: SMOKECO.S.A000a && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_CONTAMINATION_STATE_HIGH + + - label: + "TH waits for a report of ContaminationState attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A000a + command: "waitForReport" + attribute: "ContaminationState" + timeout: 300 + response: + constraints: + type: enum8 + minValue: 2 + maxValue: 3 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Contamination State Test Event + Clear" + PICS: SMOKECO.S.A000a && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TTEST_EVENT_TRIGGER_CONTAMINATION_STATE_CLEAR + + - label: + "TH waits for a report of ContaminationState attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A000a + command: "waitForReport" + attribute: "ContaminationState" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Contamination State (Low) Test + Event" + PICS: SMOKECO.S.A000a && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_CONTAMINATION_STATE_LOW + + - label: + "TH waits for a report of ContaminationState attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A000a + command: "waitForReport" + attribute: "ContaminationState" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Contamination State Test Event + Clear" + PICS: SMOKECO.S.A000a && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TTEST_EVENT_TRIGGER_CONTAMINATION_STATE_CLEAR + + - label: + "TH waits for a report of ContaminationState attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A000a + command: "waitForReport" + attribute: "ContaminationState" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH subscribes to SmokeSensitivityLevel attribute from DUT" + PICS: SMOKECO.S.A000b + command: "subscribeAttribute" + attribute: "SmokeSensitivityLevel" + minInterval: 3 + maxInterval: 30 + response: + value: 1 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke Sensitivity Level (High) + Test Event" + PICS: SMOKECO.S.A000b && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_HIGH + + - label: + "TH waits for a report of SmokeSensitivityLevel attribute from DUT + with a timeout of 300 seconds" + PICS: SMOKECO.S.A000b + command: "waitForReport" + attribute: "SmokeSensitivityLevel" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke Sensitivity Level Test + Event Clear" + PICS: SMOKECO.S.A000b && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TTEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_CLEAR + + - label: + "TH waits for a report of SmokeSensitivityLevel attribute from DUT + with a timeout of 300 seconds" + PICS: SMOKECO.S.A000b + command: "waitForReport" + attribute: "SmokeSensitivityLevel" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke Sensitivity Level (Low) + Test Event" + PICS: SMOKECO.S.A000b && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_LOW + + - label: + "TH waits for a report of SmokeSensitivityLevel attribute from DUT + with a timeout of 300 seconds" + PICS: SMOKECO.S.A000b + command: "waitForReport" + attribute: "SmokeSensitivityLevel" + timeout: 300 + response: + value: 2 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke Sensitivity Level Test + Event Clear" + PICS: SMOKECO.S.A000b && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TTEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_CLEAR + + - label: + "TH waits for a report of SmokeSensitivityLevel attribute from DUT + with a timeout of 300 seconds" + PICS: SMOKECO.S.A000b + command: "waitForReport" + attribute: "SmokeSensitivityLevel" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: "TH subscribes to DeviceMuted attribute from DUT" + PICS: SMOKECO.S.A0004 + command: "subscribeAttribute" + attribute: "DeviceMuted" + minInterval: 3 + maxInterval: 30 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads FeatureMap attribute(Smoke Alarm) from DUT" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "TH subscribes to SmokeState attribute from DUT" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001 + command: "subscribeAttribute" + attribute: "SmokeState" + minInterval: 3 + maxInterval: 30 + keepSubscriptions: true + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Warning Smoke Alarm Test Event" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM + + - label: + "TH waits for a report of SmokeState attribute from DUT with a timeout + of 300 seconds" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001 + command: "waitForReport" + attribute: "SmokeState" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Manual Device Mute Test Event" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_DEVICE_MUTED + + - label: + "TH waits for a report of DeviceMuted attribute from DUT with a + timeout of 120 seconds" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 + command: "waitForReport" + attribute: "DeviceMuted" + timeout: 120 + response: + value: 1 + constraints: + type: enum8 + + - label: "TH reads AlarmMuted event from DUT" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.E06 + command: "readEvent" + event: "AlarmMuted" + EVENT_NUMBER: EVENT_NUMBER + 5 + response: + value: {} + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Manual Device Mute Test Event + Clear" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_DEVICE_MUTED_CLEAR + + - label: + "TH waits for a report of DeviceMuted attribute from DUT with a + timeout of 120 seconds" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 + command: "waitForReport" + attribute: "DeviceMuted" + timeout: 120 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads MuteEnded event from DUT" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.E07 + command: "readEvent" + event: "MuteEnded" + EVENT_NUMBER: EVENT_NUMBER + 6 + response: + value: {} + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Critical Smoke Alarm Test Event" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_CRITICAL_SMOKE_ALARM + + - label: + "TH waits for a report of SmokeState attribute from DUT with a timeout + of 300 seconds" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001 + command: "waitForReport" + attribute: "SmokeState" + timeout: 300 + response: + value: 2 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Manual Device Mute Test Event" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_DEVICE_MUTED + + - label: "TH waits 60 Seconds" + PICS: "!PICS_SDK_CI_ONLY" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 60000 + + - label: "TH reads DeviceMuted attribute from DUT" + PICS: SMOKECO.S.A0004 + command: "readAttribute" + attribute: "DeviceMuted" + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke Alarm Test Event Clear" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR + + - label: + "TH waits for a report of SmokeState attribute from DUT with a timeout + of 300 seconds" + PICS: SMOKECO.S.A0004 && SMOKECO.S.A0001 && SMOKECO.S.F00 + command: "waitForReport" + attribute: "SmokeState" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads FeatureMap attribute(CO Alarm) from DUT" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "TH subscribes to COState attribute from DUT" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002 + command: "subscribeAttribute" + attribute: "COState" + minInterval: 3 + maxInterval: 30 + keepSubscriptions: true + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Warning CO Alarm Test Event" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_WARNING_CO_ALARM + + - label: + "TH waits for a report of COState attribute from DUT with a timeout of + 300 seconds" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002 + command: "waitForReport" + attribute: "COState" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Manual Device Mute Test Event" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_DEVICE_MUTED + + - label: + "TH waits for a report of DeviceMuted attribute from DUT with a + timeout of 120 seconds" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 + command: "waitForReport" + attribute: "DeviceMuted" + timeout: 120 + response: + value: 1 + constraints: + type: enum8 + + - label: "TH reads AlarmMuted event from DUT" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.E06 + command: "readEvent" + event: "AlarmMuted" + EVENT_NUMBER: EVENT_NUMBER + 7 + response: + value: {} + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Manual Device Mute Test Event + Clear" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_DEVICE_MUTED_CLEAR + + - label: + "TH waits for a report of DeviceMuted attribute from DUT with a + timeout of 120 seconds" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 + command: "waitForReport" + attribute: "DeviceMuted" + timeout: 120 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads MuteEnded event from DUT" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.E07 + command: "readEvent" + event: "MuteEnded" + EVENT_NUMBER: EVENT_NUMBER + 8 + response: + value: {} + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Critical CO Alarm Test Event" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_CRITICAL_CO_ALARM + + - label: + "TH waits for a report of COState attribute from DUT with a timeout of + 300 seconds" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002 + command: "waitForReport" + attribute: "COState" + timeout: 300 + response: + value: 2 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Manual Device Mute Test Event" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_DEVICE_MUTED + + - label: "TH waits 60 Seconds" + PICS: "!PICS_SDK_CI_ONLY" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 60000 + + - label: "TH reads DeviceMuted attribute from DUT" + PICS: SMOKECO.S.A0004 + command: "readAttribute" + attribute: "DeviceMuted" + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for CO Alarm Test Event Clear" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_CO_ALARM_CLEAR + + - label: + "TH waits for a report of COState attribute from DUT with a timeout of + 300 seconds" + PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002 + command: "waitForReport" + attribute: "COState" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 diff --git a/src/app/tests/suites/certification/Test_TC_SMCO_2_6.yaml b/src/app/tests/suites/certification/Test_TC_SMCO_2_6.yaml new file mode 100644 index 00000000000000..5d68637c3b5a46 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SMCO_2_6.yaml @@ -0,0 +1,489 @@ +# 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: + 4.2.6. [TC-SMCO-2.6] ExpressedState Attribute - Multiple Alarms with DUT as + Server + +PICS: + - SMOKECO.S + +config: + nodeId: 0x12344321 + cluster: "Smoke CO Alarm" + endpoint: 1 + timeout: 3090 + TEST_EVENT_TRIGGER_KEY: + type: octet_string + defaultValue: "hex:00112233445566778899aabbccddeeff" + TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM: + type: int64u + defaultValue: "0xffffffff00000090" + TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a0" + TEST_EVENT_TRIGGER_WARNING_CO_ALARM: + type: int64u + defaultValue: "0xffffffff00000091" + TEST_EVENT_TRIGGER_CO_ALARM_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a1" + TEST_EVENT_TRIGGER_WARNING_BATTERY_ALERT: + type: int64u + defaultValue: "0xffffffff00000095" + TEST_EVENT_TRIGGER_BATTERY_ALERT_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a5" + TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM: + type: int64u + defaultValue: "0xffffffff00000092" + TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a2" + TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM: + type: int64u + defaultValue: "0xffffffff00000094" + TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM_CLEAR: + type: int64u + defaultValue: "0xffffffff000000a4" + HIEST_PRI_ALARM: + type: int8u + defaultValue: 1 + +tests: + - label: "Commission DUT to TH" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 + + - label: "TH subscribes to BatteryAlert attribute from DUT" + PICS: SMOKECO.S.A0003 + command: "subscribeAttribute" + attribute: "BatteryAlert" + minInterval: 3 + maxInterval: 30 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH subscribes to InterconnectSmokeAlarm attribute from DUT" + PICS: SMOKECO.S.A0008 + command: "subscribeAttribute" + attribute: "InterconnectSmokeAlarm" + minInterval: 3 + maxInterval: 30 + keepSubscriptions: true + response: + value: 0 + constraints: + type: enum8 + + - label: "TH subscribes to InterconnectCOAlarm attribute from DUT" + PICS: SMOKECO.S.A0009 + command: "subscribeAttribute" + attribute: "InterconnectCOAlarm" + minInterval: 3 + maxInterval: 30 + keepSubscriptions: true + response: + value: 0 + constraints: + type: enum8 + + - label: "TH subscribes to COState attribute from DUT" + PICS: SMOKECO.S.A0002 + command: "subscribeAttribute" + attribute: "COState" + minInterval: 3 + maxInterval: 30 + keepSubscriptions: true + response: + value: 0 + constraints: + type: enum8 + + - label: "TH subscribes to SmokeState attribute from DUT" + PICS: SMOKECO.S.A0001 + command: "subscribeAttribute" + attribute: "SmokeState" + minInterval: 3 + maxInterval: 30 + keepSubscriptions: true + response: + value: 0 + constraints: + type: enum8 + + - label: + "TH reads TestEventTriggersEnabled attribute from General Diagnostics + Cluster" + PICS: DGGEN.S.A0008 + cluster: "General Diagnostics" + endpoint: 0 + command: "readAttribute" + attribute: "TestEventTriggersEnabled" + response: + value: 1 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Warning Battery Alert Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_WARNING_BATTERY_ALERT + + - label: + "TH waits for a report of BatteryAlert attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A0003 + command: "waitForReport" + attribute: "BatteryAlert" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Interconnect Smoke Alarm Test + Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM + + - label: + "TH waits for a report of InterconnectSmokeAlarm attribute from DUT + with a timeout of 300 seconds" + PICS: SMOKECO.S.A0008 + command: "waitForReport" + attribute: "InterconnectSmokeAlarm" + timeout: 300 + response: + constraints: + type: enum8 + minValue: 1 + maxValue: 2 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Interconnect CO Alarm Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM + + - label: + "TH waits for a report of InterconnectCOAlarm attribute from DUT with + a timeout of 300 seconds" + PICS: SMOKECO.S.A0009 + command: "waitForReport" + attribute: "InterconnectCOAlarm" + timeout: 300 + response: + constraints: + type: enum8 + minValue: 1 + maxValue: 2 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Warning CO Alarm Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_WARNING_CO_ALARM + + - label: + "TH waits for a report of COState attribute from DUT with a timeout of + 300 seconds" + PICS: SMOKECO.S.A0002 + command: "waitForReport" + attribute: "COState" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Warning Smoke Alarm Test Event" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM + + - label: + "TH waits for a report of SmokeState attribute from DUT with a timeout + of 300 seconds" + PICS: SMOKECO.S.A0001 + command: "waitForReport" + attribute: "SmokeState" + timeout: 300 + response: + value: 1 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: HIEST_PRI_ALARM + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke Alarm Test Event Clear" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR + + - label: + "TH waits for a report of SmokeState attribute from DUT with a timeout + of 300 seconds" + PICS: SMOKECO.S.A0001 + command: "waitForReport" + attribute: "SmokeState" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: HIEST_PRI_ALARM + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for CO Alarm Test Event clear" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_CO_ALARM_CLEAR + + - label: + "TH waits for a report of COState attribute from DUT with a timeout of + 300 seconds" + PICS: SMOKECO.S.A0002 + command: "waitForReport" + attribute: "COState" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: HIEST_PRI_ALARM + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Interconnect CO Alarm Test Event + Clear" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM_CLEAR + + - label: + "TH waits for a report of InterconnectCOAlarm attribute from DUT with + a timeout of 300 seconds" + PICS: SMOKECO.S.A0009 + command: "waitForReport" + attribute: "InterconnectCOAlarm" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: HIEST_PRI_ALARM + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Interconnect Smoke Alarm Test + Event Clear" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM_CLEAR + + - label: + "TH waits for a report of InterconnectSmokeAlarm attribute from DUT + with a timeout of 300 seconds" + PICS: SMOKECO.S.A0008 + command: "waitForReport" + attribute: "InterconnectSmokeAlarm" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: HIEST_PRI_ALARM + constraints: + type: enum8 + + - label: + "TH sends TestEventTrigger command to General Diagnostics Cluster on + Endpoint 0 with EnableKey field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to + PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Battery Alert Test Event Clear" + PICS: DGGEN.S.C00.Rsp + cluster: "General Diagnostics" + endpoint: 0 + command: "TestEventTrigger" + arguments: + values: + - name: "EnableKey" + value: TEST_EVENT_TRIGGER_KEY + - name: "EventTrigger" + value: TEST_EVENT_TRIGGER_BATTERY_ALERT_CLEAR + + - label: + "TH waits for a report of BatteryAlert attribute from DUT with a + timeout of 300 seconds" + PICS: SMOKECO.S.A0003 + command: "waitForReport" + attribute: "BatteryAlert" + timeout: 300 + response: + value: 0 + constraints: + type: enum8 + + - label: "TH reads ExpressedState attribute from DUT" + PICS: SMOKECO.S.A0000 + command: "readAttribute" + attribute: "ExpressedState" + response: + value: 0 + constraints: + type: enum8 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index b52820046477a7..32aa633543408f 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -654,6 +654,40 @@ S.C.AM-WRITE=0 S.C.AO-READ=0 S.C.AO-WRITE=0 +# Smoke CO Alarm Cluster +SMOKECO.S=1 +SMOKECO.S.F00=1 +SMOKECO.S.F01=1 +SMOKECO.S.A0000=1 +SMOKECO.S.A0001=1 +SMOKECO.S.A0002=1 +SMOKECO.S.A0003=1 +SMOKECO.S.A0004=1 +SMOKECO.S.A0005=1 +SMOKECO.S.A0006=1 +SMOKECO.S.A0007=1 +SMOKECO.S.A0008=1 +SMOKECO.S.A0009=1 +SMOKECO.S.A000a=1 +SMOKECO.S.A000b=1 +SMOKECO.S.A000c=1 +SMOKECO.S.E00=1 +SMOKECO.S.E01=1 +SMOKECO.S.E02=1 +SMOKECO.S.E03=1 +SMOKECO.S.E04=1 +SMOKECO.S.E05=1 +SMOKECO.S.E06=1 +SMOKECO.S.E07=1 +SMOKECO.S.E08=1 +SMOKECO.S.E09=1 +SMOKECO.S.E0a=1 +SMOKECO.M.ManuallyControlledTest=1 +SMOKECO.M.ManuallyControlledMute=1 +SMOKECO.S.C00.Rsp=1 + +SMOKECO.C=1 + # Switch Cluster SWTCH.S=1 SWTCH.S.F00=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 8c7b97bb7463a1..40f9c8978790c1 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -176,6 +176,15 @@ "PowerSourceConfiguration": ["Test_TC_PSCFG_1_1", "Test_TC_PSCFG_2_1"], "RelativeHumidityMeasurement": ["Test_TC_RH_1_1", "Test_TC_RH_2_1"], "SecureChannel": [], + "SmokeCOAlarm": [ + "Test_TC_SMCO_1_1", + "Test_TC_SMCO_2_1", + "Test_TC_SMCO_2_2", + "Test_TC_SMCO_2_3", + "Test_TC_SMCO_2_4", + "Test_TC_SMCO_2_5", + "Test_TC_SMCO_2_6" + ], "Switch": ["Test_TC_SWTCH_1_1", "Test_TC_SWTCH_2_1"], "TemperatureMeasurement": ["Test_TC_TMP_1_1", "Test_TC_TMP_2_1"], "Thermostat": ["Test_TC_TSTAT_1_1", "Test_TC_TSTAT_2_1"], @@ -359,6 +368,7 @@ "PowerSourceConfiguration", "RelativeHumidityMeasurement", "SecureChannel", + "SmokeCOAlarm", "Switch", "TemperatureMeasurement", "Thermostat", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index bd53c9a03962e3..4ab6e63c4845c0 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -250,6 +250,7 @@ "LevelControl": ["Test_TC_LVL_8_1"], "OnOff": ["Test_TC_OO_2_3"], "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], + "SmokeCOAlarm": [], "Switch": ["Test_TC_SWTCH_2_2", "Test_TC_SWTCH_3_2"], "TemperatureMeasurement": ["Test_TC_TMP_2_2"], "Thermostat": ["Test_TC_TSTAT_3_1", "Test_TC_TSTAT_3_2"], @@ -310,6 +311,7 @@ "LevelControl", "OnOff", "RelativeHumidityMeasurement", + "SmokeCOAlarm", "Switch", "TemperatureMeasurement", "Thermostat", diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 2f4f24d5404310..ba960be297db89 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -208,6 +208,13 @@ class TestList : public Command printf("Test_TC_PSCFG_2_1\n"); printf("Test_TC_RH_1_1\n"); printf("Test_TC_RH_2_1\n"); + printf("Test_TC_SMCO_1_1\n"); + printf("Test_TC_SMCO_2_1\n"); + printf("Test_TC_SMCO_2_2\n"); + printf("Test_TC_SMCO_2_3\n"); + printf("Test_TC_SMCO_2_4\n"); + printf("Test_TC_SMCO_2_5\n"); + printf("Test_TC_SMCO_2_6\n"); printf("Test_TC_SWTCH_1_1\n"); printf("Test_TC_SWTCH_2_1\n"); printf("Test_TC_TMP_1_1\n"); @@ -58889,6 +58896,4630 @@ class Test_TC_RH_2_1Suite : public TestCommand } }; +class Test_TC_SMCO_1_1Suite : public TestCommand +{ +public: + Test_TC_SMCO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SMCO_1_1", 25, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SMCO_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 2UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 3UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + 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, 12UL)); + } + 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, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + 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, 1UL)); + } + 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(CheckConstraintContains("value", value, 6UL)); + } + 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, 7UL)); + } + 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(CheckConstraintContains("value", value, 8UL)); + } + 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, 9UL)); + } + 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))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + 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, 0UL)); + } + 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))); + { + 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, "Commission DUT to TH"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the FeatureMap attribute"); + VerifyOrDo(!ShouldSkip("!SMOKECO.S.F00 && !SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the FeatureMap attribute(Smoke Alarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.F00 && !SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the FeatureMap attribute(CO Alarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.F01 && !SMOKECO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the FeatureMap attribute(Smoke Alarm & CO Alarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.F00 && SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AttributeList attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AttributeList attribute(SmokeState)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the AttributeList attribute(COState)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the AttributeList attribute(DeviceMuted)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the AttributeList attribute(InterconnectSmokeAlarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads from the DUT the AttributeList attribute(InterconnectCOAlarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "TH reads from the DUT the AttributeList attribute(ContaminationState)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 13: { + LogStep(13, "TH reads from the DUT the AttributeList attribute(SmokeSensitivityLevel)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, "TH reads from the DUT the AttributeList attribute(ExpiryDate)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH reads from the DUT the EventList attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "TH reads from the DUT the EventList attribute(SmokeAlarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "TH reads from the DUT the EventList attribute(COAlarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "TH reads from the DUT the EventList attribute(AlarmMuted)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E06"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "TH reads from the DUT the EventList attribute(MuteEnded)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E07"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "TH reads from the DUT the EventList attribute(InterconnectSmokeAlarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "TH reads from the DUT the EventList attribute(InterconnectCOAlarm)"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E09"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "TH reads from the DUT the AcceptedCommandList attribute"); + VerifyOrDo(!ShouldSkip("!SMOKECO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "TH reads from the DUT the AcceptedCommandList attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "TH reads from the DUT the GeneratedCommandList attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMCO_2_1Suite : public TestCommand +{ +public: + Test_TC_SMCO_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SMCO_2_1", 14, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SMCO_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 8U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum 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 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum 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 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum 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 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum 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::SmokeCoAlarm::AlarmStateEnum 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 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum 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 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "epoch_s", "epoch_s")); + } + 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, "Commission DUT to TH"); + 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 ExpressedState attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the SmokeState attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::SmokeState::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the COState attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::COState::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the BatteryAlert attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::BatteryAlert::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the DeviceMuted attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::DeviceMuted::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the TestInProgress attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::TestInProgress::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the HardwareFaultAlert attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::HardwareFaultAlert::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the EndOfServiceAlert attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::EndOfServiceAlert::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the InterconnectSmokeAlarm attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the InterconnectCOAlarm attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectCOAlarm::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads from the DUT the ContaminationState attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ContaminationState::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "TH reads from the DUT the SmokeSensitivityLevel attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::SmokeSensitivityLevel::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "TH reads from the DUT the ExpiryDate attribute"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpiryDate::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMCO_2_2Suite : public TestCommand +{ +public: + Test_TC_SMCO_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SMCO_2_2", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("TEST_EVENT_TRIGGER_KEY", &mTestEventTriggerKey); + AddArgument("TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_CRITICAL_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerCriticalSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerSmokeAlarmClear); + AddArgument("EVENT_NUMBER", 0, UINT64_MAX, &mEventNumber); + } + + ~Test_TC_SMCO_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(990)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + chip::Optional mTestEventTriggerKey; + chip::Optional mTestEventTriggerWarningSmokeAlarm; + chip::Optional mTestEventTriggerCriticalSmokeAlarm; + chip::Optional mTestEventTriggerSmokeAlarmClear; + chip::Optional mEventNumber; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEventTriggersEnabled", value, 1)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 7: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::SmokeAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeAlarm.alarmSeverityLevel", value.alarmSeverityLevel, 1U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_BUSY)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 15: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::SmokeAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeAlarm.alarmSeverityLevel", value.alarmSeverityLevel, 2U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 19: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + 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, "Commission DUT to TH"); + 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 subscribes to SmokeState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::SmokeState::Id, 3, + 30, true, chip::NullOptional, chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningSmokeAlarm.HasValue() ? mTestEventTriggerWarningSmokeAlarm.Value() : 0xffffffff00000090ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 6: { + LogStep(6, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads SmokeAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::SmokeAlarm::Id, false, + chip::NullOptional); + } + case 8: { + LogStep(8, "Start manually DUT self-test"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && SMOKECO.M.ManuallyControlledTest"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "TH reads TestInProgress attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::TestInProgress::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH sends SelfTestRequest command to DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Commands::SelfTestRequest::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "TH reads TestInProgress attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::TestInProgress::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Critical Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerCriticalSmokeAlarm.HasValue() ? mTestEventTriggerCriticalSmokeAlarm.Value() + : 0xffffffff0000009cULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 14: { + LogStep(14, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH reads SmokeAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::SmokeAlarm::Id, false, + chip::NullOptional); + } + case 16: { + LogStep(16, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerSmokeAlarmClear.HasValue() ? mTestEventTriggerSmokeAlarmClear.Value() : 0xffffffff000000a0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 18: { + LogStep(18, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMCO_2_3Suite : public TestCommand +{ +public: + Test_TC_SMCO_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SMCO_2_3", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("TEST_EVENT_TRIGGER_KEY", &mTestEventTriggerKey); + AddArgument("TEST_EVENT_TRIGGER_WARNING_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_CRITICAL_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerCriticalCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_CO_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerCoAlarmClear); + AddArgument("EVENT_NUMBER", 0, UINT64_MAX, &mEventNumber); + } + + ~Test_TC_SMCO_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(990)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + chip::Optional mTestEventTriggerKey; + chip::Optional mTestEventTriggerWarningCoAlarm; + chip::Optional mTestEventTriggerCriticalCoAlarm; + chip::Optional mTestEventTriggerCoAlarmClear; + chip::Optional mEventNumber; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEventTriggersEnabled", value, 1)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 7: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::COAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COAlarm.alarmSeverityLevel", value.alarmSeverityLevel, 1U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_BUSY)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 15: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::COAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COAlarm.alarmSeverityLevel", value.alarmSeverityLevel, 2U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 19: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + 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, "Commission DUT to TH"); + 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 subscribes to COState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::COState::Id, 3, + 30, true, chip::NullOptional, chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningCoAlarm.HasValue() ? mTestEventTriggerWarningCoAlarm.Value() : 0xffffffff00000091ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 6: { + LogStep(6, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads COAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::COAlarm::Id, false, + chip::NullOptional); + } + case 8: { + LogStep(8, "Start manually DUT self-test"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && SMOKECO.M.ManuallyControlledTest"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "TH reads TestInProgress attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::TestInProgress::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH sends SelfTestRequest command to DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Commands::SelfTestRequest::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "TH reads TestInProgress attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::TestInProgress::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Critical CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerCriticalCoAlarm.HasValue() ? mTestEventTriggerCriticalCoAlarm.Value() : 0xffffffff0000009dULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 14: { + LogStep(14, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH reads COAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::COAlarm::Id, false, + chip::NullOptional); + } + case 16: { + LogStep(16, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for CO " + "Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerCoAlarmClear.HasValue() ? mTestEventTriggerCoAlarmClear.Value() : 0xffffffff000000a1ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 18: { + LogStep(18, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMCO_2_4Suite : public TestCommand +{ +public: + Test_TC_SMCO_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SMCO_2_4", 50, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("TEST_EVENT_TRIGGER_KEY", &mTestEventTriggerKey); + AddArgument("TEST_EVENT_TRIGGER_WARNING_BATTERY_ALERT", 0, UINT64_MAX, &mTestEventTriggerWarningBatteryAlert); + AddArgument("TEST_EVENT_TRIGGER_CRITICAL_BATTERY_ALERT", 0, UINT64_MAX, &mTestEventTriggerCriticalBatteryAlert); + AddArgument("TEST_EVENT_TRIGGER_BATTERY_ALERT_CLEAR", 0, UINT64_MAX, &mTestEventTriggerBatteryAlertClear); + AddArgument("TEST_EVENT_TRIGGER_HARDWARE_FAULT_ALERT", 0, UINT64_MAX, &mTestEventTriggerHardwareFaultAlert); + AddArgument("TEST_EVENT_TRIGGER_HARDWARE_FAULT_ALERT_CLEAR", 0, UINT64_MAX, &mTestEventTriggerHardwareFaultAlertClear); + AddArgument("TEST_EVENT_TRIGGER_END_OF_SERVICE_ALERT", 0, UINT64_MAX, &mTestEventTriggerEndOfServiceAlert); + AddArgument("TEST_EVENT_TRIGGER_END_OF_SERVICE_ALERT_CLEAR", 0, UINT64_MAX, &mTestEventTriggerEndOfServiceAlertClear); + AddArgument("EVENT_NUMBER", 0, UINT64_MAX, &mEventNumber); + } + + ~Test_TC_SMCO_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(2910)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + chip::Optional mTestEventTriggerKey; + chip::Optional mTestEventTriggerWarningBatteryAlert; + chip::Optional mTestEventTriggerCriticalBatteryAlert; + chip::Optional mTestEventTriggerBatteryAlertClear; + chip::Optional mTestEventTriggerHardwareFaultAlert; + chip::Optional mTestEventTriggerHardwareFaultAlertClear; + chip::Optional mTestEventTriggerEndOfServiceAlert; + chip::Optional mTestEventTriggerEndOfServiceAlertClear; + chip::Optional mEventNumber; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEventTriggersEnabled", value, 1)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 7: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::LowBattery::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lowBattery.alarmSeverityLevel", value.alarmSeverityLevel, 1U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 11: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::LowBattery::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("lowBattery.alarmSeverityLevel", value.alarmSeverityLevel, 2U)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 15: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hardwareFaultAlert", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hardwareFaultAlert", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 5U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 20: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::HardwareFault::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hardwareFaultAlert", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 24: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("endOfServiceAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("endOfServiceAlert", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 6U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 29: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::EndOfService::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("endOfServiceAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 33: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 4U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 40: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::SelfTestComplete::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 42: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 4U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testInProgress", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + shouldContinue = true; + break; + case 47: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::SelfTestComplete::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 49: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + 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, "Commission DUT to TH"); + 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 subscribes to BatteryAlert attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::BatteryAlert::Id, + 3, 30, true, chip::NullOptional, chip::NullOptional, + /* autoResubscribe = */ chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning Battery Alert Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerWarningBatteryAlert.HasValue() ? mTestEventTriggerWarningBatteryAlert.Value() + : 0xffffffff00000095ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 6: { + LogStep(6, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads LowBattery event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::LowBattery::Id, false, + chip::NullOptional); + } + case 8: { + LogStep(8, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Critical Battery Alert Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerCriticalBatteryAlert.HasValue() ? mTestEventTriggerCriticalBatteryAlert.Value() + : 0xffffffff0000009eULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 10: { + LogStep(10, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads LowBattery event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::LowBattery::Id, false, + chip::NullOptional); + } + case 12: { + LogStep(12, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Battery Alert Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerBatteryAlertClear.HasValue() ? mTestEventTriggerBatteryAlertClear.Value() : 0xffffffff000000a5ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 14: { + LogStep(14, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 16: { + LogStep(16, "TH subscribes to HardwareFaultAlert attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::HardwareFaultAlert::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 17: { + LogStep(17, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Hardware Fault Alert Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerHardwareFaultAlert.HasValue() ? mTestEventTriggerHardwareFaultAlert.Value() + : 0xffffffff00000093ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 18: { + LogStep(18, "TH waits for a report of HardwareFaultAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 19: { + LogStep(19, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "TH reads HardwareFault event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::HardwareFault::Id, false, + chip::NullOptional); + } + case 21: { + LogStep(21, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Hardware Fault Alert Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerHardwareFaultAlertClear.HasValue() + ? mTestEventTriggerHardwareFaultAlertClear.Value() + : 0xffffffff000000a3ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 22: { + LogStep(22, "TH waits for a report of HardwareFaultAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 23: { + LogStep(23, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 24: { + LogStep(24, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 25: { + LogStep(25, "TH subscribes to EndOfServiceAlert attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::EndOfServiceAlert::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 26: { + LogStep(26, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for End " + "of Service Alert Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerEndOfServiceAlert.HasValue() ? mTestEventTriggerEndOfServiceAlert.Value() : 0xffffffff0000009aULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 27: { + LogStep(27, "TH waits for a report of EndOfServiceAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 28: { + LogStep(28, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "TH reads EndOfService event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::EndOfService::Id, false, + chip::NullOptional); + } + case 30: { + LogStep(30, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for End " + "of Service Alert Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerEndOfServiceAlertClear.HasValue() + ? mTestEventTriggerEndOfServiceAlertClear.Value() + : 0xffffffff000000aaULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 31: { + LogStep(31, "TH waits for a report of EndOfServiceAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 32: { + LogStep(32, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 33: { + LogStep(33, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 34: { + LogStep(34, "TH subscribes to TestInProgress attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::TestInProgress::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 35: { + LogStep(35, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 36: { + LogStep(36, "Start manually DUT self-test"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && SMOKECO.M.ManuallyControlledTest"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 37: { + LogStep(37, "TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 38: { + LogStep(38, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 39: { + LogStep(39, "TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 40: { + LogStep(40, "TH reads SelfTestComplete event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::SelfTestComplete::Id, false, + chip::NullOptional); + } + case 41: { + LogStep(41, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 42: { + LogStep(42, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 43: { + LogStep(43, "TH sends SelfTestRequest command to DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Commands::SelfTestRequest::Id, value, + chip::NullOptional + + ); + } + case 44: { + LogStep(44, "TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 45: { + LogStep(45, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 46: { + LogStep(46, "TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 47: { + LogStep(47, "TH reads SelfTestComplete event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::SelfTestComplete::Id, false, + chip::NullOptional); + } + case 48: { + LogStep(48, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 49: { + LogStep(49, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMCO_2_5Suite : public TestCommand +{ +public: + Test_TC_SMCO_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SMCO_2_5", 75, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("TEST_EVENT_TRIGGER_KEY", &mTestEventTriggerKey); + AddArgument("TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_CRITICAL_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerCriticalSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerSmokeAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_WARNING_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_CRITICAL_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerCriticalCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_CO_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerCoAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_DEVICE_MUTED", 0, UINT64_MAX, &mTestEventTriggerDeviceMuted); + AddArgument("TEST_EVENT_TRIGGER_DEVICE_MUTED_CLEAR", 0, UINT64_MAX, &mTestEventTriggerDeviceMutedClear); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerInterconnectSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM_CLEAR", 0, UINT64_MAX, + &mTestEventTriggerInterconnectSmokeAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerInterconnectCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerInterconnectCoAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_CONTAMINATION_STATE_HIGH", 0, UINT64_MAX, &mTestEventTriggerContaminationStateHigh); + AddArgument("TEST_EVENT_TRIGGER_CONTAMINATION_STATE_LOW", 0, UINT64_MAX, &mTestEventTriggerContaminationStateLow); + AddArgument("TTEST_EVENT_TRIGGER_CONTAMINATION_STATE_CLEAR", 0, UINT64_MAX, &mTtestEventTriggerContaminationStateClear); + AddArgument("TEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_HIGH", 0, UINT64_MAX, &mTestEventTriggerSensitivityLevelHigh); + AddArgument("TEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_LOW", 0, UINT64_MAX, &mTestEventTriggerSensitivityLevelLow); + AddArgument("TTEST_EVENT_TRIGGER_SENSITIVITY_LEVEL_CLEAR", 0, UINT64_MAX, &mTtestEventTriggerSensitivityLevelClear); + AddArgument("EVENT_NUMBER", 0, UINT64_MAX, &mEventNumber); + } + + ~Test_TC_SMCO_2_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(6090)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + chip::Optional mTestEventTriggerKey; + chip::Optional mTestEventTriggerWarningSmokeAlarm; + chip::Optional mTestEventTriggerCriticalSmokeAlarm; + chip::Optional mTestEventTriggerSmokeAlarmClear; + chip::Optional mTestEventTriggerWarningCoAlarm; + chip::Optional mTestEventTriggerCriticalCoAlarm; + chip::Optional mTestEventTriggerCoAlarmClear; + chip::Optional mTestEventTriggerDeviceMuted; + chip::Optional mTestEventTriggerDeviceMutedClear; + chip::Optional mTestEventTriggerInterconnectSmokeAlarm; + chip::Optional mTestEventTriggerInterconnectSmokeAlarmClear; + chip::Optional mTestEventTriggerInterconnectCoAlarm; + chip::Optional mTestEventTriggerInterconnectCoAlarmClear; + chip::Optional mTestEventTriggerContaminationStateHigh; + chip::Optional mTestEventTriggerContaminationStateLow; + chip::Optional mTtestEventTriggerContaminationStateClear; + chip::Optional mTestEventTriggerSensitivityLevelHigh; + chip::Optional mTestEventTriggerSensitivityLevelLow; + chip::Optional mTtestEventTriggerSensitivityLevelClear; + chip::Optional mEventNumber; + + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum interconnectSmokeAlarmSeverityLevel; + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum interconnectCOAlarmSeverityLevel; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectSmokeAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEventTriggersEnabled", value, 1)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + interconnectSmokeAlarmSeverityLevel = value; + } + shouldContinue = true; + break; + case 6: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::InterconnectSmokeAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectSmokeAlarm.alarmSeverityLevel", value.alarmSeverityLevel, + interconnectSmokeAlarmSeverityLevel)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 7U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectSmokeAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 11: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectCOAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + interconnectCOAlarmSeverityLevel = value; + } + shouldContinue = true; + break; + case 16: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::InterconnectCOAlarm::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectCOAlarm.alarmSeverityLevel", value.alarmSeverityLevel, + interconnectCOAlarmSeverityLevel)); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 8U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectCOAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 21: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("contaminationState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 2U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("contaminationState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("contaminationState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("contaminationState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeSensitivityLevel", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeSensitivityLevel", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeSensitivityLevel", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeSensitivityLevel", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeSensitivityLevel", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 41: + 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 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 47: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AlarmMuted::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 50: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::MuteEnded::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 58: + 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 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 64: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::AlarmMuted::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 67: + switch (mTestSubStepIndex) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::Events::MuteEnded::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + mTestSubStepIndex++; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + break; + } + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 2U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceMuted", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Commission DUT to TH"); + 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 subscribes to InterconnectSmokeAlarm attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && DGGEN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectSmokeAlarm.HasValue() + ? mTestEventTriggerInterconnectSmokeAlarm.Value() + : 0xffffffff00000092ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 5: { + LogStep(5, "TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 6: { + LogStep(6, "TH reads InterconnectSmokeAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && SMOKECO.S.E08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::InterconnectSmokeAlarm::Id, + false, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect Smoke Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectSmokeAlarmClear.HasValue() + ? mTestEventTriggerInterconnectSmokeAlarmClear.Value() + : 0xffffffff000000a2ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 10: { + LogStep(10, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008 && SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 12: { + LogStep(12, "TH subscribes to InterconnectCOAlarm attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectCOAlarm::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 13: { + LogStep(13, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 14: { + LogStep(14, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectCoAlarm.HasValue() ? mTestEventTriggerInterconnectCoAlarm.Value() + : 0xffffffff00000094ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, "TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 16: { + LogStep(16, "TH reads InterconnectCOAlarm event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && SMOKECO.S.E09"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::InterconnectCOAlarm::Id, false, + chip::NullOptional); + } + case 17: { + LogStep(17, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect CO Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectCoAlarmClear.HasValue() + ? mTestEventTriggerInterconnectCoAlarmClear.Value() + : 0xffffffff000000a4ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 19: { + LogStep(19, "TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 20: { + LogStep(20, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009 && SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 21: { + LogStep(21, "TH reads AllClear event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.E0a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AllClear::Id, false, + chip::NullOptional); + } + case 22: { + LogStep(22, "TH subscribes to ContaminationState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::ContaminationState::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 23: { + LogStep(23, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Contamination State (High) Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerContaminationStateHigh.HasValue() + ? mTestEventTriggerContaminationStateHigh.Value() + : 0xffffffff00000096ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 24: { + LogStep(24, "TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 25: { + LogStep(25, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Contamination State Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTtestEventTriggerContaminationStateClear.HasValue() + ? mTtestEventTriggerContaminationStateClear.Value() + : 0xffffffff000000a6ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 26: { + LogStep(26, "TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 27: { + LogStep(27, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Contamination State (Low) Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerContaminationStateLow.HasValue() ? mTestEventTriggerContaminationStateLow.Value() + : 0xffffffff00000097ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 28: { + LogStep(28, "TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 29: { + LogStep(29, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Contamination State Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTtestEventTriggerContaminationStateClear.HasValue() + ? mTtestEventTriggerContaminationStateClear.Value() + : 0xffffffff000000a6ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 30: { + LogStep(30, "TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 31: { + LogStep(31, "TH subscribes to SmokeSensitivityLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::SmokeSensitivityLevel::Id, 3, 30, true, chip::NullOptional, + chip::NullOptional, /* autoResubscribe = */ chip::NullOptional); + } + case 32: { + LogStep(32, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Sensitivity Level (High) Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerSensitivityLevelHigh.HasValue() ? mTestEventTriggerSensitivityLevelHigh.Value() + : 0xffffffff00000098ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 33: { + LogStep(33, "TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 34: { + LogStep(34, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Sensitivity Level Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTtestEventTriggerSensitivityLevelClear.HasValue() + ? mTtestEventTriggerSensitivityLevelClear.Value() + : 0xffffffff000000a8ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 35: { + LogStep(35, "TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 36: { + LogStep(36, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Sensitivity Level (Low) Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerSensitivityLevelLow.HasValue() ? mTestEventTriggerSensitivityLevelLow.Value() + : 0xffffffff00000099ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 37: { + LogStep(37, "TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 38: { + LogStep(38, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Sensitivity Level Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b && DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTtestEventTriggerSensitivityLevelClear.HasValue() + ? mTtestEventTriggerSensitivityLevelClear.Value() + : 0xffffffff000000a8ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 39: { + LogStep(39, "TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 40: { + LogStep(40, "TH subscribes to DeviceMuted attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::DeviceMuted::Id, + 3, 30, true, chip::NullOptional, chip::NullOptional, + /* autoResubscribe = */ chip::NullOptional); + } + case 41: { + LogStep(41, "TH reads FeatureMap attribute(Smoke Alarm) from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 42: { + LogStep(42, "TH subscribes to SmokeState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::SmokeState::Id, 3, + 30, true, chip::NullOptional, chip::Optional(true), + /* autoResubscribe = */ chip::NullOptional); + } + case 43: { + LogStep(43, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningSmokeAlarm.HasValue() ? mTestEventTriggerWarningSmokeAlarm.Value() : 0xffffffff00000090ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 44: { + LogStep(44, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 45: { + LogStep(45, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMuted.HasValue() ? mTestEventTriggerDeviceMuted.Value() : 0xffffffff0000009bULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 46: { + LogStep(46, "TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 47: { + LogStep(47, "TH reads AlarmMuted event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.E06"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AlarmMuted::Id, false, + chip::NullOptional); + } + case 48: { + LogStep(48, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMutedClear.HasValue() ? mTestEventTriggerDeviceMutedClear.Value() : 0xffffffff000000abULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 49: { + LogStep(49, "TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 50: { + LogStep(50, "TH reads MuteEnded event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.E07"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::MuteEnded::Id, false, + chip::NullOptional); + } + case 51: { + LogStep(51, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Critical Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerCriticalSmokeAlarm.HasValue() ? mTestEventTriggerCriticalSmokeAlarm.Value() + : 0xffffffff0000009cULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 52: { + LogStep(52, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 53: { + LogStep(53, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMuted.HasValue() ? mTestEventTriggerDeviceMuted.Value() : 0xffffffff0000009bULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 54: { + LogStep(54, "TH waits 60 Seconds"); + VerifyOrDo(!ShouldSkip("!PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 60000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 55: { + LogStep(55, "TH reads DeviceMuted attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::DeviceMuted::Id, true, + chip::NullOptional); + } + case 56: { + LogStep(56, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F00 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerSmokeAlarmClear.HasValue() ? mTestEventTriggerSmokeAlarmClear.Value() : 0xffffffff000000a0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 57: { + LogStep(57, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.A0001 && SMOKECO.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 58: { + LogStep(58, "TH reads FeatureMap attribute(CO Alarm) from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 59: { + LogStep(59, "TH subscribes to COState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::COState::Id, 3, + 30, true, chip::NullOptional, chip::Optional(true), + /* autoResubscribe = */ chip::NullOptional); + } + case 60: { + LogStep(60, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningCoAlarm.HasValue() ? mTestEventTriggerWarningCoAlarm.Value() : 0xffffffff00000091ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 61: { + LogStep(61, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 62: { + LogStep(62, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMuted.HasValue() ? mTestEventTriggerDeviceMuted.Value() : 0xffffffff0000009bULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 63: { + LogStep(63, "TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 64: { + LogStep(64, "TH reads AlarmMuted event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.E06"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::AlarmMuted::Id, false, + chip::NullOptional); + } + case 65: { + LogStep(65, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMutedClear.HasValue() ? mTestEventTriggerDeviceMutedClear.Value() : 0xffffffff000000abULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 66: { + LogStep(66, "TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 67: { + LogStep(67, "TH reads MuteEnded event from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.E07"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + mTestSubStepCount = 1; + return ReadEvent(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Events::MuteEnded::Id, false, + chip::NullOptional); + } + case 68: { + LogStep(68, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Critical CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerCriticalCoAlarm.HasValue() ? mTestEventTriggerCriticalCoAlarm.Value() : 0xffffffff0000009dULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 69: { + LogStep(69, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 70: { + LogStep(70, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Manual Device Mute Test Event"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerDeviceMuted.HasValue() ? mTestEventTriggerDeviceMuted.Value() : 0xffffffff0000009bULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 71: { + LogStep(71, "TH waits 60 Seconds"); + VerifyOrDo(!ShouldSkip("!PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 60000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 72: { + LogStep(72, "TH reads DeviceMuted attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::DeviceMuted::Id, true, + chip::NullOptional); + } + case 73: { + LogStep(73, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for CO " + "Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && DGGEN.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerCoAlarmClear.HasValue() ? mTestEventTriggerCoAlarmClear.Value() : 0xffffffff000000a1ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 74: { + LogStep(74, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SMCO_2_6Suite : public TestCommand +{ +public: + Test_TC_SMCO_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SMCO_2_6", 34, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("TEST_EVENT_TRIGGER_KEY", &mTestEventTriggerKey); + AddArgument("TEST_EVENT_TRIGGER_WARNING_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_SMOKE_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerSmokeAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_WARNING_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerWarningCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_CO_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerCoAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_WARNING_BATTERY_ALERT", 0, UINT64_MAX, &mTestEventTriggerWarningBatteryAlert); + AddArgument("TEST_EVENT_TRIGGER_BATTERY_ALERT_CLEAR", 0, UINT64_MAX, &mTestEventTriggerBatteryAlertClear); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM", 0, UINT64_MAX, &mTestEventTriggerInterconnectSmokeAlarm); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_SMOKE_ALARM_CLEAR", 0, UINT64_MAX, + &mTestEventTriggerInterconnectSmokeAlarmClear); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM", 0, UINT64_MAX, &mTestEventTriggerInterconnectCoAlarm); + AddArgument("TEST_EVENT_TRIGGER_INTERCONNECT_CO_ALARM_CLEAR", 0, UINT64_MAX, &mTestEventTriggerInterconnectCoAlarmClear); + AddArgument("HIEST_PRI_ALARM", 0, UINT8_MAX, &mHiestPriAlarm); + } + + ~Test_TC_SMCO_2_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(3090)); } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + chip::Optional mTestEventTriggerKey; + chip::Optional mTestEventTriggerWarningSmokeAlarm; + chip::Optional mTestEventTriggerSmokeAlarmClear; + chip::Optional mTestEventTriggerWarningCoAlarm; + chip::Optional mTestEventTriggerCoAlarmClear; + chip::Optional mTestEventTriggerWarningBatteryAlert; + chip::Optional mTestEventTriggerBatteryAlertClear; + chip::Optional mTestEventTriggerInterconnectSmokeAlarm; + chip::Optional mTestEventTriggerInterconnectSmokeAlarmClear; + chip::Optional mTestEventTriggerInterconnectCoAlarm; + chip::Optional mTestEventTriggerInterconnectCoAlarmClear; + chip::Optional mHiestPriAlarm; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectSmokeAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectCOAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("testEventTriggersEnabled", value, 1)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, mHiestPriAlarm.HasValue() ? mHiestPriAlarm.Value() : 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("smokeState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, mHiestPriAlarm.HasValue() ? mHiestPriAlarm.Value() : 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("COState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, mHiestPriAlarm.HasValue() ? mHiestPriAlarm.Value() : 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectCOAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, mHiestPriAlarm.HasValue() ? mHiestPriAlarm.Value() : 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("interconnectSmokeAlarm", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, mHiestPriAlarm.HasValue() ? mHiestPriAlarm.Value() : 1U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("batteryAlert", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("expressedState", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + 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, "Commission DUT to TH"); + 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 ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH subscribes to BatteryAlert attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::BatteryAlert::Id, + 3, 30, true, chip::NullOptional, chip::NullOptional, + /* autoResubscribe = */ chip::NullOptional); + } + case 3: { + LogStep(3, "TH subscribes to InterconnectSmokeAlarm attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::Id, 3, 30, true, chip::NullOptional, + chip::Optional(true), /* autoResubscribe = */ chip::NullOptional); + } + case 4: { + LogStep(4, "TH subscribes to InterconnectCOAlarm attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, + SmokeCoAlarm::Attributes::InterconnectCOAlarm::Id, 3, 30, true, chip::NullOptional, + chip::Optional(true), /* autoResubscribe = */ chip::NullOptional); + } + case 5: { + LogStep(5, "TH subscribes to COState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::COState::Id, 3, + 30, true, chip::NullOptional, chip::Optional(true), + /* autoResubscribe = */ chip::NullOptional); + } + case 6: { + LogStep(6, "TH subscribes to SmokeState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return SubscribeAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::SmokeState::Id, 3, + 30, true, chip::NullOptional, chip::Optional(true), + /* autoResubscribe = */ chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster"); + VerifyOrDo(!ShouldSkip("DGGEN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning Battery Alert Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerWarningBatteryAlert.HasValue() ? mTestEventTriggerWarningBatteryAlert.Value() + : 0xffffffff00000095ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 10: { + LogStep(10, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectSmokeAlarm.HasValue() + ? mTestEventTriggerInterconnectSmokeAlarm.Value() + : 0xffffffff00000092ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 11: { + LogStep(11, "TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 12: { + LogStep(12, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectCoAlarm.HasValue() ? mTestEventTriggerInterconnectCoAlarm.Value() + : 0xffffffff00000094ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 13: { + LogStep(13, "TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 14: { + LogStep(14, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning CO Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningCoAlarm.HasValue() ? mTestEventTriggerWarningCoAlarm.Value() : 0xffffffff00000091ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 15: { + LogStep(15, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 16: { + LogStep(16, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Warning Smoke Alarm Test Event"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerWarningSmokeAlarm.HasValue() ? mTestEventTriggerWarningSmokeAlarm.Value() : 0xffffffff00000090ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 17: { + LogStep(17, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 18: { + LogStep(18, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 19: { + LogStep(19, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for Smoke " + "Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerSmokeAlarmClear.HasValue() ? mTestEventTriggerSmokeAlarmClear.Value() : 0xffffffff000000a0ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, "TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 21: { + LogStep(21, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 22: { + LogStep(22, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for CO " + "Alarm Test Event clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerCoAlarmClear.HasValue() ? mTestEventTriggerCoAlarmClear.Value() : 0xffffffff000000a1ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 23: { + LogStep(23, "TH waits for a report of COState attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 24: { + LogStep(24, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 25: { + LogStep(25, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect CO Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectCoAlarmClear.HasValue() + ? mTestEventTriggerInterconnectCoAlarmClear.Value() + : 0xffffffff000000a4ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 26: { + LogStep(26, "TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 27: { + LogStep(27, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 28: { + LogStep(28, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Interconnect Smoke Alarm Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = mTestEventTriggerInterconnectSmokeAlarmClear.HasValue() + ? mTestEventTriggerInterconnectSmokeAlarmClear.Value() + : 0xffffffff000000a2ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 29: { + LogStep(29, "TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 30: { + LogStep(30, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + case 31: { + LogStep(31, + "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to " + "PIXIT.SMOKECO.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.SMOKECO.TEST_EVENT_TRIGGER for " + "Battery Alert Test Event Clear"); + VerifyOrDo(!ShouldSkip("DGGEN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type value; + value.enableKey = mTestEventTriggerKey.HasValue() + ? mTestEventTriggerKey.Value() + : chip::ByteSpan(chip::Uint8::from_const_char("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"), + 16); + value.eventTrigger = + mTestEventTriggerBatteryAlertClear.HasValue() ? mTestEventTriggerBatteryAlertClear.Value() : 0xffffffff000000a5ULL; + return SendCommand(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Commands::TestEventTrigger::Id, value, chip::NullOptional + + ); + } + case 32: { + LogStep(32, "TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return WaitForReport(); + } + case 33: { + LogStep(33, "TH reads ExpressedState attribute from DUT"); + VerifyOrDo(!ShouldSkip("SMOKECO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), SmokeCoAlarm::Id, SmokeCoAlarm::Attributes::ExpressedState::Id, + true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_SWTCH_1_1Suite : public TestCommand { public: @@ -135304,6 +139935,13 @@ 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),