From f08638d85a780879ef4c58ab46b2c84ebc2a8f4f Mon Sep 17 00:00:00 2001 From: ManjunathRA Date: Sat, 5 Mar 2022 20:17:23 +0530 Subject: [PATCH] Test added and modified Mar 4 (#15854) * Added scripts : TC-DIAG-TH-NW-1.2 TC-PS-2.1 Modified scripts : TC-CC-2.1 TC-OO-2.1 TC-OO-2.2 TC-SWDIAG-1.1 TC-SWDIAG-2.1 TC-SWDIAG-3.1 * Added auto generated files Co-authored-by: ManjunathRA Co-authored-by: Justin Wood --- examples/chip-tool/templates/tests/tests.js | 2 + .../suites/certification/Test_TC_CC_2_1.yaml | 116 +- .../certification/Test_TC_DIAG_TH_NW_1_2.yaml | 798 + .../suites/certification/Test_TC_OO_2_1.yaml | 81 +- .../suites/certification/Test_TC_OO_2_2.yaml | 64 +- .../suites/certification/Test_TC_PS_2_1.yaml | 297 + .../certification/Test_TC_SWDIAG_1_1.yaml | 3 +- .../certification/Test_TC_SWDIAG_2_1.yaml | 4 +- .../certification/Test_TC_SWDIAG_3_1.yaml | 2 + .../Framework/CHIP/templates/tests/tests.js | 2 + .../Framework/CHIPTests/CHIPClustersTests.m | 3644 ++- .../chip-tool/zap-generated/test/Commands.h | 20135 +++++++++------- 12 files changed, 15881 insertions(+), 9267 deletions(-) create mode 100644 src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_1_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PS_2_1.yaml diff --git a/examples/chip-tool/templates/tests/tests.js b/examples/chip-tool/templates/tests/tests.js index 4bac24d9801dcc..d3cf270b86d42b 100644 --- a/examples/chip-tool/templates/tests/tests.js +++ b/examples/chip-tool/templates/tests/tests.js @@ -375,6 +375,7 @@ function getTests() const PowerSource = [ 'Test_TC_PS_1_1', + 'Test_TC_PS_2_1', ]; const PressureMeasurement = [ @@ -421,6 +422,7 @@ function getTests() const ThreadNetworkDiagnostics = [ 'Test_TC_DIAG_TH_NW_1_1', + 'Test_TC_DIAG_TH_NW_1_2', ]; const WiFiNetworkDiagnostics = [ diff --git a/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml index f218410205c5cf..27cef7c45f7665 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml @@ -28,12 +28,6 @@ tests: - name: "nodeId" value: nodeId - - label: "Reads mandatory attribute: CurrentHue" - command: "readAttribute" - attribute: "current hue" - response: - value: 0 - - label: "Validate constraints of attribute: current hue" command: "readAttribute" attribute: "current hue" @@ -57,12 +51,6 @@ tests: response: value: 0 - - label: "Reads mandatory attribute: CurrentSaturation" - command: "readAttribute" - attribute: "current saturation" - response: - value: 0 - - label: "Validate constraints of attribute: CurrentSaturation" command: "readAttribute" attribute: "current saturation" @@ -86,12 +74,6 @@ tests: response: value: 0 - - label: "Read the mandatory attribute: CurrentX" - command: "readAttribute" - attribute: "current x" - response: - value: 24939 - - label: "Validate constraints of attribute: CurrentX" command: "readAttribute" attribute: "current x" @@ -115,12 +97,6 @@ tests: response: value: 24939 - - label: "Read the mandatory attribute: CurrentY" - command: "readAttribute" - attribute: "current y" - response: - value: 24701 - - label: "Validate constraints of attribute: CurrentY" command: "readAttribute" attribute: "current y" @@ -144,13 +120,6 @@ tests: response: value: 24701 - - label: "Read the mandatory attribute: ColorTemperatureMireds" - disabled: true - command: "readAttribute" - attribute: "color temperature" - response: - value: 250 - - label: "Validate constraints of attribute: ColorTemperatureMireds" command: "readAttribute" attribute: "color temperature" @@ -178,13 +147,6 @@ tests: response: value: 250 - - label: "Read the mandatory attribute: ColorMode" - disabled: true - command: "readAttribute" - attribute: "color mode" - response: - value: 1 - - label: "Validate constraints of attribute: ColorMode" command: "readAttribute" attribute: "color mode" @@ -210,12 +172,6 @@ tests: response: value: 1 - - label: "Read the mandatory attribute: Options" - command: "readAttribute" - attribute: "color control options" - response: - value: 0 - - label: "Validate constraints of attribute: Options" command: "readAttribute" attribute: "color control options" @@ -235,12 +191,6 @@ tests: response: value: 0 - - label: "Read the mandatory attribute: EnhancedCurrentHue" - command: "readAttribute" - attribute: "enhanced current hue" - response: - value: 0 - - label: "Validate constraints of attribute: EnhancedCurrentHue" command: "readAttribute" attribute: "enhanced current hue" @@ -263,13 +213,6 @@ tests: response: value: 0 - - label: "Read the mandatory attribute: EnhancedColorMode" - disabled: true - command: "readAttribute" - attribute: "enhanced color mode" - response: - value: 1 - - label: "Validate constraints of attribute: EnhancedColorMode" command: "readAttribute" attribute: "enhanced color mode" @@ -294,12 +237,6 @@ tests: response: value: 1 - - label: "Read the mandatory attribute: ColorLoopActive" - command: "readAttribute" - attribute: "color loop active" - response: - value: 0 - - label: "Validate constraints of attribute: ColorLoopActive" command: "readAttribute" attribute: "color loop active" @@ -321,12 +258,6 @@ tests: response: value: 0 - - label: "Read the mandatory attribute: ColorLoopDirection" - command: "readAttribute" - attribute: "color loop direction" - response: - value: 0 - - label: "Validate constraints of attribute: ColorLoopDirection" command: "readAttribute" attribute: "color loop direction" @@ -349,12 +280,6 @@ tests: response: value: 0 - - label: "Read the mandatory attribute: ColorLoopTime" - command: "readAttribute" - attribute: "color loop time" - response: - value: 25 - - label: "Validate constraints of attribute: ColorLoopTime" command: "readAttribute" attribute: "color loop time" @@ -376,12 +301,6 @@ tests: response: value: 25 - - label: "Read the mandatory attribute: ColorLoopStartEnhancedHue" - command: "readAttribute" - attribute: "color loop start enhanced hue" - response: - value: 8960 - - label: "Validate constraints of attribute: ColorLoopStartEnhancedHue" command: "readAttribute" attribute: "color loop start enhanced hue" @@ -405,12 +324,6 @@ tests: response: value: 8960 - - label: "Read the mandatory attribute: ColorLoopStoredEnhancedHue" - command: "readAttribute" - attribute: "color loop stored enhanced hue" - response: - value: 0 - - label: "Validate constraints of attribute: ColorLoopStoredEnhancedHue" command: "readAttribute" attribute: "color loop stored enhanced hue" @@ -434,12 +347,6 @@ tests: response: value: 0 - - label: "Read the mandatory attribute: ColorCapabilities" - command: "readAttribute" - attribute: "color capabilities" - response: - value: 0 - - label: "Validate constraints of attribute: ColorCapabilities" command: "readAttribute" attribute: "color capabilities" @@ -447,7 +354,7 @@ tests: constraints: type: map16 minValue: 0 - maxValue: 65279 + maxValue: 31 - label: "Write the default values to mandatory attribute: ColorCapabilities" @@ -464,12 +371,6 @@ tests: response: value: 0 - - label: "Read the mandatory attribute: ColorTempPhysicalMinMireds" - command: "readAttribute" - attribute: "color temp physical min" - response: - value: 0 - - label: "Validate constraints of attribute: ColorTempPhysicalMinMireds" command: "readAttribute" attribute: "color temp physical min" @@ -495,12 +396,6 @@ tests: response: value: 0 - - label: "Read the mandatory attribute: ColorTempPhysicalMaxMireds" - command: "readAttribute" - attribute: "color temp physical max" - response: - value: 65279 - - label: "Validate constraints of attribute: ColorTempPhysicalMaxMireds" command: "readAttribute" attribute: "color temp physical max" @@ -578,13 +473,6 @@ tests: response: value: 0 - - label: "Read the Optional attribute: RemainingTime" - optional: true - command: "readAttribute" - attribute: "remaining time" - response: - value: 0 - - label: "Validate constraints of attribute: RemainingTime" optional: true command: "readAttribute" @@ -592,8 +480,6 @@ tests: response: constraints: type: uint16 - minValue: 0 - maxValue: 254 - label: "Write the default values to optional attribute: RemainingTime" optional: true diff --git a/src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_1_2.yaml b/src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_1_2.yaml new file mode 100644 index 00000000000000..3d6e366844fe55 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_1_2.yaml @@ -0,0 +1,798 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 51.2. TC-DIAG-TH_NW-1.2 Attributes [DUT Server] + +config: + nodeId: 0x12344321 + cluster: "Thread Network Diagnostics" + endpoint: 0 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + #Issue disabled this due to #14225 + - label: "read Channel attribute value" + disabled: true + command: "readAttribute" + attribute: "channel" + response: + value: 0 + + - label: "Validate constraints of attribute: Channel" + command: "readAttribute" + attribute: "channel" + response: + constraints: + type: uint16 + + #Issue #10988 if condition is required, need YAML support for this + - label: "read RoutingRole attribute value" + disabled: true + command: "readAttribute" + attribute: "RoutingRole" + response: + value: 0 + + - label: "read NetworkName attribute value" + disabled: true + command: "readAttribute" + attribute: "NetworkName" + response: + value: 0 + + - label: "Validate constraints of attribute: NetworkName" + command: "readAttribute" + attribute: "NetworkName" + response: + constraints: + type: string + maxLength: 16 + + - label: "read PanId attribute value" + disabled: true + command: "readAttribute" + attribute: "PanId" + response: + value: 0 + + - label: "Validate constraints of attribute: PanId" + command: "readAttribute" + attribute: "PanId" + response: + constraints: + type: uint16 + + - label: "read ExtendedPanId attribute value" + disabled: true + command: "readAttribute" + attribute: "ExtendedPanId" + response: + value: 0 + + - label: "Validate constraints of attribute: ExtendedPanId" + command: "readAttribute" + attribute: "ExtendedPanId" + response: + constraints: + type: uint64 + + - label: "read MeshLocalPrefix attribute value" + disabled: true + command: "readAttribute" + attribute: "MeshLocalPrefix" + response: + value: 0 + + - label: "read OverrunCount attribute value" + disabled: true + command: "readAttribute" + attribute: "OverrunCount" + response: + value: 0 + + - label: "Validate constraints of attribute: OverrunCount" + command: "readAttribute" + attribute: "OverrunCount" + response: + constraints: + type: uint64 + + #issue #11725 Reading the List is not implemented in YAML framework + - label: "read NeighborTable attribute value" + disabled: true + command: "readAttribute" + attribute: "NeighborTableList" + response: + constraints: + type: list + + - label: "read RouteTable attribute value" + disabled: true + command: "readAttribute" + attribute: "RouteTableList" + response: + constraints: + type: list + + - label: "read PartitionId attribute value" + command: "readAttribute" + attribute: "PartitionId" + response: + value: 0 + + - label: "Validate constraints of attribute: PartitionId" + command: "readAttribute" + attribute: "PartitionId" + response: + constraints: + type: uint32 + + - label: "read Weighting attribute value" + command: "readAttribute" + attribute: "weighting" + response: + value: 0 + + - label: "Validate constraints of attribute: weighting" + command: "readAttribute" + attribute: "weighting" + response: + constraints: + type: uint8 + + - label: "read DataVersion attribute value" + command: "readAttribute" + attribute: "DataVersion" + response: + value: 0 + + - label: "Validate constraints of attribute: DataVersion" + command: "readAttribute" + attribute: "DataVersion" + response: + constraints: + type: uint8 + + - label: "read StableDataVersion attribute value" + command: "readAttribute" + attribute: "StableDataVersion" + response: + value: 0 + + - label: "Validate constraints of attribute: StableDataVersion" + command: "readAttribute" + attribute: "StableDataVersion" + response: + constraints: + type: uint8 + + - label: "read LeaderRouterId attribute value" + command: "readAttribute" + attribute: "LeaderRouterId" + response: + value: 0 + + - label: "Validate constraints of attribute: LeaderRouterId" + command: "readAttribute" + attribute: "LeaderRouterId" + response: + constraints: + type: uint8 + + - label: "read DetachedRoleCount attribute value" + command: "readAttribute" + attribute: "DetachedRoleCount" + response: + value: 0 + + - label: "Validate constraints of attribute: DetachedRoleCount" + command: "readAttribute" + attribute: "DetachedRoleCount" + response: + constraints: + type: uint16 + + - label: "read ChildRoleCount attribute value" + command: "readAttribute" + attribute: "ChildRoleCount" + response: + value: 0 + + - label: "Validate constraints of attribute: ChildRoleCount" + command: "readAttribute" + attribute: "ChildRoleCount" + response: + constraints: + type: uint16 + + - label: "read RouterRoleCount attribute value" + command: "readAttribute" + attribute: "RouterRoleCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RouterRoleCount" + command: "readAttribute" + attribute: "RouterRoleCount" + response: + constraints: + type: uint16 + + - label: "read LeaderRoleCount attribute value" + command: "readAttribute" + attribute: "LeaderRoleCount" + response: + value: 0 + + - label: "Validate constraints of attribute: LeaderRoleCount" + command: "readAttribute" + attribute: "LeaderRoleCount" + response: + constraints: + type: uint16 + + - label: "read AttachAttemptCount attribute value" + command: "readAttribute" + attribute: "AttachAttemptCount" + response: + value: 0 + + - label: "Validate constraints of attribute: AttachAttemptCount" + command: "readAttribute" + attribute: "AttachAttemptCount" + response: + constraints: + type: uint16 + + - label: "read PartitionIdChangeCount attribute value" + command: "readAttribute" + attribute: "PartitionIdChangeCount" + response: + value: 0 + + - label: "Validate constraints of attribute: PartitionIdChangeCount" + command: "readAttribute" + attribute: "PartitionIdChangeCount" + response: + constraints: + type: uint16 + + - label: "read BetterPartitionAttachAttemptCount attribute value" + command: "readAttribute" + attribute: "BetterPartitionAttachAttemptCount" + response: + value: 0 + + - label: + "Validate constraints of attribute: BetterPartitionAttachAttemptCount" + command: "readAttribute" + attribute: "BetterPartitionAttachAttemptCount" + response: + constraints: + type: uint16 + + - label: "read ParentChangeCount attribute value" + command: "readAttribute" + attribute: "ParentChangeCount" + response: + value: 0 + + - label: "Validate constraints of attribute: ParentChangeCount" + command: "readAttribute" + attribute: "ParentChangeCount" + response: + constraints: + type: uint16 + + - label: "read TxTotalCount attribute value" + command: "readAttribute" + attribute: "TxTotalCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxTotalCount" + command: "readAttribute" + attribute: "TxTotalCount" + response: + constraints: + type: uint32 + + - label: "read TxUnicastCount attribute value" + command: "readAttribute" + attribute: "TxUnicastCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxUnicastCount" + command: "readAttribute" + attribute: "TxUnicastCount" + response: + constraints: + type: uint32 + + - label: "read TxBroadcastCount attribute value" + command: "readAttribute" + attribute: "TxBroadcastCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxBroadcastCount" + command: "readAttribute" + attribute: "TxBroadcastCount" + response: + constraints: + type: uint32 + + - label: "read TxNoAckRequestedCount attribute value" + command: "readAttribute" + attribute: "TxNoAckRequestedCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxNoAckRequestedCount" + command: "readAttribute" + attribute: "TxNoAckRequestedCount" + response: + constraints: + type: uint32 + + - label: "read TxDataCount attribute value" + command: "readAttribute" + attribute: "TxDataCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxDataCount" + command: "readAttribute" + attribute: "TxDataCount" + response: + constraints: + type: uint32 + + - label: "read TxDataPollCount attribute value" + command: "readAttribute" + attribute: "TxDataPollCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxDataPollCount" + command: "readAttribute" + attribute: "TxDataPollCount" + response: + constraints: + type: uint32 + + - label: "read TxBeaconCount attribute value" + command: "readAttribute" + attribute: "TxBeaconCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxBeaconCount" + command: "readAttribute" + attribute: "TxBeaconCount" + response: + constraints: + type: uint32 + + - label: "read TxBeaconRequestCount attribute value" + command: "readAttribute" + attribute: "TxBeaconRequestCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxBeaconRequestCount" + command: "readAttribute" + attribute: "TxBeaconRequestCount" + response: + constraints: + type: uint32 + + - label: "read TxOtherCount attribute value" + command: "readAttribute" + attribute: "TxOtherCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxOtherCount" + command: "readAttribute" + attribute: "TxOtherCount" + response: + constraints: + type: uint32 + + - label: "read TxRetryCount attribute value" + command: "readAttribute" + attribute: "TxRetryCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxRetryCount" + command: "readAttribute" + attribute: "TxRetryCount" + response: + constraints: + type: uint32 + + - label: "read TxDirectMaxRetryExpiryCount attribute value" + command: "readAttribute" + attribute: "TxDirectMaxRetryExpiryCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxDirectMaxRetryExpiryCount" + command: "readAttribute" + attribute: "TxDirectMaxRetryExpiryCount" + response: + constraints: + type: uint32 + + - label: "read TxIndirectMaxRetryExpiryCount attribute value" + command: "readAttribute" + attribute: "TxIndirectMaxRetryExpiryCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxIndirectMaxRetryExpiryCount" + command: "readAttribute" + attribute: "TxIndirectMaxRetryExpiryCount" + response: + constraints: + type: uint32 + + - label: "read TxErrCcaCount attribute value" + command: "readAttribute" + attribute: "TxErrCcaCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxErrCcaCount" + command: "readAttribute" + attribute: "TxErrCcaCount" + response: + constraints: + type: uint32 + + - label: "read TxErrAbortCount attribute value" + command: "readAttribute" + attribute: "TxErrAbortCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxErrAbortCount" + command: "readAttribute" + attribute: "TxErrAbortCount" + response: + constraints: + type: uint32 + + - label: "read TxErrBusyChannelCount attribute value" + command: "readAttribute" + attribute: "TxErrBusyChannelCount" + response: + value: 0 + + - label: "Validate constraints of attribute: TxErrBusyChannelCount" + command: "readAttribute" + attribute: "TxErrBusyChannelCount" + response: + constraints: + type: uint32 + + - label: "read RxTotalCount attribute value" + command: "readAttribute" + attribute: "RxTotalCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxTotalCount" + command: "readAttribute" + attribute: "RxTotalCount" + response: + constraints: + type: uint32 + + - label: "read RxUnicastCount attribute value" + command: "readAttribute" + attribute: "RxUnicastCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxUnicastCount" + command: "readAttribute" + attribute: "RxUnicastCount" + response: + constraints: + type: uint32 + + - label: "read RxBroadcastCount attribute value" + command: "readAttribute" + attribute: "RxBroadcastCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxBroadcastCount" + command: "readAttribute" + attribute: "RxBroadcastCount" + response: + constraints: + type: uint32 + + - label: "read RxDataCount attribute value" + command: "readAttribute" + attribute: "RxDataCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxDataCount" + command: "readAttribute" + attribute: "RxDataCount" + response: + constraints: + type: uint32 + + - label: "read RxDataPollCount attribute value" + command: "readAttribute" + attribute: "RxDataPollCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxDataPollCount" + command: "readAttribute" + attribute: "RxDataPollCount" + response: + constraints: + type: uint32 + + - label: "read RxBeaconCount attribute value" + command: "readAttribute" + attribute: "RxBeaconCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxBeaconCount" + command: "readAttribute" + attribute: "RxBeaconCount" + response: + constraints: + type: uint32 + + - label: "read RxBeaconRequestCount attribute value" + command: "readAttribute" + attribute: "RxBeaconRequestCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxBeaconRequestCount" + command: "readAttribute" + attribute: "RxBeaconRequestCount" + response: + constraints: + type: uint32 + + - label: "read RxOtherCount attribute value" + command: "readAttribute" + attribute: "RxOtherCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxOtherCount" + command: "readAttribute" + attribute: "RxOtherCount" + response: + constraints: + type: uint32 + + - label: "read RxAddressFilteredCount attribute value" + command: "readAttribute" + attribute: "RxAddressFilteredCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxAddressFilteredCount" + command: "readAttribute" + attribute: "RxAddressFilteredCount" + response: + constraints: + type: uint32 + + - label: "read RxDestAddrFilteredCount attribute value" + command: "readAttribute" + attribute: "RxDestAddrFilteredCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxDestAddrFilteredCount" + command: "readAttribute" + attribute: "RxDestAddrFilteredCount" + response: + constraints: + type: uint32 + + - label: "read RxDuplicatedCount attribute value" + command: "readAttribute" + attribute: "RxDuplicatedCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxDuplicatedCount" + command: "readAttribute" + attribute: "RxDuplicatedCount" + response: + constraints: + type: uint32 + + - label: "read RxErrNoFrameCount attribute value" + command: "readAttribute" + attribute: "RxErrNoFrameCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxErrNoFrameCount" + command: "readAttribute" + attribute: "RxErrNoFrameCount" + response: + constraints: + type: uint32 + + - label: "read RxErrUnknownNeighborCount attribute value" + command: "readAttribute" + attribute: "RxErrUnknownNeighborCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxErrUnknownNeighborCount" + command: "readAttribute" + attribute: "RxErrUnknownNeighborCount" + response: + constraints: + type: uint32 + + - label: "read RxErrInvalidScrAddrCount attribute value" + command: "readAttribute" + attribute: "RxErrInvalidSrcAddrCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxErrInvalidSrcAddrCount" + command: "readAttribute" + attribute: "RxErrInvalidSrcAddrCount" + response: + constraints: + type: uint32 + + - label: "read RxErrSecCount attribute value" + command: "readAttribute" + attribute: "RxErrSecCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxErrInvalidSrcAddrCount" + command: "readAttribute" + attribute: "RxErrSecCount" + response: + constraints: + type: uint32 + + - label: "read RxErrFcsCount attribute value" + command: "readAttribute" + attribute: "RxErrFcsCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxErrFcsCount" + command: "readAttribute" + attribute: "RxErrFcsCount" + response: + constraints: + type: uint32 + + - label: "read RxErrOtherCount attribute value" + command: "readAttribute" + attribute: "RxErrOtherCount" + response: + value: 0 + + - label: "Validate constraints of attribute: RxErrOtherCount" + command: "readAttribute" + attribute: "RxErrOtherCount" + response: + constraints: + type: uint32 + + - label: "read ActiveTimestamp attribute value" + command: "readAttribute" + attribute: "ActiveTimestamp" + response: + value: 0 + + - label: "Validate constraints of attribute: ActiveTimestamp" + command: "readAttribute" + attribute: "ActiveTimestamp" + response: + constraints: + type: uint64 + + - label: "read PendingTimestamp attribute value" + command: "readAttribute" + attribute: "PendingTimestamp" + response: + value: 0 + + - label: "Validate constraints of attribute: PendingTimestamp" + command: "readAttribute" + attribute: "PendingTimestamp" + response: + constraints: + type: uint64 + + - label: "read Delay attribute value" + command: "readAttribute" + attribute: "delay" + response: + value: 0 + + - label: "Validate constraints of attribute: delay" + command: "readAttribute" + attribute: "delay" + response: + constraints: + type: uint32 + + #issue #14097 Enable once attribute struct is supported + - label: "read SecurityPolicy attribute value" + disabled: true + command: "readAttribute" + attribute: "SecurityPolicy" + response: + value: 0 + + #disabled due to type error + - label: "read ChannelPage0Mask attribute value" + disabled: true + command: "readAttribute" + attribute: "ChannelMask" + response: + value: 0 + + - label: "Validate constraints of attribute: ChannelPage0Mask" + disabled: true + command: "readAttribute" + attribute: "ChannelMask" + response: + constraints: + type: octstr + + #issue #14097 Enable once attribute struct is supported + - label: "read OperationalDatasetComponents attribute value" + disabled: true + command: "readAttribute" + attribute: "OperationalDatasetComponents" + response: + value: 0 + + #issue #11725 Reading the List is not implemented in YAML framework + - label: "read ActiveNetworkFaults attribute value" + disabled: true + command: "readAttribute" + attribute: "ActiveNetworkFaultsList" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml index 39da698e47b9fd..324135f2ca337a 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 3.2.1. [TC-OO-2] Attributes with server as DUT +name: 3.2.1. [TC-OO-2.1] Attributes with server as DUT config: nodeId: 0x12344321 @@ -32,92 +32,33 @@ tests: command: "readAttribute" attribute: "OnOff" response: - value: 0 - - - label: "write the default value of mandatory attribute: OnOff" - command: "writeAttribute" - attribute: "OnOff" - arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "reads back mandatory attribute: OnOff" - command: "readAttribute" - attribute: "OnOff" - response: - value: 0 + constraints: + type: bool - label: "read LT attribute: GlobalSceneControl" command: "readAttribute" attribute: "GlobalSceneControl" response: - value: 1 + constraints: + type: bool - label: "read LT attribute: OnTime" command: "readAttribute" attribute: "OnTime" response: - value: 0 + constraints: + type: uint16 - label: "read LT attribute: OffWaitTime" command: "readAttribute" attribute: "OffWaitTime" response: - value: 0 + constraints: + type: uint16 - label: "read LT attribute: StartUpOnOff" command: "readAttribute" attribute: "StartUpOnOff" response: - value: 0 - - - label: "write the default value to LT attribute: GlobalSceneControl" - command: "writeAttribute" - attribute: "GlobalSceneControl" - arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "write the default value to LT attribute: OnTime" - command: "writeAttribute" - attribute: "OnTime" - arguments: - value: 0 - - - label: "write the default value to LT attribute: OffWaitTime" - command: "writeAttribute" - attribute: "OffWaitTime" - arguments: - value: 0 - - - label: "write the default value to LT attribute: StartUpOnOff" - command: "writeAttribute" - attribute: "StartUpOnOff" - arguments: - value: 0 - - - label: "reads back LT attribute: GlobalSceneControl" - command: "readAttribute" - attribute: "GlobalSceneControl" - response: - value: 1 - - - label: "reads back LT attribute: OnTime" - command: "readAttribute" - attribute: "OnTime" - response: - value: 0 - - - label: "reads back LT attribute: OffWaitTime" - command: "readAttribute" - attribute: "OffWaitTime" - response: - value: 0 - - - label: "reads back LT attribute: StartUpOnOff" - command: "readAttribute" - attribute: "StartUpOnOff" - response: - value: 0 + constraints: + type: enum8 diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml index df74425ef9d417..11f3c7c7174215 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 3.2.2. [TC-OO-3] Primary functionality with server as DUT +name: 3.2.2. [TC-OO-2.2] Primary functionality with server as DUT config: nodeId: 0x12344321 @@ -46,6 +46,24 @@ tests: response: value: 1 + - label: "Send On Command" + command: "On" + + - label: "Check on/off attribute value is true after on command" + command: "readAttribute" + attribute: "OnOff" + response: + value: 1 + + - label: "Send Off Command" + command: "Off" + + - label: "Check on/off attribute value is false after off command" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 + - label: "Send Off Command" command: "Off" @@ -58,6 +76,14 @@ tests: - label: "Send Toggle Command" command: "Toggle" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Check on/off attribute value is true after toggle command" command: "readAttribute" attribute: "OnOff" @@ -67,22 +93,52 @@ tests: - label: "Send Toggle Command" command: "Toggle" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Check on/off attribute value is false after toggle command" command: "readAttribute" attribute: "OnOff" response: value: 0 - - label: "Send On Command" - command: "on" + - label: "User prompt Set OnOff attribute manually to on" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operate on device to set OnOff attribute manually to on" - label: "Check on/off attribute value is true after on command" + disabled: true command: "readAttribute" attribute: "OnOff" response: value: 1 - - label: "Send Off Command" + - label: "User prompt Set OnOff attribute manually to off" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: + "Operate on device to set OnOff attribute manually to off" + + - label: "Check on/off attribute value is false after off command" + disabled: true + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 + + - label: "Reset Off Command" command: "Off" - label: "Check on/off attribute value is false after off command" diff --git a/src/app/tests/suites/certification/Test_TC_PS_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PS_2_1.yaml new file mode 100644 index 00000000000000..726c29f42981a9 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PS_2_1.yaml @@ -0,0 +1,297 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 60.2.1. [TC-PS-2.1] Attributes with server as DUT + +config: + nodeId: 0x12344321 + cluster: "Power Source" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Test Harness Client reads Status attribute from Server DUT" + command: "readAttribute" + attribute: "Status" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 3 + + - label: "Test Harness Client reads Order attribute from Server DUT" + command: "readAttribute" + attribute: "Order" + response: + constraints: + type: uint8 + + - label: "Test Harness Client reads Description attribute from Server DUT" + command: "readAttribute" + attribute: "Description" + response: + constraints: + type: string + + #Issue disabled below steps due to #13758 + - label: + "Test Harness Client reads WiredAssessedInputVoltage attribue from + Server DUT" + disabled: true + command: "readAttribute" + attribute: "WiredAssessedInputVoltage" + response: + constraints: + type: uint32 + + - label: + "Test Harness Client reads WiredAssessedInputFrequency attribute from + Server DUT" + disabled: true + command: "readAttribute" + attribute: "WiredAssessedInputFrequency" + response: + constraints: + type: uint16 + + - label: + "Test Harness Client reads WiredCurrentType attribute from Server DUT" + disabled: true + command: "readAttribute" + attribute: "WiredCurrentType" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: + "Test Harness Client reads WiredAssessedCurrent attribute from Server + DUT" + disabled: true + command: "readAttribute" + attribute: "WiredAssessedCurrent" + response: + constraints: + type: uint32 + + - label: "Test Harness Client reads WiredNominalVoltage from Server DUT" + disabled: true + command: "readAttribute" + attribute: "WiredNominalVoltage" + response: + constraints: + type: uint32 + + - label: "Test Harness Client reads WiredMaximumCurrent from Server DUT" + disabled: true + command: "readAttribute" + attribute: "WiredMaximumCurrent" + response: + constraints: + type: uint32 + + - label: "Test Harness Client reads WiredPresent from Server DUT" + disabled: true + command: "readAttribute" + attribute: "WiredMaximumCurrent" + response: + constraints: + type: bool + + - label: "Test Harness Client reads ActiveWiredFaults from Server DUT" + disabled: true + command: "readAttribute" + attribute: "ActiveWiredFaults" + response: + constraints: + type: list + + - label: "Test Harness Client reads BatVoltage from Server DUT" + command: "readAttribute" + attribute: "BatteryVoltage" + response: + constraints: + type: uint32 + + - label: "Test Harness Client reads BatPercentRemaining from Server DUT" + command: "readAttribute" + attribute: "BatteryPercentRemaining" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 200 + + - label: "Test Harness Client reads BatTimeRemaining from Server DUT" + command: "readAttribute" + attribute: "BatteryTimeRemaining" + response: + constraints: + type: uint32 + + - label: "Test Harness Client reads BatChargeLevel from Server DUT" + command: "readAttribute" + attribute: "BatteryChargeLevel" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "Test Harness Client reads BatReplacementNeeded from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatReplacementNeeded" + response: + constraints: + type: bool + + - label: "Test Harness Client reads BatReplaceability from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatReplaceability" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 3 + + - label: "Test Harness Client reads BatPresent from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatPresent" + response: + constraints: + type: bool + + - label: "Test Harness Client reads ActiveBatFaults from Server DUT" + command: "readAttribute" + attribute: "ActiveBatteryFaults" + response: + constraints: + type: list + + - label: + "Test Harness Client reads BatReplacementDescription from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatReplacementDescription" + response: + constraints: + type: string + maxLength: 60 + + - label: "Test Harness Client reads BatCommonDesignation from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatCommonDesignation" + response: + constraints: + type: uint32 + minValue: 0 + maxValue: 80 + + - label: "Test Harness Client reads BatANSIDesignation from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatANSIDesignation" + response: + constraints: + type: string + maxLength: 20 + + - label: "Test Harness Client reads BatIECDesignation from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatIECDesignation" + response: + constraints: + type: string + maxLength: 20 + + - label: "Test Harness Client reads BatApprovedChemistry from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatApprovedChemistry" + response: + constraints: + type: uint32 + minValue: 0 + maxValue: 32 + + - label: "Test Harness Client reads BatCapacity from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatCapacity" + response: + constraints: + type: uint32 + + - label: "Test Harness Client reads BatQuantity from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatQuantity" + response: + constraints: + type: uint8 + + - label: "Test Harness Client reads BatChargeState from Server DUT" + command: "readAttribute" + attribute: "BatteryChargeState" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 3 + + - label: "Test Harness Client reads BatTimeToFullCharge from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatTimeToFullCharge" + response: + constraints: + type: uint32 + + - label: + "Test Harness Client reads BatFunctionalWhileCharging from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatFunctionalWhileCharging" + response: + constraints: + type: bool + + - label: "Test Harness Client reads BatChargingCurrent from Server DUT" + disabled: true + command: "readAttribute" + attribute: "BatChargingCurrent" + response: + constraints: + type: uint32 + + - label: "Test Harness Client reads ActiveBatChargeFaults from Server DUT" + disabled: true + command: "readAttribute" + attribute: "ActiveBatChargeFaults" + response: + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_SWDIAG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_SWDIAG_1_1.yaml index 5e2af32844fd32..099a665a854504 100644 --- a/src/app/tests/suites/certification/Test_TC_SWDIAG_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_SWDIAG_1_1.yaml @@ -28,6 +28,7 @@ tests: - name: "nodeId" value: nodeId + #issue 873 - label: "Reads a list of ThreadMetrics struct non-global attribute from DUT." command: "readAttribute" @@ -35,7 +36,7 @@ tests: PICS: A_THREADMETRICS response: constraints: - value: 0 + type: list - label: "Reads CurrentHeapFree non-global attribute value from DUT" optional: true diff --git a/src/app/tests/suites/certification/Test_TC_SWDIAG_2_1.yaml b/src/app/tests/suites/certification/Test_TC_SWDIAG_2_1.yaml index 3e6af7155dd29b..97894e19f8fc3b 100644 --- a/src/app/tests/suites/certification/Test_TC_SWDIAG_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_SWDIAG_2_1.yaml @@ -20,7 +20,7 @@ config: endpoint: 0 tests: - #issue #11725 Reading the List is not implemented in YAML framework + #Disabled due to issue #11343 - label: "Reads a list of SoftwareFault struct from DUT" disabled: true command: "readAttribute" @@ -28,4 +28,4 @@ tests: PICS: E_SOFTWAREFAULT response: constraints: - value: 0 + type: list diff --git a/src/app/tests/suites/certification/Test_TC_SWDIAG_3_1.yaml b/src/app/tests/suites/certification/Test_TC_SWDIAG_3_1.yaml index a7b1cd48a0236f..5e2b2d498fe9d8 100644 --- a/src/app/tests/suites/certification/Test_TC_SWDIAG_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_SWDIAG_3_1.yaml @@ -41,6 +41,7 @@ tests: # TODO: Say something about the values? value: {} + #issue #830 - label: "Reads CurrentHeapUsed attribute value from DUT" optional: true command: "readAttribute" @@ -50,6 +51,7 @@ tests: constraints: type: uint64 + #issue #830 - label: "Reads CurrentHeapHighWaterMark attribute value from DUT" optional: true command: "readAttribute" diff --git a/src/darwin/Framework/CHIP/templates/tests/tests.js b/src/darwin/Framework/CHIP/templates/tests/tests.js index 55568dc873bc67..712fbd36e51b28 100644 --- a/src/darwin/Framework/CHIP/templates/tests/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests/tests.js @@ -162,6 +162,7 @@ function getTests() const PowerSource = [ 'Test_TC_PS_1_1', + 'Test_TC_PS_2_1', ]; const PressureMeasurement = [ @@ -208,6 +209,7 @@ function getTests() const ThreadNetworkDiagnostics = [ 'Test_TC_DIAG_TH_NW_1_1', + 'Test_TC_DIAG_TH_NW_1_2', ]; const WiFiNetworkDiagnostics = [ diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 36cd666cd5a968..8ffe1e178703e7 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -2292,30 +2292,6 @@ - (void)testSendClusterTest_TC_CC_2_1_000000_WaitForCommissionee [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTest_TC_CC_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads mandatory attribute: CurrentHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attribute: CurrentHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000002_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: current hue"]; @@ -2347,7 +2323,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000003_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000002_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default value to mandatory attribute: CurrentHue"]; @@ -2369,7 +2345,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000003_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000004_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000003_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentHue"]; @@ -2393,31 +2369,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads mandatory attribute: CurrentSaturation"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attribute: CurrentSaturation Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000006_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000004_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: CurrentSaturation"]; @@ -2449,7 +2401,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000006_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000007_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000005_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default value to mandatory attribute: CurrentSaturation"]; @@ -2472,7 +2424,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000007_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000008_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000006_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentSaturation"]; @@ -2496,31 +2448,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000008_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: CurrentX"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: CurrentX Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 24939U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000010_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000007_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: CurrentX"]; @@ -2552,7 +2480,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000010_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000011_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000008_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default value to mandatory attribute: CurrentX"]; @@ -2573,7 +2501,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000011_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000012_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000009_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentX"]; @@ -2597,31 +2525,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000012_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000013_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: CurrentY"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: CurrentY Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 24701U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000014_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000010_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: CurrentY"]; @@ -2653,7 +2557,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000014_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000015_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000011_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: CurrentY"]; @@ -2675,7 +2579,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000015_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000016_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000012_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: CurrentY"]; @@ -2699,7 +2603,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000016_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000017_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000013_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorTemperatureMireds"]; @@ -2732,7 +2636,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000017_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000018_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000014_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorMode"]; @@ -2764,31 +2668,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000018_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000019_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Options"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorControlOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Options Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000020_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000015_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: Options"]; @@ -2807,7 +2687,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000020_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000021_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000016_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: Options"]; @@ -2829,7 +2709,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000021_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000022_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000017_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: Options"]; @@ -2853,31 +2733,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000022_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000023_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: EnhancedCurrentHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: EnhancedCurrentHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000024_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000018_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: EnhancedCurrentHue"]; @@ -2896,7 +2752,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000024_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000025_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000019_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: EnhancedCurrentHue"]; @@ -2920,7 +2776,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000025_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000026_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000020_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: EnhancedCurrentHue"]; @@ -2944,7 +2800,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000026_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000027_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000021_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: EnhancedColorMode"]; @@ -2963,31 +2819,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000027_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000028_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorLoopActive"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: ColorLoopActive Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000029_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000022_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopActive"]; @@ -3006,7 +2838,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000029_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000030_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000023_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopActive"]; @@ -3029,7 +2861,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000030_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000031_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000024_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopActive"]; @@ -3053,31 +2885,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000031_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000032_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorLoopDirection"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: ColorLoopDirection Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000033_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000025_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopDirection"]; @@ -3096,7 +2904,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000033_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000034_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000026_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopDirection"]; @@ -3120,7 +2928,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000034_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000035_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000027_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopDirection"]; @@ -3144,31 +2952,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000035_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000036_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorLoopTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: ColorLoopTime Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 25U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000037_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000028_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopTime"]; @@ -3187,7 +2971,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000037_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000038_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000029_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopTime"]; @@ -3210,7 +2994,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000038_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000039_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000030_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopTime"]; @@ -3234,31 +3018,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000039_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000040_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorLoopStartEnhancedHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: ColorLoopStartEnhancedHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 8960U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000041_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000031_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopStartEnhancedHue"]; @@ -3278,7 +3038,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000041_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000042_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000032_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopStartEnhancedHue"]; @@ -3303,7 +3063,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000042_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000043_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000033_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopStartEnhancedHue"]; @@ -3328,9 +3088,10 @@ - (void)testSendClusterTest_TC_CC_2_1_000043_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000044_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000034_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorLoopStoredEnhancedHue"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopStoredEnhancedHue"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3338,32 +3099,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000044_ReadAttribute XCTAssertNotNil(cluster); [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: ColorLoopStoredEnhancedHue Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000045_ReadAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"Validate constraints of attribute: ColorLoopStoredEnhancedHue"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorLoopStoredEnhancedHue Error: %@", err); + NSLog(@"Validate constraints of attribute: ColorLoopStoredEnhancedHue Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -3372,7 +3108,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000045_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000046_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000035_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorLoopStoredEnhancedHue"]; @@ -3397,7 +3133,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000046_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000047_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000036_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorLoopStoredEnhancedHue"]; @@ -3422,31 +3158,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000047_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000048_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorCapabilities"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: ColorCapabilities Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000049_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000037_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorCapabilities"]; @@ -3469,7 +3181,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000049_ReadAttribute { id actualValue = value; if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 31U); } } @@ -3478,7 +3190,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000049_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000050_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000038_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorCapabilities"]; @@ -3501,7 +3213,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000050_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000051_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000039_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorCapabilities"]; @@ -3525,31 +3237,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000051_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000052_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorTempPhysicalMinMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorTempPhysicalMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: ColorTempPhysicalMinMireds Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000053_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000040_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorTempPhysicalMinMireds"]; @@ -3582,7 +3270,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000053_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000054_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000041_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorTempPhysicalMinMireds"]; @@ -3608,7 +3296,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000054_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000055_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000042_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorTempPhysicalMinMireds"]; @@ -3633,31 +3321,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000055_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000056_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: ColorTempPhysicalMaxMireds"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeColorTempPhysicalMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: ColorTempPhysicalMaxMireds Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 65279U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000057_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000043_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ColorTempPhysicalMaxMireds"]; @@ -3690,7 +3354,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000057_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000058_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000044_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory attribute: ColorTempPhysicalMaxMireds"]; @@ -3716,7 +3380,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000058_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000059_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000045_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: ColorTempPhysicalMaxMireds"]; @@ -3741,7 +3405,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000059_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000060_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000046_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: CoupleColorTempToLevelMinMireds"]; @@ -3767,7 +3431,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000060_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000061_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000047_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to optional attribute: CoupleColorTempToLevelMinMireds"]; @@ -3798,7 +3462,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000061_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000062_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000048_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back optional attribute: CoupleColorTempToLevelMinMireds"]; @@ -3829,7 +3493,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000062_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000063_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000049_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: StartUpColorTemperatureMireds"]; @@ -3868,7 +3532,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000063_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000064_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000050_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to optional attribute: StartUpColorTemperatureMireds"]; @@ -3899,7 +3563,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000064_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000065_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000051_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back optional attribute: StartUpColorTemperatureMireds"]; @@ -3930,36 +3594,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000065_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000066_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the Optional attribute: RemainingTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the Optional attribute: RemainingTime Error: %@", err); - - if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - [expectation fulfill]; - return; - } - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_2_1_000067_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000052_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RemainingTime"]; @@ -3978,25 +3613,12 @@ - (void)testSendClusterTest_TC_CC_2_1_000067_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 254U); - } - } - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000068_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000053_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to optional attribute: RemainingTime"]; @@ -4025,7 +3647,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000068_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000069_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000054_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back optional attribute: RemainingTime"]; @@ -4054,7 +3676,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000069_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000070_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000055_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: DriftCompensation"]; @@ -4091,7 +3713,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000070_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000071_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000056_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to optional attribute: DriftCompensation"]; @@ -4120,7 +3742,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000071_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000072_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000057_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back optional attribute: DriftCompensation"]; @@ -4149,7 +3771,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000072_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000073_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000058_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: CompensationText"]; @@ -4178,7 +3800,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000073_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000074_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000059_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to optional attribute: CompensationText"]; @@ -4207,7 +3829,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000074_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000075_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000060_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back optional attribute: CompensationText"]; @@ -4236,7 +3858,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000075_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000076_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000061_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: NumberOfPrimaries"]; @@ -4268,7 +3890,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000076_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000077_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000062_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: NumberOfPrimaries"]; @@ -4290,7 +3912,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000077_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000078_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000063_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: NumberOfPrimaries"]; @@ -4314,7 +3936,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000078_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000079_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000064_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary1X"]; @@ -4346,7 +3968,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000079_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000080_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000065_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary1X"]; @@ -4367,7 +3989,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000080_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000081_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000066_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary1X"]; @@ -4391,7 +4013,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000081_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000082_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000067_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary1Y"]; @@ -4423,7 +4045,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000082_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000083_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000068_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary1Y"]; @@ -4444,7 +4066,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000083_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000084_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000069_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary1Y"]; @@ -4468,7 +4090,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000084_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000085_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000070_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary1Intensity"]; @@ -4487,7 +4109,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000085_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000086_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000071_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary2X"]; @@ -4519,7 +4141,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000086_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000087_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000072_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary2X"]; @@ -4540,7 +4162,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000087_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000088_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000073_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary2X"]; @@ -4564,7 +4186,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000088_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000089_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000074_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary2Y"]; @@ -4596,7 +4218,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000089_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000090_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000075_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary2Y"]; @@ -4617,7 +4239,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000090_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000091_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000076_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary2Y"]; @@ -4641,7 +4263,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000091_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000092_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000077_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: Primary2Intensity"]; @@ -4660,7 +4282,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000092_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000093_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000078_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary3X"]; @@ -4692,7 +4314,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000093_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000094_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000079_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary3X"]; @@ -4713,7 +4335,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000094_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000095_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000080_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary3X"]; @@ -4737,7 +4359,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000095_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000096_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000081_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary3Y"]; @@ -4769,7 +4391,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000096_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000097_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000082_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary3Y"]; @@ -4790,7 +4412,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000097_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000098_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000083_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary3Y"]; @@ -4814,7 +4436,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000098_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000099_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000084_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary3Intensity"]; @@ -4833,7 +4455,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000099_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000100_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000085_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary4X"]; @@ -4865,7 +4487,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000100_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000101_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000086_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary4X"]; @@ -4886,7 +4508,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000101_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000102_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000087_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary4X"]; @@ -4910,7 +4532,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000102_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000103_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000088_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary4Y"]; @@ -4942,7 +4564,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000103_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000104_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000089_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary4Y"]; @@ -4963,7 +4585,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000104_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000105_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000090_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary4Y"]; @@ -4987,7 +4609,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000105_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000106_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000091_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary4Intensity"]; @@ -5006,7 +4628,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000106_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000107_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000092_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary5X"]; @@ -5038,7 +4660,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000107_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000108_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000093_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary5X"]; @@ -5059,7 +4681,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000108_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000109_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000094_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary5X"]; @@ -5083,7 +4705,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000109_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000110_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000095_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary5Y"]; @@ -5115,7 +4737,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000110_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000111_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000096_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary5Y"]; @@ -5136,7 +4758,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000111_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000112_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000097_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary5Y"]; @@ -5160,7 +4782,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000112_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000113_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000098_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary5Intensity"]; @@ -5179,7 +4801,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000113_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000114_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000099_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary6X"]; @@ -5211,7 +4833,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000114_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000115_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000100_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary6X"]; @@ -5232,7 +4854,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000115_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000116_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000101_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary6X"]; @@ -5256,7 +4878,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000116_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000117_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000102_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary6Y"]; @@ -5288,7 +4910,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000117_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000118_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000103_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default mandatory attribute: Primary6Y"]; @@ -5309,7 +4931,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000118_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000119_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000104_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the mandatory attribute: Primary6Y"]; @@ -5333,7 +4955,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000119_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000120_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000105_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the mandatory attribute: Primary6Intensity"]; @@ -5352,7 +4974,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000120_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000121_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000106_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: WhitePointX"]; @@ -5389,7 +5011,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000121_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000122_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000107_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: WhitePointX"]; @@ -5417,7 +5039,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000122_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000123_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000108_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: WhitePointX"]; @@ -5446,7 +5068,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000123_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000124_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000109_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: WhitePointY"]; @@ -5483,7 +5105,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000124_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000125_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000110_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: WhitePointY"]; @@ -5511,7 +5133,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000125_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000126_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000111_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: WhitePointY"]; @@ -5540,7 +5162,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000126_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000127_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000112_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointRX"]; @@ -5577,7 +5199,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000127_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000128_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000113_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointRX"]; @@ -5605,7 +5227,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000128_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000129_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000114_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointRX"]; @@ -5634,7 +5256,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000129_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000130_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000115_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointRY"]; @@ -5671,7 +5293,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000130_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000131_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000116_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointRY"]; @@ -5699,7 +5321,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000131_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000132_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000117_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointRY"]; @@ -5728,7 +5350,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000132_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000133_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000118_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointRIntensity"]; @@ -5752,7 +5374,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000133_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000134_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000119_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointRIntensity"]; @@ -5781,7 +5403,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000134_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000135_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000120_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointRIntensity"]; @@ -5810,7 +5432,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000135_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000136_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000121_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointGX"]; @@ -5847,7 +5469,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000136_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000137_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000122_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointGX"]; @@ -5875,7 +5497,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000137_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000138_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000123_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointGX"]; @@ -5904,7 +5526,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000138_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000139_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000124_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointGY"]; @@ -5941,7 +5563,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000139_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000140_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000125_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointGY"]; @@ -5969,7 +5591,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000140_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000141_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000126_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointGY"]; @@ -5998,7 +5620,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000141_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000142_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000127_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointGIntensity"]; @@ -6022,7 +5644,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000142_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000143_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000128_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointGIntensity"]; @@ -6051,7 +5673,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000143_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000144_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000129_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointGIntensity"]; @@ -6080,7 +5702,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000144_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000145_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000130_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointBX"]; @@ -6117,7 +5739,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000145_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000146_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000131_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointBX"]; @@ -6145,7 +5767,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000146_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000147_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000132_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointBX"]; @@ -6174,7 +5796,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000147_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000148_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000133_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointBY"]; @@ -6211,7 +5833,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000148_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000149_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000134_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointBY"]; @@ -6239,7 +5861,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000149_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000150_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000135_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointBY"]; @@ -6268,7 +5890,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000150_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000151_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000136_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional attribute: ColorPointBIntensity"]; @@ -6292,7 +5914,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000151_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000152_WriteAttribute +- (void)testSendClusterTest_TC_CC_2_1_000137_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default optional attribute: ColorPointBIntensity"]; @@ -6321,7 +5943,7 @@ - (void)testSendClusterTest_TC_CC_2_1_000152_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_2_1_000153_ReadAttribute +- (void)testSendClusterTest_TC_CC_2_1_000138_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read back the optional attribute: ColorPointBIntensity"]; @@ -17534,110 +17156,50 @@ - (void)testSendClusterTest_TC_OO_2_1_000001_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000002_WriteAttribute +- (void)testSendClusterTest_TC_OO_2_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value of mandatory attribute: OnOff"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: GlobalSceneControl"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id onOffArgument; - onOffArgument = [NSNumber numberWithBool:0]; - [cluster writeAttributeOnOffWithValue:onOffArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default value of mandatory attribute: OnOff Error: %@", err); + [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read LT attribute: GlobalSceneControl Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTest_TC_OO_2_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back mandatory attribute: OnOff"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: OnTime"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back mandatory attribute: OnOff Error: %@", err); + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read LT attribute: OnTime Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); - } - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTest_TC_OO_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: GlobalSceneControl"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LT attribute: GlobalSceneControl Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: OnTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read LT attribute: OnTime Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_1_000006_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: OffWaitTime"]; @@ -17651,17 +17213,12 @@ - (void)testSendClusterTest_TC_OO_2_1_000006_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000007_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_1_000005_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"read LT attribute: StartUpOnOff"]; @@ -17675,146 +17232,56 @@ - (void)testSendClusterTest_TC_OO_2_1_000007_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000008_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default value to LT attribute: GlobalSceneControl"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id globalSceneControlArgument; - globalSceneControlArgument = [NSNumber numberWithBool:0]; - [cluster writeAttributeGlobalSceneControlWithValue:globalSceneControlArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default value to LT attribute: GlobalSceneControl Error: %@", err); - - XCTAssertEqual( - [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_1_000009_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: OnTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id onTimeArgument; - onTimeArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeOnTimeWithValue:onTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default value to LT attribute: OnTime Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_1_000010_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: OffWaitTime"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id offWaitTimeArgument; - offWaitTimeArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeOffWaitTimeWithValue:offWaitTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default value to LT attribute: OffWaitTime Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_1_000011_WriteAttribute +- (void)testSendClusterTest_TC_OO_2_2_000000_WaitForCommissionee { - XCTestExpectation * expectation = [self expectationWithDescription:@"write the default value to LT attribute: StartUpOnOff"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id startUpOnOffArgument; - startUpOnOffArgument = [NSNumber numberWithUnsignedChar:0]; - [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default value to LT attribute: StartUpOnOff Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - + WaitForCommissionee(expectation, queue, 305414945); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000012_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000001_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: GlobalSceneControl"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back LT attribute: GlobalSceneControl Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Off Command Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000013_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: OnTime"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back LT attribute: OnTime Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); + XCTAssertEqual([actualValue boolValue], 0); } [expectation fulfill]; @@ -17822,47 +17289,42 @@ - (void)testSendClusterTest_TC_OO_2_1_000013_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000014_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000003_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: OffWaitTime"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back LT attribute: OffWaitTime Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send On Command Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 0U); - } - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_1_000015_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back LT attribute: StartUpOnOff"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back LT attribute: StartUpOnOff Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); + XCTAssertEqual([actualValue boolValue], 1); } [expectation fulfill]; @@ -17870,26 +17332,17 @@ - (void)testSendClusterTest_TC_OO_2_1_000015_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_OO_2_2_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OO_2_2_000001_Off +- (void)testSendClusterTest_TC_OO_2_2_000005_On { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send On Command Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -17898,9 +17351,9 @@ - (void)testSendClusterTest_TC_OO_2_2_000001_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000002_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000006_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -17908,13 +17361,13 @@ - (void)testSendClusterTest_TC_OO_2_2_000002_ReadAttribute XCTAssertNotNil(cluster); [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertEqual([actualValue boolValue], 0); + XCTAssertEqual([actualValue boolValue], 1); } [expectation fulfill]; @@ -17922,17 +17375,17 @@ - (void)testSendClusterTest_TC_OO_2_2_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000003_On +- (void)testSendClusterTest_TC_OO_2_2_000007_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Off Command Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -17941,9 +17394,9 @@ - (void)testSendClusterTest_TC_OO_2_2_000003_On [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000004_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000008_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -17951,13 +17404,13 @@ - (void)testSendClusterTest_TC_OO_2_2_000004_ReadAttribute XCTAssertNotNil(cluster); [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); + XCTAssertEqual([actualValue boolValue], 0); } [expectation fulfill]; @@ -17965,7 +17418,7 @@ - (void)testSendClusterTest_TC_OO_2_2_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000005_Off +- (void)testSendClusterTest_TC_OO_2_2_000009_Off { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; @@ -17984,7 +17437,7 @@ - (void)testSendClusterTest_TC_OO_2_2_000005_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000006_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000010_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; @@ -18008,7 +17461,7 @@ - (void)testSendClusterTest_TC_OO_2_2_000006_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000007_Toggle +- (void)testSendClusterTest_TC_OO_2_2_000011_Toggle { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Toggle Command"]; @@ -18027,7 +17480,15 @@ - (void)testSendClusterTest_TC_OO_2_2_000007_Toggle [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000008_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000012_WaitForMs +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1000ms"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForMs(expectation, queue, 1000); + [self waitForExpectationsWithTimeout:(1000 / 1000) + kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OO_2_2_000013_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after toggle command"]; @@ -18052,7 +17513,7 @@ - (void)testSendClusterTest_TC_OO_2_2_000008_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000009_Toggle +- (void)testSendClusterTest_TC_OO_2_2_000014_Toggle { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Toggle Command"]; @@ -18071,7 +17532,15 @@ - (void)testSendClusterTest_TC_OO_2_2_000009_Toggle [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000010_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000015_WaitForMs +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 1000ms"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForMs(expectation, queue, 1000); + [self waitForExpectationsWithTimeout:(1000 / 1000) + kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OO_2_2_000016_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after toggle command"]; @@ -18096,52 +17565,25 @@ - (void)testSendClusterTest_TC_OO_2_2_000010_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000011_On +- (void)testSendClusterTest_TC_OO_2_2_000017_UserPrompt { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send On Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"User prompt Set OnOff attribute manually to on"]; - CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - + UserPrompt(expectation, queue, @"Operate on device to set OnOff attribute manually to on"); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000012_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000018_UserPrompt { - XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is true after on command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"User prompt Set OnOff attribute manually to off"]; - CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue boolValue], 1); - } - - [expectation fulfill]; - }]; - + UserPrompt(expectation, queue, @"Operate on device to set OnOff attribute manually to off"); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000013_Off +- (void)testSendClusterTest_TC_OO_2_2_000019_Off { - XCTestExpectation * expectation = [self expectationWithDescription:@"Send Off Command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Reset Off Command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -18149,7 +17591,7 @@ - (void)testSendClusterTest_TC_OO_2_2_000013_Off XCTAssertNotNil(cluster); [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); + NSLog(@"Reset Off Command Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -18158,7 +17600,7 @@ - (void)testSendClusterTest_TC_OO_2_2_000013_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_2_2_000014_ReadAttribute +- (void)testSendClusterTest_TC_OO_2_2_000020_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; @@ -19316,7 +18758,7 @@ - (void)testSendClusterTest_TC_PS_1_1_000005_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PRS_1_1_000000_WaitForCommissionee +- (void)testSendClusterTest_TC_PS_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -19324,22 +18766,260 @@ - (void)testSendClusterTest_TC_PRS_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue, 305414945); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PRS_1_1_000001_ReadAttribute +- (void)testSendClusterTest_TC_PS_2_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Test Harness Client reads Status attribute from Server DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads Status attribute from Server DUT Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 3); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_2_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Test Harness Client reads Order attribute from Server DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOrderWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads Order attribute from Server DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_2_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Test Harness Client reads Description attribute from Server DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads Description attribute from Server DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_2_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Test Harness Client reads BatVoltage from Server DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeBatteryVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatVoltage from Server DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_2_1_000005_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Test Harness Client reads BatPercentRemaining from Server DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeBatteryPercentRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatPercentRemaining from Server DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 200); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_2_1_000006_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Test Harness Client reads BatTimeRemaining from Server DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeBatteryTimeRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatTimeRemaining from Server DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_2_1_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Test Harness Client reads BatChargeLevel from Server DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeBatteryChargeLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatChargeLevel from Server DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 2); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_2_1_000008_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Test Harness Client reads ActiveBatFaults from Server DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeActiveBatteryFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads ActiveBatFaults from Server DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_2_1_000009_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Test Harness Client reads BatChargeState from Server DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeBatteryChargeStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatChargeState from Server DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 3); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_PRS_1_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PRS_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } @@ -26321,6 +26001,2394 @@ - (void)testSendClusterTest_TC_DIAG_TH_NW_1_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: Channel"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeChannelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: Channel Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: NetworkName"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNetworkNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: NetworkName Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertLessThanOrEqual([actualValue length], 16); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: PanId"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributePanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: PanId Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ExtendedPanId"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeExtendedPanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: ExtendedPanId Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: OverrunCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: OverrunCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read PartitionId attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributePartitionIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read PartitionId attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: PartitionId"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributePartitionIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: PartitionId Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000008_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read Weighting attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeWeightingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read Weighting attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000009_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: weighting"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeWeightingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: weighting Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000010_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read DataVersion attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read DataVersion attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000011_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: DataVersion"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: DataVersion Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000012_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read StableDataVersion attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeStableDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read StableDataVersion attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000013_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: StableDataVersion"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeStableDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: StableDataVersion Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000014_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read LeaderRouterId attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLeaderRouterIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read LeaderRouterId attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000015_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: LeaderRouterId"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLeaderRouterIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: LeaderRouterId Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000016_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read DetachedRoleCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeDetachedRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read DetachedRoleCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 0U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000017_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: DetachedRoleCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeDetachedRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: DetachedRoleCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000018_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read ChildRoleCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeChildRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read ChildRoleCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 0U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000019_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ChildRoleCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeChildRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: ChildRoleCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000020_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RouterRoleCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRouterRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RouterRoleCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 0U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000021_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RouterRoleCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRouterRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RouterRoleCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000022_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read LeaderRoleCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLeaderRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read LeaderRoleCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 0U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000023_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: LeaderRoleCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLeaderRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: LeaderRoleCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000024_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read AttachAttemptCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read AttachAttemptCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 0U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000025_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: AttachAttemptCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: AttachAttemptCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000026_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read PartitionIdChangeCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributePartitionIdChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read PartitionIdChangeCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 0U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000027_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Validate constraints of attribute: PartitionIdChangeCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributePartitionIdChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: PartitionIdChangeCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000028_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read BetterPartitionAttachAttemptCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeBetterPartitionAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read BetterPartitionAttachAttemptCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 0U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000029_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Validate constraints of attribute: BetterPartitionAttachAttemptCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeBetterPartitionAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: BetterPartitionAttachAttemptCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000030_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read ParentChangeCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeParentChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read ParentChangeCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 0U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000031_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ParentChangeCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeParentChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: ParentChangeCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000032_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxTotalCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxTotalCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000033_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxTotalCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxTotalCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000034_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxUnicastCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxUnicastCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000035_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxUnicastCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxUnicastCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000036_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxBroadcastCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxBroadcastCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000037_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxBroadcastCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxBroadcastCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000038_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxNoAckRequestedCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxNoAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxNoAckRequestedCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000039_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxNoAckRequestedCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxNoAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxNoAckRequestedCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000040_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxDataCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxDataCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000041_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxDataCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxDataCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000042_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxDataPollCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxDataPollCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000043_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxDataPollCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxDataPollCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000044_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxBeaconCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxBeaconCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000045_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxBeaconCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxBeaconCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000046_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxBeaconRequestCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxBeaconRequestCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000047_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxBeaconRequestCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxBeaconRequestCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000048_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxOtherCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxOtherCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000049_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxOtherCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxOtherCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000050_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxRetryCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxRetryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxRetryCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000051_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxRetryCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxRetryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxRetryCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000052_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxDirectMaxRetryExpiryCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxDirectMaxRetryExpiryCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000053_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Validate constraints of attribute: TxDirectMaxRetryExpiryCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxDirectMaxRetryExpiryCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000054_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxIndirectMaxRetryExpiryCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxIndirectMaxRetryExpiryCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000055_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Validate constraints of attribute: TxIndirectMaxRetryExpiryCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxIndirectMaxRetryExpiryCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000056_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxErrCcaCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxErrCcaCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxErrCcaCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000057_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxErrCcaCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxErrCcaCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxErrCcaCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000058_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxErrAbortCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxErrAbortCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxErrAbortCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000059_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxErrAbortCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxErrAbortCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxErrAbortCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000060_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read TxErrBusyChannelCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxErrBusyChannelCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read TxErrBusyChannelCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000061_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: TxErrBusyChannelCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxErrBusyChannelCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: TxErrBusyChannelCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000062_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxTotalCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxTotalCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000063_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxTotalCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxTotalCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000064_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxUnicastCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxUnicastCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000065_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxUnicastCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxUnicastCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000066_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxBroadcastCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxBroadcastCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000067_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxBroadcastCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxBroadcastCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000068_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxDataCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxDataCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000069_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxDataCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxDataCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000070_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxDataPollCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxDataPollCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000071_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxDataPollCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxDataPollCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000072_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxBeaconCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxBeaconCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000073_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxBeaconCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxBeaconCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000074_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxBeaconRequestCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxBeaconRequestCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000075_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxBeaconRequestCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxBeaconRequestCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000076_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxOtherCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxOtherCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000077_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxOtherCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxOtherCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000078_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxAddressFilteredCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxAddressFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxAddressFilteredCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000079_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Validate constraints of attribute: RxAddressFilteredCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxAddressFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxAddressFilteredCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000080_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxDestAddrFilteredCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxDestAddrFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxDestAddrFilteredCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000081_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Validate constraints of attribute: RxDestAddrFilteredCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxDestAddrFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxDestAddrFilteredCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000082_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxDuplicatedCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxDuplicatedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxDuplicatedCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000083_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxDuplicatedCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxDuplicatedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxDuplicatedCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000084_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrNoFrameCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrNoFrameCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrNoFrameCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000085_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxErrNoFrameCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrNoFrameCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrNoFrameCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000086_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrUnknownNeighborCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrUnknownNeighborCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrUnknownNeighborCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000087_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Validate constraints of attribute: RxErrUnknownNeighborCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrUnknownNeighborCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrUnknownNeighborCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000088_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrInvalidScrAddrCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrInvalidScrAddrCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000089_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Validate constraints of attribute: RxErrInvalidSrcAddrCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrInvalidSrcAddrCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000090_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrSecCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrSecCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrSecCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000091_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Validate constraints of attribute: RxErrInvalidSrcAddrCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrSecCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrInvalidSrcAddrCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000092_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrFcsCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrFcsCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrFcsCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000093_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxErrFcsCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrFcsCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrFcsCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000094_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read RxErrOtherCount attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read RxErrOtherCount attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000095_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: RxErrOtherCount"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRxErrOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: RxErrOtherCount Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000096_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read ActiveTimestamp attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeActiveTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read ActiveTimestamp attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000097_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: ActiveTimestamp"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeActiveTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: ActiveTimestamp Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000098_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read PendingTimestamp attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributePendingTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read PendingTimestamp attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000099_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: PendingTimestamp"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributePendingTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: PendingTimestamp Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000100_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read Delay attribute value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeDelayWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read Delay attribute value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedIntValue], 0UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAG_TH_NW_1_2_000101_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Validate constraints of attribute: delay"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeDelayWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate constraints of attribute: delay Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_WIFIDIAG_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 9ab6387e078cb6..8268b8131ad27e 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -125,6 +125,7 @@ class TestList : public Command printf("Test_TC_OO_2_2\n"); printf("Test_TC_OO_2_3\n"); printf("Test_TC_PS_1_1\n"); + printf("Test_TC_PS_2_1\n"); printf("Test_TC_PRS_1_1\n"); printf("Test_TC_PRS_2_1\n"); printf("Test_TC_PCC_1_1\n"); @@ -147,6 +148,7 @@ class TestList : public Command printf("Test_TC_TSUIC_2_1\n"); printf("Test_TC_TSUIC_2_2\n"); printf("Test_TC_DIAG_TH_NW_1_1\n"); + printf("Test_TC_DIAG_TH_NW_1_2\n"); printf("Test_TC_WIFIDIAG_1_1\n"); printf("Test_TC_WIFIDIAG_3_1\n"); printf("Test_TC_WNCV_1_1\n"); @@ -3807,625 +3809,565 @@ class Test_TC_CC_2_1Suite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads mandatory attribute: CurrentHue\n"); - err = TestReadsMandatoryAttributeCurrentHue_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Validate constraints of attribute: current hue\n"); + err = TestValidateConstraintsOfAttributeCurrentHue_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Validate constraints of attribute: current hue\n"); - err = TestValidateConstraintsOfAttributeCurrentHue_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Write the default value to mandatory attribute: CurrentHue\n"); + err = TestWriteTheDefaultValueToMandatoryAttributeCurrentHue_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write the default value to mandatory attribute: CurrentHue\n"); - err = TestWriteTheDefaultValueToMandatoryAttributeCurrentHue_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads back mandatory attribute: CurrentHue\n"); + err = TestReadsBackMandatoryAttributeCurrentHue_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads back mandatory attribute: CurrentHue\n"); - err = TestReadsBackMandatoryAttributeCurrentHue_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Validate constraints of attribute: CurrentSaturation\n"); + err = TestValidateConstraintsOfAttributeCurrentSaturation_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads mandatory attribute: CurrentSaturation\n"); - err = TestReadsMandatoryAttributeCurrentSaturation_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Write the default value to mandatory attribute: CurrentSaturation\n"); + err = TestWriteTheDefaultValueToMandatoryAttributeCurrentSaturation_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Validate constraints of attribute: CurrentSaturation\n"); - err = TestValidateConstraintsOfAttributeCurrentSaturation_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads back mandatory attribute: CurrentSaturation\n"); + err = TestReadsBackMandatoryAttributeCurrentSaturation_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write the default value to mandatory attribute: CurrentSaturation\n"); - err = TestWriteTheDefaultValueToMandatoryAttributeCurrentSaturation_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Validate constraints of attribute: CurrentX\n"); + err = TestValidateConstraintsOfAttributeCurrentX_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads back mandatory attribute: CurrentSaturation\n"); - err = TestReadsBackMandatoryAttributeCurrentSaturation_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Write the default value to mandatory attribute: CurrentX\n"); + err = TestWriteTheDefaultValueToMandatoryAttributeCurrentX_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read the mandatory attribute: CurrentX\n"); - err = TestReadTheMandatoryAttributeCurrentX_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Reads back mandatory attribute: CurrentX\n"); + err = TestReadsBackMandatoryAttributeCurrentX_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Validate constraints of attribute: CurrentX\n"); - err = TestValidateConstraintsOfAttributeCurrentX_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Validate constraints of attribute: CurrentY\n"); + err = TestValidateConstraintsOfAttributeCurrentY_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Write the default value to mandatory attribute: CurrentX\n"); - err = TestWriteTheDefaultValueToMandatoryAttributeCurrentX_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Write the default values to mandatory attribute: CurrentY\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeCurrentY_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Reads back mandatory attribute: CurrentX\n"); - err = TestReadsBackMandatoryAttributeCurrentX_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads back mandatory attribute: CurrentY\n"); + err = TestReadsBackMandatoryAttributeCurrentY_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read the mandatory attribute: CurrentY\n"); - err = TestReadTheMandatoryAttributeCurrentY_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Validate constraints of attribute: ColorTemperatureMireds\n"); + err = TestValidateConstraintsOfAttributeColorTemperatureMireds_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Validate constraints of attribute: CurrentY\n"); - err = TestValidateConstraintsOfAttributeCurrentY_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Validate constraints of attribute: ColorMode\n"); + err = TestValidateConstraintsOfAttributeColorMode_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Write the default values to mandatory attribute: CurrentY\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeCurrentY_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Validate constraints of attribute: Options\n"); + err = TestValidateConstraintsOfAttributeOptions_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Reads back mandatory attribute: CurrentY\n"); - err = TestReadsBackMandatoryAttributeCurrentY_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : Write the default values to mandatory attribute: Options\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeOptions_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Validate constraints of attribute: ColorTemperatureMireds\n"); - err = TestValidateConstraintsOfAttributeColorTemperatureMireds_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Reads back mandatory attribute: Options\n"); + err = TestReadsBackMandatoryAttributeOptions_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Validate constraints of attribute: ColorMode\n"); - err = TestValidateConstraintsOfAttributeColorMode_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Validate constraints of attribute: EnhancedCurrentHue\n"); + err = TestValidateConstraintsOfAttributeEnhancedCurrentHue_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Read the mandatory attribute: Options\n"); - err = TestReadTheMandatoryAttributeOptions_19(); + ChipLogProgress(chipTool, + " ***** Test Step 19 : Write the default values to mandatory attribute: EnhancedCurrentHue\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeEnhancedCurrentHue_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Validate constraints of attribute: Options\n"); - err = TestValidateConstraintsOfAttributeOptions_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : Reads back mandatory attribute: EnhancedCurrentHue\n"); + err = TestReadsBackMandatoryAttributeEnhancedCurrentHue_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Write the default values to mandatory attribute: Options\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeOptions_21(); + ChipLogProgress(chipTool, " ***** Test Step 21 : Validate constraints of attribute: EnhancedColorMode\n"); + err = TestValidateConstraintsOfAttributeEnhancedColorMode_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Reads back mandatory attribute: Options\n"); - err = TestReadsBackMandatoryAttributeOptions_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Validate constraints of attribute: ColorLoopActive\n"); + err = TestValidateConstraintsOfAttributeColorLoopActive_22(); break; case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Read the mandatory attribute: EnhancedCurrentHue\n"); - err = TestReadTheMandatoryAttributeEnhancedCurrentHue_23(); + ChipLogProgress(chipTool, " ***** Test Step 23 : Write the default values to mandatory attribute: ColorLoopActive\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopActive_23(); break; case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Validate constraints of attribute: EnhancedCurrentHue\n"); - err = TestValidateConstraintsOfAttributeEnhancedCurrentHue_24(); + ChipLogProgress(chipTool, " ***** Test Step 24 : Reads back mandatory attribute: ColorLoopActive\n"); + err = TestReadsBackMandatoryAttributeColorLoopActive_24(); break; case 25: - ChipLogProgress(chipTool, - " ***** Test Step 25 : Write the default values to mandatory attribute: EnhancedCurrentHue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeEnhancedCurrentHue_25(); + ChipLogProgress(chipTool, " ***** Test Step 25 : Validate constraints of attribute: ColorLoopDirection\n"); + err = TestValidateConstraintsOfAttributeColorLoopDirection_25(); break; case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Reads back mandatory attribute: EnhancedCurrentHue\n"); - err = TestReadsBackMandatoryAttributeEnhancedCurrentHue_26(); + ChipLogProgress(chipTool, + " ***** Test Step 26 : Write the default values to mandatory attribute: ColorLoopDirection\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopDirection_26(); break; case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Validate constraints of attribute: EnhancedColorMode\n"); - err = TestValidateConstraintsOfAttributeEnhancedColorMode_27(); + ChipLogProgress(chipTool, " ***** Test Step 27 : Reads back mandatory attribute: ColorLoopDirection\n"); + err = TestReadsBackMandatoryAttributeColorLoopDirection_27(); break; case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Read the mandatory attribute: ColorLoopActive\n"); - err = TestReadTheMandatoryAttributeColorLoopActive_28(); + ChipLogProgress(chipTool, " ***** Test Step 28 : Validate constraints of attribute: ColorLoopTime\n"); + err = TestValidateConstraintsOfAttributeColorLoopTime_28(); break; case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Validate constraints of attribute: ColorLoopActive\n"); - err = TestValidateConstraintsOfAttributeColorLoopActive_29(); + ChipLogProgress(chipTool, " ***** Test Step 29 : Write the default values to mandatory attribute: ColorLoopTime\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopTime_29(); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Write the default values to mandatory attribute: ColorLoopActive\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopActive_30(); + ChipLogProgress(chipTool, " ***** Test Step 30 : Reads back mandatory attribute: ColorLoopTime\n"); + err = TestReadsBackMandatoryAttributeColorLoopTime_30(); break; case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Reads back mandatory attribute: ColorLoopActive\n"); - err = TestReadsBackMandatoryAttributeColorLoopActive_31(); + ChipLogProgress(chipTool, " ***** Test Step 31 : Validate constraints of attribute: ColorLoopStartEnhancedHue\n"); + err = TestValidateConstraintsOfAttributeColorLoopStartEnhancedHue_31(); break; case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Read the mandatory attribute: ColorLoopDirection\n"); - err = TestReadTheMandatoryAttributeColorLoopDirection_32(); + ChipLogProgress(chipTool, + " ***** Test Step 32 : Write the default values to mandatory attribute: ColorLoopStartEnhancedHue\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStartEnhancedHue_32(); break; case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Validate constraints of attribute: ColorLoopDirection\n"); - err = TestValidateConstraintsOfAttributeColorLoopDirection_33(); + ChipLogProgress(chipTool, " ***** Test Step 33 : Reads back mandatory attribute: ColorLoopStartEnhancedHue\n"); + err = TestReadsBackMandatoryAttributeColorLoopStartEnhancedHue_33(); break; case 34: - ChipLogProgress(chipTool, - " ***** Test Step 34 : Write the default values to mandatory attribute: ColorLoopDirection\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopDirection_34(); + ChipLogProgress(chipTool, " ***** Test Step 34 : Validate constraints of attribute: ColorLoopStoredEnhancedHue\n"); + err = TestValidateConstraintsOfAttributeColorLoopStoredEnhancedHue_34(); break; case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Reads back mandatory attribute: ColorLoopDirection\n"); - err = TestReadsBackMandatoryAttributeColorLoopDirection_35(); + ChipLogProgress(chipTool, + " ***** Test Step 35 : Write the default values to mandatory attribute: ColorLoopStoredEnhancedHue\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStoredEnhancedHue_35(); break; case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Read the mandatory attribute: ColorLoopTime\n"); - err = TestReadTheMandatoryAttributeColorLoopTime_36(); + ChipLogProgress(chipTool, " ***** Test Step 36 : Reads back mandatory attribute: ColorLoopStoredEnhancedHue\n"); + err = TestReadsBackMandatoryAttributeColorLoopStoredEnhancedHue_36(); break; case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Validate constraints of attribute: ColorLoopTime\n"); - err = TestValidateConstraintsOfAttributeColorLoopTime_37(); + ChipLogProgress(chipTool, " ***** Test Step 37 : Validate constraints of attribute: ColorCapabilities\n"); + err = TestValidateConstraintsOfAttributeColorCapabilities_37(); break; case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Write the default values to mandatory attribute: ColorLoopTime\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopTime_38(); + ChipLogProgress(chipTool, " ***** Test Step 38 : Write the default values to mandatory attribute: ColorCapabilities\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeColorCapabilities_38(); break; case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Reads back mandatory attribute: ColorLoopTime\n"); - err = TestReadsBackMandatoryAttributeColorLoopTime_39(); + ChipLogProgress(chipTool, " ***** Test Step 39 : Reads back mandatory attribute: ColorCapabilities\n"); + err = TestReadsBackMandatoryAttributeColorCapabilities_39(); break; case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Read the mandatory attribute: ColorLoopStartEnhancedHue\n"); - err = TestReadTheMandatoryAttributeColorLoopStartEnhancedHue_40(); + ChipLogProgress(chipTool, " ***** Test Step 40 : Validate constraints of attribute: ColorTempPhysicalMinMireds\n"); + err = TestValidateConstraintsOfAttributeColorTempPhysicalMinMireds_40(); break; case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Validate constraints of attribute: ColorLoopStartEnhancedHue\n"); - err = TestValidateConstraintsOfAttributeColorLoopStartEnhancedHue_41(); + ChipLogProgress(chipTool, + " ***** Test Step 41 : Write the default values to mandatory attribute: ColorTempPhysicalMinMireds\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMinMireds_41(); break; case 42: - ChipLogProgress(chipTool, - " ***** Test Step 42 : Write the default values to mandatory attribute: ColorLoopStartEnhancedHue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStartEnhancedHue_42(); + ChipLogProgress(chipTool, " ***** Test Step 42 : Reads back mandatory attribute: ColorTempPhysicalMinMireds\n"); + err = TestReadsBackMandatoryAttributeColorTempPhysicalMinMireds_42(); break; case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Reads back mandatory attribute: ColorLoopStartEnhancedHue\n"); - err = TestReadsBackMandatoryAttributeColorLoopStartEnhancedHue_43(); + ChipLogProgress(chipTool, " ***** Test Step 43 : Validate constraints of attribute: ColorTempPhysicalMaxMireds\n"); + err = TestValidateConstraintsOfAttributeColorTempPhysicalMaxMireds_43(); break; case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Read the mandatory attribute: ColorLoopStoredEnhancedHue\n"); - err = TestReadTheMandatoryAttributeColorLoopStoredEnhancedHue_44(); + ChipLogProgress(chipTool, + " ***** Test Step 44 : Write the default values to mandatory attribute: ColorTempPhysicalMaxMireds\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMaxMireds_44(); break; case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Validate constraints of attribute: ColorLoopStoredEnhancedHue\n"); - err = TestValidateConstraintsOfAttributeColorLoopStoredEnhancedHue_45(); + ChipLogProgress(chipTool, " ***** Test Step 45 : Reads back mandatory attribute: ColorTempPhysicalMaxMireds\n"); + err = TestReadsBackMandatoryAttributeColorTempPhysicalMaxMireds_45(); break; case 46: - ChipLogProgress(chipTool, - " ***** Test Step 46 : Write the default values to mandatory attribute: ColorLoopStoredEnhancedHue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStoredEnhancedHue_46(); + ChipLogProgress(chipTool, " ***** Test Step 46 : Read the optional attribute: CoupleColorTempToLevelMinMireds\n"); + err = TestReadTheOptionalAttributeCoupleColorTempToLevelMinMireds_46(); break; case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Reads back mandatory attribute: ColorLoopStoredEnhancedHue\n"); - err = TestReadsBackMandatoryAttributeColorLoopStoredEnhancedHue_47(); + ChipLogProgress( + chipTool, + " ***** Test Step 47 : Write the default values to optional attribute: CoupleColorTempToLevelMinMireds\n"); + err = TestWriteTheDefaultValuesToOptionalAttributeCoupleColorTempToLevelMinMireds_47(); break; case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Read the mandatory attribute: ColorCapabilities\n"); - err = TestReadTheMandatoryAttributeColorCapabilities_48(); + ChipLogProgress(chipTool, " ***** Test Step 48 : Reads back optional attribute: CoupleColorTempToLevelMinMireds\n"); + err = TestReadsBackOptionalAttributeCoupleColorTempToLevelMinMireds_48(); break; case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Validate constraints of attribute: ColorCapabilities\n"); - err = TestValidateConstraintsOfAttributeColorCapabilities_49(); + ChipLogProgress(chipTool, " ***** Test Step 49 : Read the optional attribute: StartUpColorTemperatureMireds\n"); + err = TestReadTheOptionalAttributeStartUpColorTemperatureMireds_49(); break; case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Write the default values to mandatory attribute: ColorCapabilities\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorCapabilities_50(); + ChipLogProgress( + chipTool, " ***** Test Step 50 : Write the default values to optional attribute: StartUpColorTemperatureMireds\n"); + err = TestWriteTheDefaultValuesToOptionalAttributeStartUpColorTemperatureMireds_50(); break; case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Reads back mandatory attribute: ColorCapabilities\n"); - err = TestReadsBackMandatoryAttributeColorCapabilities_51(); + ChipLogProgress(chipTool, " ***** Test Step 51 : Reads back optional attribute: StartUpColorTemperatureMireds\n"); + err = TestReadsBackOptionalAttributeStartUpColorTemperatureMireds_51(); break; case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Read the mandatory attribute: ColorTempPhysicalMinMireds\n"); - err = TestReadTheMandatoryAttributeColorTempPhysicalMinMireds_52(); + ChipLogProgress(chipTool, " ***** Test Step 52 : Validate constraints of attribute: RemainingTime\n"); + err = TestValidateConstraintsOfAttributeRemainingTime_52(); break; case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Validate constraints of attribute: ColorTempPhysicalMinMireds\n"); - err = TestValidateConstraintsOfAttributeColorTempPhysicalMinMireds_53(); + ChipLogProgress(chipTool, " ***** Test Step 53 : Write the default values to optional attribute: RemainingTime\n"); + err = TestWriteTheDefaultValuesToOptionalAttributeRemainingTime_53(); break; case 54: - ChipLogProgress(chipTool, - " ***** Test Step 54 : Write the default values to mandatory attribute: ColorTempPhysicalMinMireds\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMinMireds_54(); + ChipLogProgress(chipTool, " ***** Test Step 54 : Reads back optional attribute: RemainingTime\n"); + err = TestReadsBackOptionalAttributeRemainingTime_54(); break; case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Reads back mandatory attribute: ColorTempPhysicalMinMireds\n"); - err = TestReadsBackMandatoryAttributeColorTempPhysicalMinMireds_55(); + ChipLogProgress(chipTool, " ***** Test Step 55 : Read the optional attribute: DriftCompensation\n"); + err = TestReadTheOptionalAttributeDriftCompensation_55(); break; case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Read the mandatory attribute: ColorTempPhysicalMaxMireds\n"); - err = TestReadTheMandatoryAttributeColorTempPhysicalMaxMireds_56(); + ChipLogProgress(chipTool, " ***** Test Step 56 : Write the default values to optional attribute: DriftCompensation\n"); + err = TestWriteTheDefaultValuesToOptionalAttributeDriftCompensation_56(); break; case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Validate constraints of attribute: ColorTempPhysicalMaxMireds\n"); - err = TestValidateConstraintsOfAttributeColorTempPhysicalMaxMireds_57(); + ChipLogProgress(chipTool, " ***** Test Step 57 : Reads back optional attribute: DriftCompensation\n"); + err = TestReadsBackOptionalAttributeDriftCompensation_57(); break; case 58: - ChipLogProgress(chipTool, - " ***** Test Step 58 : Write the default values to mandatory attribute: ColorTempPhysicalMaxMireds\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMaxMireds_58(); + ChipLogProgress(chipTool, " ***** Test Step 58 : Read the optional attribute: CompensationText\n"); + err = TestReadTheOptionalAttributeCompensationText_58(); break; case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Reads back mandatory attribute: ColorTempPhysicalMaxMireds\n"); - err = TestReadsBackMandatoryAttributeColorTempPhysicalMaxMireds_59(); + ChipLogProgress(chipTool, " ***** Test Step 59 : Write the default values to optional attribute: CompensationText\n"); + err = TestWriteTheDefaultValuesToOptionalAttributeCompensationText_59(); break; case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Read the optional attribute: CoupleColorTempToLevelMinMireds\n"); - err = TestReadTheOptionalAttributeCoupleColorTempToLevelMinMireds_60(); + ChipLogProgress(chipTool, " ***** Test Step 60 : Reads back optional attribute: CompensationText\n"); + err = TestReadsBackOptionalAttributeCompensationText_60(); break; case 61: - ChipLogProgress( - chipTool, - " ***** Test Step 61 : Write the default values to optional attribute: CoupleColorTempToLevelMinMireds\n"); - err = TestWriteTheDefaultValuesToOptionalAttributeCoupleColorTempToLevelMinMireds_61(); + ChipLogProgress(chipTool, " ***** Test Step 61 : Read the mandatory attribute: NumberOfPrimaries\n"); + err = TestReadTheMandatoryAttributeNumberOfPrimaries_61(); break; case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : Reads back optional attribute: CoupleColorTempToLevelMinMireds\n"); - err = TestReadsBackOptionalAttributeCoupleColorTempToLevelMinMireds_62(); + ChipLogProgress(chipTool, " ***** Test Step 62 : Write the default mandatory attribute: NumberOfPrimaries\n"); + err = TestWriteTheDefaultMandatoryAttributeNumberOfPrimaries_62(); break; case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Read the optional attribute: StartUpColorTemperatureMireds\n"); - err = TestReadTheOptionalAttributeStartUpColorTemperatureMireds_63(); + ChipLogProgress(chipTool, " ***** Test Step 63 : Read back the mandatory attribute: NumberOfPrimaries\n"); + err = TestReadBackTheMandatoryAttributeNumberOfPrimaries_63(); break; case 64: - ChipLogProgress( - chipTool, " ***** Test Step 64 : Write the default values to optional attribute: StartUpColorTemperatureMireds\n"); - err = TestWriteTheDefaultValuesToOptionalAttributeStartUpColorTemperatureMireds_64(); + ChipLogProgress(chipTool, " ***** Test Step 64 : Read the mandatory attribute: Primary1X\n"); + err = TestReadTheMandatoryAttributePrimary1X_64(); break; case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Reads back optional attribute: StartUpColorTemperatureMireds\n"); - err = TestReadsBackOptionalAttributeStartUpColorTemperatureMireds_65(); + ChipLogProgress(chipTool, " ***** Test Step 65 : Write the default mandatory attribute: Primary1X\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary1X_65(); break; case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : Read the Optional attribute: RemainingTime\n"); - err = TestReadTheOptionalAttributeRemainingTime_66(); + ChipLogProgress(chipTool, " ***** Test Step 66 : Read back the mandatory attribute: Primary1X\n"); + err = TestReadBackTheMandatoryAttributePrimary1X_66(); break; case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Validate constraints of attribute: RemainingTime\n"); - err = TestValidateConstraintsOfAttributeRemainingTime_67(); + ChipLogProgress(chipTool, " ***** Test Step 67 : Read the mandatory attribute: Primary1Y\n"); + err = TestReadTheMandatoryAttributePrimary1Y_67(); break; case 68: - ChipLogProgress(chipTool, " ***** Test Step 68 : Write the default values to optional attribute: RemainingTime\n"); - err = TestWriteTheDefaultValuesToOptionalAttributeRemainingTime_68(); + ChipLogProgress(chipTool, " ***** Test Step 68 : Write the default mandatory attribute: Primary1Y\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary1Y_68(); break; case 69: - ChipLogProgress(chipTool, " ***** Test Step 69 : Reads back optional attribute: RemainingTime\n"); - err = TestReadsBackOptionalAttributeRemainingTime_69(); + ChipLogProgress(chipTool, " ***** Test Step 69 : Read back the mandatory attribute: Primary1Y\n"); + err = TestReadBackTheMandatoryAttributePrimary1Y_69(); break; case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : Read the optional attribute: DriftCompensation\n"); - err = TestReadTheOptionalAttributeDriftCompensation_70(); + ChipLogProgress(chipTool, " ***** Test Step 70 : Read the mandatory attribute: Primary1Intensity\n"); + err = TestReadTheMandatoryAttributePrimary1Intensity_70(); break; case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Write the default values to optional attribute: DriftCompensation\n"); - err = TestWriteTheDefaultValuesToOptionalAttributeDriftCompensation_71(); + ChipLogProgress(chipTool, " ***** Test Step 71 : Read the mandatory attribute: Primary2X\n"); + err = TestReadTheMandatoryAttributePrimary2X_71(); break; case 72: - ChipLogProgress(chipTool, " ***** Test Step 72 : Reads back optional attribute: DriftCompensation\n"); - err = TestReadsBackOptionalAttributeDriftCompensation_72(); + ChipLogProgress(chipTool, " ***** Test Step 72 : Write the default mandatory attribute: Primary2X\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary2X_72(); break; case 73: - ChipLogProgress(chipTool, " ***** Test Step 73 : Read the optional attribute: CompensationText\n"); - err = TestReadTheOptionalAttributeCompensationText_73(); + ChipLogProgress(chipTool, " ***** Test Step 73 : Read back the mandatory attribute: Primary2X\n"); + err = TestReadBackTheMandatoryAttributePrimary2X_73(); break; case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Write the default values to optional attribute: CompensationText\n"); - err = TestWriteTheDefaultValuesToOptionalAttributeCompensationText_74(); + ChipLogProgress(chipTool, " ***** Test Step 74 : Read the mandatory attribute: Primary2Y\n"); + err = TestReadTheMandatoryAttributePrimary2Y_74(); break; case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Reads back optional attribute: CompensationText\n"); - err = TestReadsBackOptionalAttributeCompensationText_75(); + ChipLogProgress(chipTool, " ***** Test Step 75 : Write the default mandatory attribute: Primary2Y\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary2Y_75(); break; case 76: - ChipLogProgress(chipTool, " ***** Test Step 76 : Read the mandatory attribute: NumberOfPrimaries\n"); - err = TestReadTheMandatoryAttributeNumberOfPrimaries_76(); + ChipLogProgress(chipTool, " ***** Test Step 76 : Read back the mandatory attribute: Primary2Y\n"); + err = TestReadBackTheMandatoryAttributePrimary2Y_76(); break; case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Write the default mandatory attribute: NumberOfPrimaries\n"); - err = TestWriteTheDefaultMandatoryAttributeNumberOfPrimaries_77(); + ChipLogProgress(chipTool, " ***** Test Step 77 : Validate constraints of attribute: Primary2Intensity\n"); + err = TestValidateConstraintsOfAttributePrimary2Intensity_77(); break; case 78: - ChipLogProgress(chipTool, " ***** Test Step 78 : Read back the mandatory attribute: NumberOfPrimaries\n"); - err = TestReadBackTheMandatoryAttributeNumberOfPrimaries_78(); + ChipLogProgress(chipTool, " ***** Test Step 78 : Read the mandatory attribute: Primary3X\n"); + err = TestReadTheMandatoryAttributePrimary3X_78(); break; case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Read the mandatory attribute: Primary1X\n"); - err = TestReadTheMandatoryAttributePrimary1X_79(); + ChipLogProgress(chipTool, " ***** Test Step 79 : Write the default mandatory attribute: Primary3X\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary3X_79(); break; case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : Write the default mandatory attribute: Primary1X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary1X_80(); + ChipLogProgress(chipTool, " ***** Test Step 80 : Read back the mandatory attribute: Primary3X\n"); + err = TestReadBackTheMandatoryAttributePrimary3X_80(); break; case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Read back the mandatory attribute: Primary1X\n"); - err = TestReadBackTheMandatoryAttributePrimary1X_81(); + ChipLogProgress(chipTool, " ***** Test Step 81 : Read the mandatory attribute: Primary3Y\n"); + err = TestReadTheMandatoryAttributePrimary3Y_81(); break; case 82: - ChipLogProgress(chipTool, " ***** Test Step 82 : Read the mandatory attribute: Primary1Y\n"); - err = TestReadTheMandatoryAttributePrimary1Y_82(); + ChipLogProgress(chipTool, " ***** Test Step 82 : Write the default mandatory attribute: Primary3Y\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary3Y_82(); break; case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Write the default mandatory attribute: Primary1Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary1Y_83(); + ChipLogProgress(chipTool, " ***** Test Step 83 : Read back the mandatory attribute: Primary3Y\n"); + err = TestReadBackTheMandatoryAttributePrimary3Y_83(); break; case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : Read back the mandatory attribute: Primary1Y\n"); - err = TestReadBackTheMandatoryAttributePrimary1Y_84(); + ChipLogProgress(chipTool, " ***** Test Step 84 : Read the mandatory attribute: Primary3Intensity\n"); + err = TestReadTheMandatoryAttributePrimary3Intensity_84(); break; case 85: - ChipLogProgress(chipTool, " ***** Test Step 85 : Read the mandatory attribute: Primary1Intensity\n"); - err = TestReadTheMandatoryAttributePrimary1Intensity_85(); + ChipLogProgress(chipTool, " ***** Test Step 85 : Read the mandatory attribute: Primary4X\n"); + err = TestReadTheMandatoryAttributePrimary4X_85(); break; case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : Read the mandatory attribute: Primary2X\n"); - err = TestReadTheMandatoryAttributePrimary2X_86(); + ChipLogProgress(chipTool, " ***** Test Step 86 : Write the default mandatory attribute: Primary4X\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary4X_86(); break; case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Write the default mandatory attribute: Primary2X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary2X_87(); + ChipLogProgress(chipTool, " ***** Test Step 87 : Read back the mandatory attribute: Primary4X\n"); + err = TestReadBackTheMandatoryAttributePrimary4X_87(); break; case 88: - ChipLogProgress(chipTool, " ***** Test Step 88 : Read back the mandatory attribute: Primary2X\n"); - err = TestReadBackTheMandatoryAttributePrimary2X_88(); + ChipLogProgress(chipTool, " ***** Test Step 88 : Read the mandatory attribute: Primary4Y\n"); + err = TestReadTheMandatoryAttributePrimary4Y_88(); break; case 89: - ChipLogProgress(chipTool, " ***** Test Step 89 : Read the mandatory attribute: Primary2Y\n"); - err = TestReadTheMandatoryAttributePrimary2Y_89(); + ChipLogProgress(chipTool, " ***** Test Step 89 : Write the default mandatory attribute: Primary4Y\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary4Y_89(); break; case 90: - ChipLogProgress(chipTool, " ***** Test Step 90 : Write the default mandatory attribute: Primary2Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary2Y_90(); + ChipLogProgress(chipTool, " ***** Test Step 90 : Read back the mandatory attribute: Primary4Y\n"); + err = TestReadBackTheMandatoryAttributePrimary4Y_90(); break; case 91: - ChipLogProgress(chipTool, " ***** Test Step 91 : Read back the mandatory attribute: Primary2Y\n"); - err = TestReadBackTheMandatoryAttributePrimary2Y_91(); + ChipLogProgress(chipTool, " ***** Test Step 91 : Read the mandatory attribute: Primary4Intensity\n"); + err = TestReadTheMandatoryAttributePrimary4Intensity_91(); break; case 92: - ChipLogProgress(chipTool, " ***** Test Step 92 : Validate constraints of attribute: Primary2Intensity\n"); - err = TestValidateConstraintsOfAttributePrimary2Intensity_92(); + ChipLogProgress(chipTool, " ***** Test Step 92 : Read the mandatory attribute: Primary5X\n"); + err = TestReadTheMandatoryAttributePrimary5X_92(); break; case 93: - ChipLogProgress(chipTool, " ***** Test Step 93 : Read the mandatory attribute: Primary3X\n"); - err = TestReadTheMandatoryAttributePrimary3X_93(); + ChipLogProgress(chipTool, " ***** Test Step 93 : Write the default mandatory attribute: Primary5X\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary5X_93(); break; case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : Write the default mandatory attribute: Primary3X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary3X_94(); + ChipLogProgress(chipTool, " ***** Test Step 94 : Read back the mandatory attribute: Primary5X\n"); + err = TestReadBackTheMandatoryAttributePrimary5X_94(); break; case 95: - ChipLogProgress(chipTool, " ***** Test Step 95 : Read back the mandatory attribute: Primary3X\n"); - err = TestReadBackTheMandatoryAttributePrimary3X_95(); + ChipLogProgress(chipTool, " ***** Test Step 95 : Read the mandatory attribute: Primary5Y\n"); + err = TestReadTheMandatoryAttributePrimary5Y_95(); break; case 96: - ChipLogProgress(chipTool, " ***** Test Step 96 : Read the mandatory attribute: Primary3Y\n"); - err = TestReadTheMandatoryAttributePrimary3Y_96(); + ChipLogProgress(chipTool, " ***** Test Step 96 : Write the default mandatory attribute: Primary5Y\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary5Y_96(); break; case 97: - ChipLogProgress(chipTool, " ***** Test Step 97 : Write the default mandatory attribute: Primary3Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary3Y_97(); + ChipLogProgress(chipTool, " ***** Test Step 97 : Read back the mandatory attribute: Primary5Y\n"); + err = TestReadBackTheMandatoryAttributePrimary5Y_97(); break; case 98: - ChipLogProgress(chipTool, " ***** Test Step 98 : Read back the mandatory attribute: Primary3Y\n"); - err = TestReadBackTheMandatoryAttributePrimary3Y_98(); + ChipLogProgress(chipTool, " ***** Test Step 98 : Read the mandatory attribute: Primary5Intensity\n"); + err = TestReadTheMandatoryAttributePrimary5Intensity_98(); break; case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Read the mandatory attribute: Primary3Intensity\n"); - err = TestReadTheMandatoryAttributePrimary3Intensity_99(); + ChipLogProgress(chipTool, " ***** Test Step 99 : Read the mandatory attribute: Primary6X\n"); + err = TestReadTheMandatoryAttributePrimary6X_99(); break; case 100: - ChipLogProgress(chipTool, " ***** Test Step 100 : Read the mandatory attribute: Primary4X\n"); - err = TestReadTheMandatoryAttributePrimary4X_100(); + ChipLogProgress(chipTool, " ***** Test Step 100 : Write the default mandatory attribute: Primary6X\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary6X_100(); break; case 101: - ChipLogProgress(chipTool, " ***** Test Step 101 : Write the default mandatory attribute: Primary4X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary4X_101(); + ChipLogProgress(chipTool, " ***** Test Step 101 : Read back the mandatory attribute: Primary6X\n"); + err = TestReadBackTheMandatoryAttributePrimary6X_101(); break; case 102: - ChipLogProgress(chipTool, " ***** Test Step 102 : Read back the mandatory attribute: Primary4X\n"); - err = TestReadBackTheMandatoryAttributePrimary4X_102(); + ChipLogProgress(chipTool, " ***** Test Step 102 : Read the mandatory attribute: Primary6Y\n"); + err = TestReadTheMandatoryAttributePrimary6Y_102(); break; case 103: - ChipLogProgress(chipTool, " ***** Test Step 103 : Read the mandatory attribute: Primary4Y\n"); - err = TestReadTheMandatoryAttributePrimary4Y_103(); + ChipLogProgress(chipTool, " ***** Test Step 103 : Write the default mandatory attribute: Primary6Y\n"); + err = TestWriteTheDefaultMandatoryAttributePrimary6Y_103(); break; case 104: - ChipLogProgress(chipTool, " ***** Test Step 104 : Write the default mandatory attribute: Primary4Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary4Y_104(); + ChipLogProgress(chipTool, " ***** Test Step 104 : Read back the mandatory attribute: Primary6Y\n"); + err = TestReadBackTheMandatoryAttributePrimary6Y_104(); break; case 105: - ChipLogProgress(chipTool, " ***** Test Step 105 : Read back the mandatory attribute: Primary4Y\n"); - err = TestReadBackTheMandatoryAttributePrimary4Y_105(); + ChipLogProgress(chipTool, " ***** Test Step 105 : Read the mandatory attribute: Primary6Intensity\n"); + err = TestReadTheMandatoryAttributePrimary6Intensity_105(); break; case 106: - ChipLogProgress(chipTool, " ***** Test Step 106 : Read the mandatory attribute: Primary4Intensity\n"); - err = TestReadTheMandatoryAttributePrimary4Intensity_106(); + ChipLogProgress(chipTool, " ***** Test Step 106 : Read the optional attribute: WhitePointX\n"); + err = TestReadTheOptionalAttributeWhitePointX_106(); break; case 107: - ChipLogProgress(chipTool, " ***** Test Step 107 : Read the mandatory attribute: Primary5X\n"); - err = TestReadTheMandatoryAttributePrimary5X_107(); + ChipLogProgress(chipTool, " ***** Test Step 107 : Write the default optional attribute: WhitePointX\n"); + err = TestWriteTheDefaultOptionalAttributeWhitePointX_107(); break; case 108: - ChipLogProgress(chipTool, " ***** Test Step 108 : Write the default mandatory attribute: Primary5X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary5X_108(); + ChipLogProgress(chipTool, " ***** Test Step 108 : Read back the optional attribute: WhitePointX\n"); + err = TestReadBackTheOptionalAttributeWhitePointX_108(); break; case 109: - ChipLogProgress(chipTool, " ***** Test Step 109 : Read back the mandatory attribute: Primary5X\n"); - err = TestReadBackTheMandatoryAttributePrimary5X_109(); + ChipLogProgress(chipTool, " ***** Test Step 109 : Read the optional attribute: WhitePointY\n"); + err = TestReadTheOptionalAttributeWhitePointY_109(); break; case 110: - ChipLogProgress(chipTool, " ***** Test Step 110 : Read the mandatory attribute: Primary5Y\n"); - err = TestReadTheMandatoryAttributePrimary5Y_110(); + ChipLogProgress(chipTool, " ***** Test Step 110 : Write the default optional attribute: WhitePointY\n"); + err = TestWriteTheDefaultOptionalAttributeWhitePointY_110(); break; case 111: - ChipLogProgress(chipTool, " ***** Test Step 111 : Write the default mandatory attribute: Primary5Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary5Y_111(); + ChipLogProgress(chipTool, " ***** Test Step 111 : Read back the optional attribute: WhitePointY\n"); + err = TestReadBackTheOptionalAttributeWhitePointY_111(); break; case 112: - ChipLogProgress(chipTool, " ***** Test Step 112 : Read back the mandatory attribute: Primary5Y\n"); - err = TestReadBackTheMandatoryAttributePrimary5Y_112(); + ChipLogProgress(chipTool, " ***** Test Step 112 : Read the optional attribute: ColorPointRX\n"); + err = TestReadTheOptionalAttributeColorPointRX_112(); break; case 113: - ChipLogProgress(chipTool, " ***** Test Step 113 : Read the mandatory attribute: Primary5Intensity\n"); - err = TestReadTheMandatoryAttributePrimary5Intensity_113(); + ChipLogProgress(chipTool, " ***** Test Step 113 : Write the default optional attribute: ColorPointRX\n"); + err = TestWriteTheDefaultOptionalAttributeColorPointRX_113(); break; case 114: - ChipLogProgress(chipTool, " ***** Test Step 114 : Read the mandatory attribute: Primary6X\n"); - err = TestReadTheMandatoryAttributePrimary6X_114(); + ChipLogProgress(chipTool, " ***** Test Step 114 : Read back the optional attribute: ColorPointRX\n"); + err = TestReadBackTheOptionalAttributeColorPointRX_114(); break; case 115: - ChipLogProgress(chipTool, " ***** Test Step 115 : Write the default mandatory attribute: Primary6X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary6X_115(); + ChipLogProgress(chipTool, " ***** Test Step 115 : Read the optional attribute: ColorPointRY\n"); + err = TestReadTheOptionalAttributeColorPointRY_115(); break; case 116: - ChipLogProgress(chipTool, " ***** Test Step 116 : Read back the mandatory attribute: Primary6X\n"); - err = TestReadBackTheMandatoryAttributePrimary6X_116(); + ChipLogProgress(chipTool, " ***** Test Step 116 : Write the default optional attribute: ColorPointRY\n"); + err = TestWriteTheDefaultOptionalAttributeColorPointRY_116(); break; case 117: - ChipLogProgress(chipTool, " ***** Test Step 117 : Read the mandatory attribute: Primary6Y\n"); - err = TestReadTheMandatoryAttributePrimary6Y_117(); + ChipLogProgress(chipTool, " ***** Test Step 117 : Read back the optional attribute: ColorPointRY\n"); + err = TestReadBackTheOptionalAttributeColorPointRY_117(); break; case 118: - ChipLogProgress(chipTool, " ***** Test Step 118 : Write the default mandatory attribute: Primary6Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary6Y_118(); + ChipLogProgress(chipTool, " ***** Test Step 118 : Read the optional attribute: ColorPointRIntensity\n"); + err = TestReadTheOptionalAttributeColorPointRIntensity_118(); break; case 119: - ChipLogProgress(chipTool, " ***** Test Step 119 : Read back the mandatory attribute: Primary6Y\n"); - err = TestReadBackTheMandatoryAttributePrimary6Y_119(); + ChipLogProgress(chipTool, " ***** Test Step 119 : Write the default optional attribute: ColorPointRIntensity\n"); + err = TestWriteTheDefaultOptionalAttributeColorPointRIntensity_119(); break; case 120: - ChipLogProgress(chipTool, " ***** Test Step 120 : Read the mandatory attribute: Primary6Intensity\n"); - err = TestReadTheMandatoryAttributePrimary6Intensity_120(); + ChipLogProgress(chipTool, " ***** Test Step 120 : Read back the optional attribute: ColorPointRIntensity\n"); + err = TestReadBackTheOptionalAttributeColorPointRIntensity_120(); break; case 121: - ChipLogProgress(chipTool, " ***** Test Step 121 : Read the optional attribute: WhitePointX\n"); - err = TestReadTheOptionalAttributeWhitePointX_121(); + ChipLogProgress(chipTool, " ***** Test Step 121 : Read the optional attribute: ColorPointGX\n"); + err = TestReadTheOptionalAttributeColorPointGX_121(); break; case 122: - ChipLogProgress(chipTool, " ***** Test Step 122 : Write the default optional attribute: WhitePointX\n"); - err = TestWriteTheDefaultOptionalAttributeWhitePointX_122(); + ChipLogProgress(chipTool, " ***** Test Step 122 : Write the default optional attribute: ColorPointGX\n"); + err = TestWriteTheDefaultOptionalAttributeColorPointGX_122(); break; case 123: - ChipLogProgress(chipTool, " ***** Test Step 123 : Read back the optional attribute: WhitePointX\n"); - err = TestReadBackTheOptionalAttributeWhitePointX_123(); + ChipLogProgress(chipTool, " ***** Test Step 123 : Read back the optional attribute: ColorPointGX\n"); + err = TestReadBackTheOptionalAttributeColorPointGX_123(); break; case 124: - ChipLogProgress(chipTool, " ***** Test Step 124 : Read the optional attribute: WhitePointY\n"); - err = TestReadTheOptionalAttributeWhitePointY_124(); + ChipLogProgress(chipTool, " ***** Test Step 124 : Read the optional attribute: ColorPointGY\n"); + err = TestReadTheOptionalAttributeColorPointGY_124(); break; case 125: - ChipLogProgress(chipTool, " ***** Test Step 125 : Write the default optional attribute: WhitePointY\n"); - err = TestWriteTheDefaultOptionalAttributeWhitePointY_125(); + ChipLogProgress(chipTool, " ***** Test Step 125 : Write the default optional attribute: ColorPointGY\n"); + err = TestWriteTheDefaultOptionalAttributeColorPointGY_125(); break; case 126: - ChipLogProgress(chipTool, " ***** Test Step 126 : Read back the optional attribute: WhitePointY\n"); - err = TestReadBackTheOptionalAttributeWhitePointY_126(); + ChipLogProgress(chipTool, " ***** Test Step 126 : Read back the optional attribute: ColorPointGY\n"); + err = TestReadBackTheOptionalAttributeColorPointGY_126(); break; case 127: - ChipLogProgress(chipTool, " ***** Test Step 127 : Read the optional attribute: ColorPointRX\n"); - err = TestReadTheOptionalAttributeColorPointRX_127(); + ChipLogProgress(chipTool, " ***** Test Step 127 : Read the optional attribute: ColorPointGIntensity\n"); + err = TestReadTheOptionalAttributeColorPointGIntensity_127(); break; case 128: - ChipLogProgress(chipTool, " ***** Test Step 128 : Write the default optional attribute: ColorPointRX\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointRX_128(); + ChipLogProgress(chipTool, " ***** Test Step 128 : Write the default optional attribute: ColorPointGIntensity\n"); + err = TestWriteTheDefaultOptionalAttributeColorPointGIntensity_128(); break; case 129: - ChipLogProgress(chipTool, " ***** Test Step 129 : Read back the optional attribute: ColorPointRX\n"); - err = TestReadBackTheOptionalAttributeColorPointRX_129(); + ChipLogProgress(chipTool, " ***** Test Step 129 : Read back the optional attribute: ColorPointGIntensity\n"); + err = TestReadBackTheOptionalAttributeColorPointGIntensity_129(); break; case 130: - ChipLogProgress(chipTool, " ***** Test Step 130 : Read the optional attribute: ColorPointRY\n"); - err = TestReadTheOptionalAttributeColorPointRY_130(); + ChipLogProgress(chipTool, " ***** Test Step 130 : Read the optional attribute: ColorPointBX\n"); + err = TestReadTheOptionalAttributeColorPointBX_130(); break; case 131: - ChipLogProgress(chipTool, " ***** Test Step 131 : Write the default optional attribute: ColorPointRY\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointRY_131(); + ChipLogProgress(chipTool, " ***** Test Step 131 : Write the default optional attribute: ColorPointBX\n"); + err = TestWriteTheDefaultOptionalAttributeColorPointBX_131(); break; case 132: - ChipLogProgress(chipTool, " ***** Test Step 132 : Read back the optional attribute: ColorPointRY\n"); - err = TestReadBackTheOptionalAttributeColorPointRY_132(); + ChipLogProgress(chipTool, " ***** Test Step 132 : Read back the optional attribute: ColorPointBX\n"); + err = TestReadBackTheOptionalAttributeColorPointBX_132(); break; case 133: - ChipLogProgress(chipTool, " ***** Test Step 133 : Read the optional attribute: ColorPointRIntensity\n"); - err = TestReadTheOptionalAttributeColorPointRIntensity_133(); + ChipLogProgress(chipTool, " ***** Test Step 133 : Read the optional attribute: ColorPointBY\n"); + err = TestReadTheOptionalAttributeColorPointBY_133(); break; case 134: - ChipLogProgress(chipTool, " ***** Test Step 134 : Write the default optional attribute: ColorPointRIntensity\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointRIntensity_134(); + ChipLogProgress(chipTool, " ***** Test Step 134 : Write the default optional attribute: ColorPointBY\n"); + err = TestWriteTheDefaultOptionalAttributeColorPointBY_134(); break; case 135: - ChipLogProgress(chipTool, " ***** Test Step 135 : Read back the optional attribute: ColorPointRIntensity\n"); - err = TestReadBackTheOptionalAttributeColorPointRIntensity_135(); + ChipLogProgress(chipTool, " ***** Test Step 135 : Read back the optional attribute: ColorPointBY\n"); + err = TestReadBackTheOptionalAttributeColorPointBY_135(); break; case 136: - ChipLogProgress(chipTool, " ***** Test Step 136 : Read the optional attribute: ColorPointGX\n"); - err = TestReadTheOptionalAttributeColorPointGX_136(); + ChipLogProgress(chipTool, " ***** Test Step 136 : Read the optional attribute: ColorPointBIntensity\n"); + err = TestReadTheOptionalAttributeColorPointBIntensity_136(); break; case 137: - ChipLogProgress(chipTool, " ***** Test Step 137 : Write the default optional attribute: ColorPointGX\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointGX_137(); + ChipLogProgress(chipTool, " ***** Test Step 137 : Write the default optional attribute: ColorPointBIntensity\n"); + err = TestWriteTheDefaultOptionalAttributeColorPointBIntensity_137(); break; case 138: - ChipLogProgress(chipTool, " ***** Test Step 138 : Read back the optional attribute: ColorPointGX\n"); - err = TestReadBackTheOptionalAttributeColorPointGX_138(); - break; - case 139: - ChipLogProgress(chipTool, " ***** Test Step 139 : Read the optional attribute: ColorPointGY\n"); - err = TestReadTheOptionalAttributeColorPointGY_139(); - break; - case 140: - ChipLogProgress(chipTool, " ***** Test Step 140 : Write the default optional attribute: ColorPointGY\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointGY_140(); - break; - case 141: - ChipLogProgress(chipTool, " ***** Test Step 141 : Read back the optional attribute: ColorPointGY\n"); - err = TestReadBackTheOptionalAttributeColorPointGY_141(); - break; - case 142: - ChipLogProgress(chipTool, " ***** Test Step 142 : Read the optional attribute: ColorPointGIntensity\n"); - err = TestReadTheOptionalAttributeColorPointGIntensity_142(); - break; - case 143: - ChipLogProgress(chipTool, " ***** Test Step 143 : Write the default optional attribute: ColorPointGIntensity\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointGIntensity_143(); - break; - case 144: - ChipLogProgress(chipTool, " ***** Test Step 144 : Read back the optional attribute: ColorPointGIntensity\n"); - err = TestReadBackTheOptionalAttributeColorPointGIntensity_144(); - break; - case 145: - ChipLogProgress(chipTool, " ***** Test Step 145 : Read the optional attribute: ColorPointBX\n"); - err = TestReadTheOptionalAttributeColorPointBX_145(); - break; - case 146: - ChipLogProgress(chipTool, " ***** Test Step 146 : Write the default optional attribute: ColorPointBX\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointBX_146(); - break; - case 147: - ChipLogProgress(chipTool, " ***** Test Step 147 : Read back the optional attribute: ColorPointBX\n"); - err = TestReadBackTheOptionalAttributeColorPointBX_147(); - break; - case 148: - ChipLogProgress(chipTool, " ***** Test Step 148 : Read the optional attribute: ColorPointBY\n"); - err = TestReadTheOptionalAttributeColorPointBY_148(); - break; - case 149: - ChipLogProgress(chipTool, " ***** Test Step 149 : Write the default optional attribute: ColorPointBY\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointBY_149(); - break; - case 150: - ChipLogProgress(chipTool, " ***** Test Step 150 : Read back the optional attribute: ColorPointBY\n"); - err = TestReadBackTheOptionalAttributeColorPointBY_150(); - break; - case 151: - ChipLogProgress(chipTool, " ***** Test Step 151 : Read the optional attribute: ColorPointBIntensity\n"); - err = TestReadTheOptionalAttributeColorPointBIntensity_151(); - break; - case 152: - ChipLogProgress(chipTool, " ***** Test Step 152 : Write the default optional attribute: ColorPointBIntensity\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointBIntensity_152(); - break; - case 153: - ChipLogProgress(chipTool, " ***** Test Step 153 : Read back the optional attribute: ColorPointBIntensity\n"); - err = TestReadBackTheOptionalAttributeColorPointBIntensity_153(); + ChipLogProgress(chipTool, " ***** Test Step 138 : Read back the optional attribute: ColorPointBIntensity\n"); + err = TestReadBackTheOptionalAttributeColorPointBIntensity_138(); break; } @@ -4438,7 +4380,7 @@ class Test_TC_CC_2_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 154; + const uint16_t mTestCount = 139; chip::Optional mNodeId; chip::Optional mCluster; @@ -4467,26 +4409,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context, uint8_t currentHue) - { - (static_cast(context))->OnSuccessResponse_2(currentHue); - } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + static void OnSuccessCallback_3(void * context, uint8_t currentHue) + { + (static_cast(context))->OnSuccessResponse_3(currentHue); + } static void OnFailureCallback_4(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_4(error); } - static void OnSuccessCallback_4(void * context, uint8_t currentHue) + static void OnSuccessCallback_4(void * context, uint8_t currentSaturation) { - (static_cast(context))->OnSuccessResponse_4(currentHue); + (static_cast(context))->OnSuccessResponse_4(currentSaturation); } static void OnFailureCallback_5(void * context, CHIP_ERROR error) @@ -4494,10 +4436,7 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_5(error); } - static void OnSuccessCallback_5(void * context, uint8_t currentSaturation) - { - (static_cast(context))->OnSuccessResponse_5(currentSaturation); - } + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } static void OnFailureCallback_6(void * context, CHIP_ERROR error) { @@ -4514,17 +4453,17 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_7(error); } - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + static void OnSuccessCallback_7(void * context, uint16_t currentX) + { + (static_cast(context))->OnSuccessResponse_7(currentX); + } static void OnFailureCallback_8(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_8(error); } - static void OnSuccessCallback_8(void * context, uint8_t currentSaturation) - { - (static_cast(context))->OnSuccessResponse_8(currentSaturation); - } + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } static void OnFailureCallback_9(void * context, CHIP_ERROR error) { @@ -4541,9 +4480,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_10(error); } - static void OnSuccessCallback_10(void * context, uint16_t currentX) + static void OnSuccessCallback_10(void * context, uint16_t currentY) { - (static_cast(context))->OnSuccessResponse_10(currentX); + (static_cast(context))->OnSuccessResponse_10(currentY); } static void OnFailureCallback_11(void * context, CHIP_ERROR error) @@ -4558,9 +4497,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_12(error); } - static void OnSuccessCallback_12(void * context, uint16_t currentX) + static void OnSuccessCallback_12(void * context, uint16_t currentY) { - (static_cast(context))->OnSuccessResponse_12(currentX); + (static_cast(context))->OnSuccessResponse_12(currentY); } static void OnFailureCallback_13(void * context, CHIP_ERROR error) @@ -4568,9 +4507,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_13(error); } - static void OnSuccessCallback_13(void * context, uint16_t currentY) + static void OnSuccessCallback_13(void * context, uint16_t colorTemperature) { - (static_cast(context))->OnSuccessResponse_13(currentY); + (static_cast(context))->OnSuccessResponse_13(colorTemperature); } static void OnFailureCallback_14(void * context, CHIP_ERROR error) @@ -4578,9 +4517,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_14(error); } - static void OnSuccessCallback_14(void * context, uint16_t currentY) + static void OnSuccessCallback_14(void * context, uint8_t colorMode) { - (static_cast(context))->OnSuccessResponse_14(currentY); + (static_cast(context))->OnSuccessResponse_14(colorMode); } static void OnFailureCallback_15(void * context, CHIP_ERROR error) @@ -4588,26 +4527,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_15(error); } - static void OnSuccessCallback_15(void * context) { (static_cast(context))->OnSuccessResponse_15(); } + static void OnSuccessCallback_15(void * context, uint8_t colorControlOptions) + { + (static_cast(context))->OnSuccessResponse_15(colorControlOptions); + } static void OnFailureCallback_16(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_16(error); } - static void OnSuccessCallback_16(void * context, uint16_t currentY) - { - (static_cast(context))->OnSuccessResponse_16(currentY); - } + static void OnSuccessCallback_16(void * context) { (static_cast(context))->OnSuccessResponse_16(); } static void OnFailureCallback_17(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_17(error); } - static void OnSuccessCallback_17(void * context, uint16_t colorTemperature) + static void OnSuccessCallback_17(void * context, uint8_t colorControlOptions) { - (static_cast(context))->OnSuccessResponse_17(colorTemperature); + (static_cast(context))->OnSuccessResponse_17(colorControlOptions); } static void OnFailureCallback_18(void * context, CHIP_ERROR error) @@ -4615,9 +4554,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_18(error); } - static void OnSuccessCallback_18(void * context, uint8_t colorMode) + static void OnSuccessCallback_18(void * context, uint16_t enhancedCurrentHue) { - (static_cast(context))->OnSuccessResponse_18(colorMode); + (static_cast(context))->OnSuccessResponse_18(enhancedCurrentHue); } static void OnFailureCallback_19(void * context, CHIP_ERROR error) @@ -4625,19 +4564,16 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_19(error); } - static void OnSuccessCallback_19(void * context, uint8_t colorControlOptions) - { - (static_cast(context))->OnSuccessResponse_19(colorControlOptions); - } + static void OnSuccessCallback_19(void * context) { (static_cast(context))->OnSuccessResponse_19(); } static void OnFailureCallback_20(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_20(error); } - static void OnSuccessCallback_20(void * context, uint8_t colorControlOptions) + static void OnSuccessCallback_20(void * context, uint16_t enhancedCurrentHue) { - (static_cast(context))->OnSuccessResponse_20(colorControlOptions); + (static_cast(context))->OnSuccessResponse_20(enhancedCurrentHue); } static void OnFailureCallback_21(void * context, CHIP_ERROR error) @@ -4645,16 +4581,19 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_21(error); } - static void OnSuccessCallback_21(void * context) { (static_cast(context))->OnSuccessResponse_21(); } + static void OnSuccessCallback_21(void * context, uint8_t enhancedColorMode) + { + (static_cast(context))->OnSuccessResponse_21(enhancedColorMode); + } static void OnFailureCallback_22(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_22(error); } - static void OnSuccessCallback_22(void * context, uint8_t colorControlOptions) + static void OnSuccessCallback_22(void * context, uint8_t colorLoopActive) { - (static_cast(context))->OnSuccessResponse_22(colorControlOptions); + (static_cast(context))->OnSuccessResponse_22(colorLoopActive); } static void OnFailureCallback_23(void * context, CHIP_ERROR error) @@ -4662,19 +4601,16 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_23(error); } - static void OnSuccessCallback_23(void * context, uint16_t enhancedCurrentHue) - { - (static_cast(context))->OnSuccessResponse_23(enhancedCurrentHue); - } + static void OnSuccessCallback_23(void * context) { (static_cast(context))->OnSuccessResponse_23(); } static void OnFailureCallback_24(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_24(error); } - static void OnSuccessCallback_24(void * context, uint16_t enhancedCurrentHue) + static void OnSuccessCallback_24(void * context, uint8_t colorLoopActive) { - (static_cast(context))->OnSuccessResponse_24(enhancedCurrentHue); + (static_cast(context))->OnSuccessResponse_24(colorLoopActive); } static void OnFailureCallback_25(void * context, CHIP_ERROR error) @@ -4682,26 +4618,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_25(error); } - static void OnSuccessCallback_25(void * context) { (static_cast(context))->OnSuccessResponse_25(); } + static void OnSuccessCallback_25(void * context, uint8_t colorLoopDirection) + { + (static_cast(context))->OnSuccessResponse_25(colorLoopDirection); + } static void OnFailureCallback_26(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_26(error); } - static void OnSuccessCallback_26(void * context, uint16_t enhancedCurrentHue) - { - (static_cast(context))->OnSuccessResponse_26(enhancedCurrentHue); - } + static void OnSuccessCallback_26(void * context) { (static_cast(context))->OnSuccessResponse_26(); } static void OnFailureCallback_27(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_27(error); } - static void OnSuccessCallback_27(void * context, uint8_t enhancedColorMode) + static void OnSuccessCallback_27(void * context, uint8_t colorLoopDirection) { - (static_cast(context))->OnSuccessResponse_27(enhancedColorMode); + (static_cast(context))->OnSuccessResponse_27(colorLoopDirection); } static void OnFailureCallback_28(void * context, CHIP_ERROR error) @@ -4709,9 +4645,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_28(error); } - static void OnSuccessCallback_28(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_28(void * context, uint16_t colorLoopTime) { - (static_cast(context))->OnSuccessResponse_28(colorLoopActive); + (static_cast(context))->OnSuccessResponse_28(colorLoopTime); } static void OnFailureCallback_29(void * context, CHIP_ERROR error) @@ -4719,26 +4655,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_29(error); } - static void OnSuccessCallback_29(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_29(colorLoopActive); - } + static void OnSuccessCallback_29(void * context) { (static_cast(context))->OnSuccessResponse_29(); } static void OnFailureCallback_30(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_30(error); } - static void OnSuccessCallback_30(void * context) { (static_cast(context))->OnSuccessResponse_30(); } + static void OnSuccessCallback_30(void * context, uint16_t colorLoopTime) + { + (static_cast(context))->OnSuccessResponse_30(colorLoopTime); + } static void OnFailureCallback_31(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_31(error); } - static void OnSuccessCallback_31(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_31(void * context, uint16_t colorLoopStartEnhancedHue) { - (static_cast(context))->OnSuccessResponse_31(colorLoopActive); + (static_cast(context))->OnSuccessResponse_31(colorLoopStartEnhancedHue); } static void OnFailureCallback_32(void * context, CHIP_ERROR error) @@ -4746,19 +4682,16 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_32(error); } - static void OnSuccessCallback_32(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_32(colorLoopDirection); - } + static void OnSuccessCallback_32(void * context) { (static_cast(context))->OnSuccessResponse_32(); } static void OnFailureCallback_33(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_33(error); } - static void OnSuccessCallback_33(void * context, uint8_t colorLoopDirection) + static void OnSuccessCallback_33(void * context, uint16_t colorLoopStartEnhancedHue) { - (static_cast(context))->OnSuccessResponse_33(colorLoopDirection); + (static_cast(context))->OnSuccessResponse_33(colorLoopStartEnhancedHue); } static void OnFailureCallback_34(void * context, CHIP_ERROR error) @@ -4766,26 +4699,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_34(error); } - static void OnSuccessCallback_34(void * context) { (static_cast(context))->OnSuccessResponse_34(); } + static void OnSuccessCallback_34(void * context, uint16_t colorLoopStoredEnhancedHue) + { + (static_cast(context))->OnSuccessResponse_34(colorLoopStoredEnhancedHue); + } static void OnFailureCallback_35(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_35(error); } - static void OnSuccessCallback_35(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_35(colorLoopDirection); - } + static void OnSuccessCallback_35(void * context) { (static_cast(context))->OnSuccessResponse_35(); } static void OnFailureCallback_36(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_36(error); } - static void OnSuccessCallback_36(void * context, uint16_t colorLoopTime) + static void OnSuccessCallback_36(void * context, uint16_t colorLoopStoredEnhancedHue) { - (static_cast(context))->OnSuccessResponse_36(colorLoopTime); + (static_cast(context))->OnSuccessResponse_36(colorLoopStoredEnhancedHue); } static void OnFailureCallback_37(void * context, CHIP_ERROR error) @@ -4793,9 +4726,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_37(error); } - static void OnSuccessCallback_37(void * context, uint16_t colorLoopTime) + static void OnSuccessCallback_37(void * context, uint16_t colorCapabilities) { - (static_cast(context))->OnSuccessResponse_37(colorLoopTime); + (static_cast(context))->OnSuccessResponse_37(colorCapabilities); } static void OnFailureCallback_38(void * context, CHIP_ERROR error) @@ -4810,9 +4743,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_39(error); } - static void OnSuccessCallback_39(void * context, uint16_t colorLoopTime) + static void OnSuccessCallback_39(void * context, uint16_t colorCapabilities) { - (static_cast(context))->OnSuccessResponse_39(colorLoopTime); + (static_cast(context))->OnSuccessResponse_39(colorCapabilities); } static void OnFailureCallback_40(void * context, CHIP_ERROR error) @@ -4820,9 +4753,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_40(error); } - static void OnSuccessCallback_40(void * context, uint16_t colorLoopStartEnhancedHue) + static void OnSuccessCallback_40(void * context, uint16_t colorTempPhysicalMin) { - (static_cast(context))->OnSuccessResponse_40(colorLoopStartEnhancedHue); + (static_cast(context))->OnSuccessResponse_40(colorTempPhysicalMin); } static void OnFailureCallback_41(void * context, CHIP_ERROR error) @@ -4830,26 +4763,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_41(error); } - static void OnSuccessCallback_41(void * context, uint16_t colorLoopStartEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_41(colorLoopStartEnhancedHue); - } + static void OnSuccessCallback_41(void * context) { (static_cast(context))->OnSuccessResponse_41(); } static void OnFailureCallback_42(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_42(error); } - static void OnSuccessCallback_42(void * context) { (static_cast(context))->OnSuccessResponse_42(); } + static void OnSuccessCallback_42(void * context, uint16_t colorTempPhysicalMin) + { + (static_cast(context))->OnSuccessResponse_42(colorTempPhysicalMin); + } static void OnFailureCallback_43(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_43(error); } - static void OnSuccessCallback_43(void * context, uint16_t colorLoopStartEnhancedHue) + static void OnSuccessCallback_43(void * context, uint16_t colorTempPhysicalMax) { - (static_cast(context))->OnSuccessResponse_43(colorLoopStartEnhancedHue); + (static_cast(context))->OnSuccessResponse_43(colorTempPhysicalMax); } static void OnFailureCallback_44(void * context, CHIP_ERROR error) @@ -4857,19 +4790,16 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_44(error); } - static void OnSuccessCallback_44(void * context, uint16_t colorLoopStoredEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_44(colorLoopStoredEnhancedHue); - } + static void OnSuccessCallback_44(void * context) { (static_cast(context))->OnSuccessResponse_44(); } static void OnFailureCallback_45(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_45(error); } - static void OnSuccessCallback_45(void * context, uint16_t colorLoopStoredEnhancedHue) + static void OnSuccessCallback_45(void * context, uint16_t colorTempPhysicalMax) { - (static_cast(context))->OnSuccessResponse_45(colorLoopStoredEnhancedHue); + (static_cast(context))->OnSuccessResponse_45(colorTempPhysicalMax); } static void OnFailureCallback_46(void * context, CHIP_ERROR error) @@ -4877,26 +4807,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_46(error); } - static void OnSuccessCallback_46(void * context) { (static_cast(context))->OnSuccessResponse_46(); } + static void OnSuccessCallback_46(void * context, uint16_t coupleColorTempToLevelMinMireds) + { + (static_cast(context))->OnSuccessResponse_46(coupleColorTempToLevelMinMireds); + } static void OnFailureCallback_47(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_47(error); } - static void OnSuccessCallback_47(void * context, uint16_t colorLoopStoredEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_47(colorLoopStoredEnhancedHue); - } + static void OnSuccessCallback_47(void * context) { (static_cast(context))->OnSuccessResponse_47(); } static void OnFailureCallback_48(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_48(error); } - static void OnSuccessCallback_48(void * context, uint16_t colorCapabilities) + static void OnSuccessCallback_48(void * context, uint16_t coupleColorTempToLevelMinMireds) { - (static_cast(context))->OnSuccessResponse_48(colorCapabilities); + (static_cast(context))->OnSuccessResponse_48(coupleColorTempToLevelMinMireds); } static void OnFailureCallback_49(void * context, CHIP_ERROR error) @@ -4904,9 +4834,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_49(error); } - static void OnSuccessCallback_49(void * context, uint16_t colorCapabilities) + static void OnSuccessCallback_49(void * context, uint16_t startUpColorTemperatureMireds) { - (static_cast(context))->OnSuccessResponse_49(colorCapabilities); + (static_cast(context))->OnSuccessResponse_49(startUpColorTemperatureMireds); } static void OnFailureCallback_50(void * context, CHIP_ERROR error) @@ -4921,9 +4851,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_51(error); } - static void OnSuccessCallback_51(void * context, uint16_t colorCapabilities) + static void OnSuccessCallback_51(void * context, uint16_t startUpColorTemperatureMireds) { - (static_cast(context))->OnSuccessResponse_51(colorCapabilities); + (static_cast(context))->OnSuccessResponse_51(startUpColorTemperatureMireds); } static void OnFailureCallback_52(void * context, CHIP_ERROR error) @@ -4931,9 +4861,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_52(error); } - static void OnSuccessCallback_52(void * context, uint16_t colorTempPhysicalMin) + static void OnSuccessCallback_52(void * context, uint16_t remainingTime) { - (static_cast(context))->OnSuccessResponse_52(colorTempPhysicalMin); + (static_cast(context))->OnSuccessResponse_52(remainingTime); } static void OnFailureCallback_53(void * context, CHIP_ERROR error) @@ -4941,26 +4871,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_53(error); } - static void OnSuccessCallback_53(void * context, uint16_t colorTempPhysicalMin) - { - (static_cast(context))->OnSuccessResponse_53(colorTempPhysicalMin); - } + static void OnSuccessCallback_53(void * context) { (static_cast(context))->OnSuccessResponse_53(); } static void OnFailureCallback_54(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_54(error); } - static void OnSuccessCallback_54(void * context) { (static_cast(context))->OnSuccessResponse_54(); } + static void OnSuccessCallback_54(void * context, uint16_t remainingTime) + { + (static_cast(context))->OnSuccessResponse_54(remainingTime); + } static void OnFailureCallback_55(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_55(error); } - static void OnSuccessCallback_55(void * context, uint16_t colorTempPhysicalMin) + static void OnSuccessCallback_55(void * context, uint8_t driftCompensation) { - (static_cast(context))->OnSuccessResponse_55(colorTempPhysicalMin); + (static_cast(context))->OnSuccessResponse_55(driftCompensation); } static void OnFailureCallback_56(void * context, CHIP_ERROR error) @@ -4968,19 +4898,16 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_56(error); } - static void OnSuccessCallback_56(void * context, uint16_t colorTempPhysicalMax) - { - (static_cast(context))->OnSuccessResponse_56(colorTempPhysicalMax); - } + static void OnSuccessCallback_56(void * context) { (static_cast(context))->OnSuccessResponse_56(); } static void OnFailureCallback_57(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_57(error); } - static void OnSuccessCallback_57(void * context, uint16_t colorTempPhysicalMax) + static void OnSuccessCallback_57(void * context, uint8_t driftCompensation) { - (static_cast(context))->OnSuccessResponse_57(colorTempPhysicalMax); + (static_cast(context))->OnSuccessResponse_57(driftCompensation); } static void OnFailureCallback_58(void * context, CHIP_ERROR error) @@ -4988,26 +4915,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_58(error); } - static void OnSuccessCallback_58(void * context) { (static_cast(context))->OnSuccessResponse_58(); } + static void OnSuccessCallback_58(void * context, chip::CharSpan compensationText) + { + (static_cast(context))->OnSuccessResponse_58(compensationText); + } static void OnFailureCallback_59(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_59(error); } - static void OnSuccessCallback_59(void * context, uint16_t colorTempPhysicalMax) - { - (static_cast(context))->OnSuccessResponse_59(colorTempPhysicalMax); - } + static void OnSuccessCallback_59(void * context) { (static_cast(context))->OnSuccessResponse_59(); } static void OnFailureCallback_60(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_60(error); } - static void OnSuccessCallback_60(void * context, uint16_t coupleColorTempToLevelMinMireds) + static void OnSuccessCallback_60(void * context, chip::CharSpan compensationText) { - (static_cast(context))->OnSuccessResponse_60(coupleColorTempToLevelMinMireds); + (static_cast(context))->OnSuccessResponse_60(compensationText); } static void OnFailureCallback_61(void * context, CHIP_ERROR error) @@ -5015,26 +4942,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_61(error); } - static void OnSuccessCallback_61(void * context) { (static_cast(context))->OnSuccessResponse_61(); } + static void OnSuccessCallback_61(void * context, uint8_t numberOfPrimaries) + { + (static_cast(context))->OnSuccessResponse_61(numberOfPrimaries); + } static void OnFailureCallback_62(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_62(error); } - static void OnSuccessCallback_62(void * context, uint16_t coupleColorTempToLevelMinMireds) - { - (static_cast(context))->OnSuccessResponse_62(coupleColorTempToLevelMinMireds); - } + static void OnSuccessCallback_62(void * context) { (static_cast(context))->OnSuccessResponse_62(); } static void OnFailureCallback_63(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_63(error); } - static void OnSuccessCallback_63(void * context, uint16_t startUpColorTemperatureMireds) + static void OnSuccessCallback_63(void * context, uint8_t numberOfPrimaries) { - (static_cast(context))->OnSuccessResponse_63(startUpColorTemperatureMireds); + (static_cast(context))->OnSuccessResponse_63(numberOfPrimaries); } static void OnFailureCallback_64(void * context, CHIP_ERROR error) @@ -5042,26 +4969,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_64(error); } - static void OnSuccessCallback_64(void * context) { (static_cast(context))->OnSuccessResponse_64(); } + static void OnSuccessCallback_64(void * context, uint16_t primary1X) + { + (static_cast(context))->OnSuccessResponse_64(primary1X); + } static void OnFailureCallback_65(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_65(error); } - static void OnSuccessCallback_65(void * context, uint16_t startUpColorTemperatureMireds) - { - (static_cast(context))->OnSuccessResponse_65(startUpColorTemperatureMireds); - } + static void OnSuccessCallback_65(void * context) { (static_cast(context))->OnSuccessResponse_65(); } static void OnFailureCallback_66(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_66(error); } - static void OnSuccessCallback_66(void * context, uint16_t remainingTime) + static void OnSuccessCallback_66(void * context, uint16_t primary1X) { - (static_cast(context))->OnSuccessResponse_66(remainingTime); + (static_cast(context))->OnSuccessResponse_66(primary1X); } static void OnFailureCallback_67(void * context, CHIP_ERROR error) @@ -5069,9 +4996,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_67(error); } - static void OnSuccessCallback_67(void * context, uint16_t remainingTime) + static void OnSuccessCallback_67(void * context, uint16_t primary1Y) { - (static_cast(context))->OnSuccessResponse_67(remainingTime); + (static_cast(context))->OnSuccessResponse_67(primary1Y); } static void OnFailureCallback_68(void * context, CHIP_ERROR error) @@ -5086,9 +5013,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_69(error); } - static void OnSuccessCallback_69(void * context, uint16_t remainingTime) + static void OnSuccessCallback_69(void * context, uint16_t primary1Y) { - (static_cast(context))->OnSuccessResponse_69(remainingTime); + (static_cast(context))->OnSuccessResponse_69(primary1Y); } static void OnFailureCallback_70(void * context, CHIP_ERROR error) @@ -5096,9 +5023,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_70(error); } - static void OnSuccessCallback_70(void * context, uint8_t driftCompensation) + static void OnSuccessCallback_70(void * context, uint8_t primary1Intensity) { - (static_cast(context))->OnSuccessResponse_70(driftCompensation); + (static_cast(context))->OnSuccessResponse_70(primary1Intensity); } static void OnFailureCallback_71(void * context, CHIP_ERROR error) @@ -5106,26 +5033,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_71(error); } - static void OnSuccessCallback_71(void * context) { (static_cast(context))->OnSuccessResponse_71(); } + static void OnSuccessCallback_71(void * context, uint16_t primary2X) + { + (static_cast(context))->OnSuccessResponse_71(primary2X); + } static void OnFailureCallback_72(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_72(error); } - static void OnSuccessCallback_72(void * context, uint8_t driftCompensation) - { - (static_cast(context))->OnSuccessResponse_72(driftCompensation); - } + static void OnSuccessCallback_72(void * context) { (static_cast(context))->OnSuccessResponse_72(); } static void OnFailureCallback_73(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_73(error); } - static void OnSuccessCallback_73(void * context, chip::CharSpan compensationText) + static void OnSuccessCallback_73(void * context, uint16_t primary2X) { - (static_cast(context))->OnSuccessResponse_73(compensationText); + (static_cast(context))->OnSuccessResponse_73(primary2X); } static void OnFailureCallback_74(void * context, CHIP_ERROR error) @@ -5133,26 +5060,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_74(error); } - static void OnSuccessCallback_74(void * context) { (static_cast(context))->OnSuccessResponse_74(); } + static void OnSuccessCallback_74(void * context, uint16_t primary2Y) + { + (static_cast(context))->OnSuccessResponse_74(primary2Y); + } static void OnFailureCallback_75(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_75(error); } - static void OnSuccessCallback_75(void * context, chip::CharSpan compensationText) - { - (static_cast(context))->OnSuccessResponse_75(compensationText); - } + static void OnSuccessCallback_75(void * context) { (static_cast(context))->OnSuccessResponse_75(); } static void OnFailureCallback_76(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_76(error); } - static void OnSuccessCallback_76(void * context, uint8_t numberOfPrimaries) + static void OnSuccessCallback_76(void * context, uint16_t primary2Y) { - (static_cast(context))->OnSuccessResponse_76(numberOfPrimaries); + (static_cast(context))->OnSuccessResponse_76(primary2Y); } static void OnFailureCallback_77(void * context, CHIP_ERROR error) @@ -5160,16 +5087,19 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_77(error); } - static void OnSuccessCallback_77(void * context) { (static_cast(context))->OnSuccessResponse_77(); } + static void OnSuccessCallback_77(void * context, uint8_t primary2Intensity) + { + (static_cast(context))->OnSuccessResponse_77(primary2Intensity); + } static void OnFailureCallback_78(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_78(error); } - static void OnSuccessCallback_78(void * context, uint8_t numberOfPrimaries) + static void OnSuccessCallback_78(void * context, uint16_t primary3X) { - (static_cast(context))->OnSuccessResponse_78(numberOfPrimaries); + (static_cast(context))->OnSuccessResponse_78(primary3X); } static void OnFailureCallback_79(void * context, CHIP_ERROR error) @@ -5177,26 +5107,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_79(error); } - static void OnSuccessCallback_79(void * context, uint16_t primary1X) - { - (static_cast(context))->OnSuccessResponse_79(primary1X); - } + static void OnSuccessCallback_79(void * context) { (static_cast(context))->OnSuccessResponse_79(); } static void OnFailureCallback_80(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_80(error); } - static void OnSuccessCallback_80(void * context) { (static_cast(context))->OnSuccessResponse_80(); } + static void OnSuccessCallback_80(void * context, uint16_t primary3X) + { + (static_cast(context))->OnSuccessResponse_80(primary3X); + } static void OnFailureCallback_81(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_81(error); } - static void OnSuccessCallback_81(void * context, uint16_t primary1X) + static void OnSuccessCallback_81(void * context, uint16_t primary3Y) { - (static_cast(context))->OnSuccessResponse_81(primary1X); + (static_cast(context))->OnSuccessResponse_81(primary3Y); } static void OnFailureCallback_82(void * context, CHIP_ERROR error) @@ -5204,26 +5134,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_82(error); } - static void OnSuccessCallback_82(void * context, uint16_t primary1Y) - { - (static_cast(context))->OnSuccessResponse_82(primary1Y); - } + static void OnSuccessCallback_82(void * context) { (static_cast(context))->OnSuccessResponse_82(); } static void OnFailureCallback_83(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_83(error); } - static void OnSuccessCallback_83(void * context) { (static_cast(context))->OnSuccessResponse_83(); } + static void OnSuccessCallback_83(void * context, uint16_t primary3Y) + { + (static_cast(context))->OnSuccessResponse_83(primary3Y); + } static void OnFailureCallback_84(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_84(error); } - static void OnSuccessCallback_84(void * context, uint16_t primary1Y) + static void OnSuccessCallback_84(void * context, uint8_t primary3Intensity) { - (static_cast(context))->OnSuccessResponse_84(primary1Y); + (static_cast(context))->OnSuccessResponse_84(primary3Intensity); } static void OnFailureCallback_85(void * context, CHIP_ERROR error) @@ -5231,9 +5161,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_85(error); } - static void OnSuccessCallback_85(void * context, uint8_t primary1Intensity) + static void OnSuccessCallback_85(void * context, uint16_t primary4X) { - (static_cast(context))->OnSuccessResponse_85(primary1Intensity); + (static_cast(context))->OnSuccessResponse_85(primary4X); } static void OnFailureCallback_86(void * context, CHIP_ERROR error) @@ -5241,26 +5171,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_86(error); } - static void OnSuccessCallback_86(void * context, uint16_t primary2X) - { - (static_cast(context))->OnSuccessResponse_86(primary2X); - } + static void OnSuccessCallback_86(void * context) { (static_cast(context))->OnSuccessResponse_86(); } static void OnFailureCallback_87(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_87(error); } - static void OnSuccessCallback_87(void * context) { (static_cast(context))->OnSuccessResponse_87(); } + static void OnSuccessCallback_87(void * context, uint16_t primary4X) + { + (static_cast(context))->OnSuccessResponse_87(primary4X); + } static void OnFailureCallback_88(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_88(error); } - static void OnSuccessCallback_88(void * context, uint16_t primary2X) + static void OnSuccessCallback_88(void * context, uint16_t primary4Y) { - (static_cast(context))->OnSuccessResponse_88(primary2X); + (static_cast(context))->OnSuccessResponse_88(primary4Y); } static void OnFailureCallback_89(void * context, CHIP_ERROR error) @@ -5268,26 +5198,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_89(error); } - static void OnSuccessCallback_89(void * context, uint16_t primary2Y) - { - (static_cast(context))->OnSuccessResponse_89(primary2Y); - } + static void OnSuccessCallback_89(void * context) { (static_cast(context))->OnSuccessResponse_89(); } static void OnFailureCallback_90(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_90(error); } - static void OnSuccessCallback_90(void * context) { (static_cast(context))->OnSuccessResponse_90(); } + static void OnSuccessCallback_90(void * context, uint16_t primary4Y) + { + (static_cast(context))->OnSuccessResponse_90(primary4Y); + } static void OnFailureCallback_91(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_91(error); } - static void OnSuccessCallback_91(void * context, uint16_t primary2Y) + static void OnSuccessCallback_91(void * context, uint8_t primary4Intensity) { - (static_cast(context))->OnSuccessResponse_91(primary2Y); + (static_cast(context))->OnSuccessResponse_91(primary4Intensity); } static void OnFailureCallback_92(void * context, CHIP_ERROR error) @@ -5295,9 +5225,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_92(error); } - static void OnSuccessCallback_92(void * context, uint8_t primary2Intensity) + static void OnSuccessCallback_92(void * context, uint16_t primary5X) { - (static_cast(context))->OnSuccessResponse_92(primary2Intensity); + (static_cast(context))->OnSuccessResponse_92(primary5X); } static void OnFailureCallback_93(void * context, CHIP_ERROR error) @@ -5305,26 +5235,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_93(error); } - static void OnSuccessCallback_93(void * context, uint16_t primary3X) - { - (static_cast(context))->OnSuccessResponse_93(primary3X); - } + static void OnSuccessCallback_93(void * context) { (static_cast(context))->OnSuccessResponse_93(); } static void OnFailureCallback_94(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_94(error); } - static void OnSuccessCallback_94(void * context) { (static_cast(context))->OnSuccessResponse_94(); } + static void OnSuccessCallback_94(void * context, uint16_t primary5X) + { + (static_cast(context))->OnSuccessResponse_94(primary5X); + } static void OnFailureCallback_95(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_95(error); } - static void OnSuccessCallback_95(void * context, uint16_t primary3X) + static void OnSuccessCallback_95(void * context, uint16_t primary5Y) { - (static_cast(context))->OnSuccessResponse_95(primary3X); + (static_cast(context))->OnSuccessResponse_95(primary5Y); } static void OnFailureCallback_96(void * context, CHIP_ERROR error) @@ -5332,26 +5262,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_96(error); } - static void OnSuccessCallback_96(void * context, uint16_t primary3Y) - { - (static_cast(context))->OnSuccessResponse_96(primary3Y); - } + static void OnSuccessCallback_96(void * context) { (static_cast(context))->OnSuccessResponse_96(); } static void OnFailureCallback_97(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_97(error); } - static void OnSuccessCallback_97(void * context) { (static_cast(context))->OnSuccessResponse_97(); } + static void OnSuccessCallback_97(void * context, uint16_t primary5Y) + { + (static_cast(context))->OnSuccessResponse_97(primary5Y); + } static void OnFailureCallback_98(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_98(error); } - static void OnSuccessCallback_98(void * context, uint16_t primary3Y) + static void OnSuccessCallback_98(void * context, uint8_t primary5Intensity) { - (static_cast(context))->OnSuccessResponse_98(primary3Y); + (static_cast(context))->OnSuccessResponse_98(primary5Intensity); } static void OnFailureCallback_99(void * context, CHIP_ERROR error) @@ -5359,9 +5289,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_99(error); } - static void OnSuccessCallback_99(void * context, uint8_t primary3Intensity) + static void OnSuccessCallback_99(void * context, uint16_t primary6X) { - (static_cast(context))->OnSuccessResponse_99(primary3Intensity); + (static_cast(context))->OnSuccessResponse_99(primary6X); } static void OnFailureCallback_100(void * context, CHIP_ERROR error) @@ -5369,26 +5299,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_100(error); } - static void OnSuccessCallback_100(void * context, uint16_t primary4X) - { - (static_cast(context))->OnSuccessResponse_100(primary4X); - } + static void OnSuccessCallback_100(void * context) { (static_cast(context))->OnSuccessResponse_100(); } static void OnFailureCallback_101(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_101(error); } - static void OnSuccessCallback_101(void * context) { (static_cast(context))->OnSuccessResponse_101(); } + static void OnSuccessCallback_101(void * context, uint16_t primary6X) + { + (static_cast(context))->OnSuccessResponse_101(primary6X); + } static void OnFailureCallback_102(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_102(error); } - static void OnSuccessCallback_102(void * context, uint16_t primary4X) + static void OnSuccessCallback_102(void * context, uint16_t primary6Y) { - (static_cast(context))->OnSuccessResponse_102(primary4X); + (static_cast(context))->OnSuccessResponse_102(primary6Y); } static void OnFailureCallback_103(void * context, CHIP_ERROR error) @@ -5396,26 +5326,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_103(error); } - static void OnSuccessCallback_103(void * context, uint16_t primary4Y) - { - (static_cast(context))->OnSuccessResponse_103(primary4Y); - } + static void OnSuccessCallback_103(void * context) { (static_cast(context))->OnSuccessResponse_103(); } static void OnFailureCallback_104(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_104(error); } - static void OnSuccessCallback_104(void * context) { (static_cast(context))->OnSuccessResponse_104(); } + static void OnSuccessCallback_104(void * context, uint16_t primary6Y) + { + (static_cast(context))->OnSuccessResponse_104(primary6Y); + } static void OnFailureCallback_105(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_105(error); } - static void OnSuccessCallback_105(void * context, uint16_t primary4Y) + static void OnSuccessCallback_105(void * context, uint8_t primary6Intensity) { - (static_cast(context))->OnSuccessResponse_105(primary4Y); + (static_cast(context))->OnSuccessResponse_105(primary6Intensity); } static void OnFailureCallback_106(void * context, CHIP_ERROR error) @@ -5423,9 +5353,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_106(error); } - static void OnSuccessCallback_106(void * context, uint8_t primary4Intensity) + static void OnSuccessCallback_106(void * context, uint16_t whitePointX) { - (static_cast(context))->OnSuccessResponse_106(primary4Intensity); + (static_cast(context))->OnSuccessResponse_106(whitePointX); } static void OnFailureCallback_107(void * context, CHIP_ERROR error) @@ -5433,26 +5363,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_107(error); } - static void OnSuccessCallback_107(void * context, uint16_t primary5X) - { - (static_cast(context))->OnSuccessResponse_107(primary5X); - } + static void OnSuccessCallback_107(void * context) { (static_cast(context))->OnSuccessResponse_107(); } static void OnFailureCallback_108(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_108(error); } - static void OnSuccessCallback_108(void * context) { (static_cast(context))->OnSuccessResponse_108(); } + static void OnSuccessCallback_108(void * context, uint16_t whitePointX) + { + (static_cast(context))->OnSuccessResponse_108(whitePointX); + } static void OnFailureCallback_109(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_109(error); } - static void OnSuccessCallback_109(void * context, uint16_t primary5X) + static void OnSuccessCallback_109(void * context, uint16_t whitePointY) { - (static_cast(context))->OnSuccessResponse_109(primary5X); + (static_cast(context))->OnSuccessResponse_109(whitePointY); } static void OnFailureCallback_110(void * context, CHIP_ERROR error) @@ -5460,26 +5390,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_110(error); } - static void OnSuccessCallback_110(void * context, uint16_t primary5Y) - { - (static_cast(context))->OnSuccessResponse_110(primary5Y); - } + static void OnSuccessCallback_110(void * context) { (static_cast(context))->OnSuccessResponse_110(); } static void OnFailureCallback_111(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_111(error); } - static void OnSuccessCallback_111(void * context) { (static_cast(context))->OnSuccessResponse_111(); } + static void OnSuccessCallback_111(void * context, uint16_t whitePointY) + { + (static_cast(context))->OnSuccessResponse_111(whitePointY); + } static void OnFailureCallback_112(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_112(error); } - static void OnSuccessCallback_112(void * context, uint16_t primary5Y) + static void OnSuccessCallback_112(void * context, uint16_t colorPointRX) { - (static_cast(context))->OnSuccessResponse_112(primary5Y); + (static_cast(context))->OnSuccessResponse_112(colorPointRX); } static void OnFailureCallback_113(void * context, CHIP_ERROR error) @@ -5487,19 +5417,16 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_113(error); } - static void OnSuccessCallback_113(void * context, uint8_t primary5Intensity) - { - (static_cast(context))->OnSuccessResponse_113(primary5Intensity); - } + static void OnSuccessCallback_113(void * context) { (static_cast(context))->OnSuccessResponse_113(); } static void OnFailureCallback_114(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_114(error); } - static void OnSuccessCallback_114(void * context, uint16_t primary6X) + static void OnSuccessCallback_114(void * context, uint16_t colorPointRX) { - (static_cast(context))->OnSuccessResponse_114(primary6X); + (static_cast(context))->OnSuccessResponse_114(colorPointRX); } static void OnFailureCallback_115(void * context, CHIP_ERROR error) @@ -5507,26 +5434,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_115(error); } - static void OnSuccessCallback_115(void * context) { (static_cast(context))->OnSuccessResponse_115(); } + static void OnSuccessCallback_115(void * context, uint16_t colorPointRY) + { + (static_cast(context))->OnSuccessResponse_115(colorPointRY); + } static void OnFailureCallback_116(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_116(error); } - static void OnSuccessCallback_116(void * context, uint16_t primary6X) - { - (static_cast(context))->OnSuccessResponse_116(primary6X); - } + static void OnSuccessCallback_116(void * context) { (static_cast(context))->OnSuccessResponse_116(); } static void OnFailureCallback_117(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_117(error); } - static void OnSuccessCallback_117(void * context, uint16_t primary6Y) + static void OnSuccessCallback_117(void * context, uint16_t colorPointRY) { - (static_cast(context))->OnSuccessResponse_117(primary6Y); + (static_cast(context))->OnSuccessResponse_117(colorPointRY); } static void OnFailureCallback_118(void * context, CHIP_ERROR error) @@ -5534,26 +5461,26 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_118(error); } - static void OnSuccessCallback_118(void * context) { (static_cast(context))->OnSuccessResponse_118(); } + static void OnSuccessCallback_118(void * context, uint8_t colorPointRIntensity) + { + (static_cast(context))->OnSuccessResponse_118(colorPointRIntensity); + } static void OnFailureCallback_119(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_119(error); } - static void OnSuccessCallback_119(void * context, uint16_t primary6Y) - { - (static_cast(context))->OnSuccessResponse_119(primary6Y); - } + static void OnSuccessCallback_119(void * context) { (static_cast(context))->OnSuccessResponse_119(); } static void OnFailureCallback_120(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_120(error); } - static void OnSuccessCallback_120(void * context, uint8_t primary6Intensity) + static void OnSuccessCallback_120(void * context, uint8_t colorPointRIntensity) { - (static_cast(context))->OnSuccessResponse_120(primary6Intensity); + (static_cast(context))->OnSuccessResponse_120(colorPointRIntensity); } static void OnFailureCallback_121(void * context, CHIP_ERROR error) @@ -5561,9 +5488,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_121(error); } - static void OnSuccessCallback_121(void * context, uint16_t whitePointX) + static void OnSuccessCallback_121(void * context, uint16_t colorPointGX) { - (static_cast(context))->OnSuccessResponse_121(whitePointX); + (static_cast(context))->OnSuccessResponse_121(colorPointGX); } static void OnFailureCallback_122(void * context, CHIP_ERROR error) @@ -5578,9 +5505,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_123(error); } - static void OnSuccessCallback_123(void * context, uint16_t whitePointX) + static void OnSuccessCallback_123(void * context, uint16_t colorPointGX) { - (static_cast(context))->OnSuccessResponse_123(whitePointX); + (static_cast(context))->OnSuccessResponse_123(colorPointGX); } static void OnFailureCallback_124(void * context, CHIP_ERROR error) @@ -5588,9 +5515,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_124(error); } - static void OnSuccessCallback_124(void * context, uint16_t whitePointY) + static void OnSuccessCallback_124(void * context, uint16_t colorPointGY) { - (static_cast(context))->OnSuccessResponse_124(whitePointY); + (static_cast(context))->OnSuccessResponse_124(colorPointGY); } static void OnFailureCallback_125(void * context, CHIP_ERROR error) @@ -5605,9 +5532,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_126(error); } - static void OnSuccessCallback_126(void * context, uint16_t whitePointY) + static void OnSuccessCallback_126(void * context, uint16_t colorPointGY) { - (static_cast(context))->OnSuccessResponse_126(whitePointY); + (static_cast(context))->OnSuccessResponse_126(colorPointGY); } static void OnFailureCallback_127(void * context, CHIP_ERROR error) @@ -5615,9 +5542,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_127(error); } - static void OnSuccessCallback_127(void * context, uint16_t colorPointRX) + static void OnSuccessCallback_127(void * context, uint8_t colorPointGIntensity) { - (static_cast(context))->OnSuccessResponse_127(colorPointRX); + (static_cast(context))->OnSuccessResponse_127(colorPointGIntensity); } static void OnFailureCallback_128(void * context, CHIP_ERROR error) @@ -5632,9 +5559,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_129(error); } - static void OnSuccessCallback_129(void * context, uint16_t colorPointRX) + static void OnSuccessCallback_129(void * context, uint8_t colorPointGIntensity) { - (static_cast(context))->OnSuccessResponse_129(colorPointRX); + (static_cast(context))->OnSuccessResponse_129(colorPointGIntensity); } static void OnFailureCallback_130(void * context, CHIP_ERROR error) @@ -5642,9 +5569,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_130(error); } - static void OnSuccessCallback_130(void * context, uint16_t colorPointRY) + static void OnSuccessCallback_130(void * context, uint16_t colorPointBX) { - (static_cast(context))->OnSuccessResponse_130(colorPointRY); + (static_cast(context))->OnSuccessResponse_130(colorPointBX); } static void OnFailureCallback_131(void * context, CHIP_ERROR error) @@ -5659,9 +5586,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_132(error); } - static void OnSuccessCallback_132(void * context, uint16_t colorPointRY) + static void OnSuccessCallback_132(void * context, uint16_t colorPointBX) { - (static_cast(context))->OnSuccessResponse_132(colorPointRY); + (static_cast(context))->OnSuccessResponse_132(colorPointBX); } static void OnFailureCallback_133(void * context, CHIP_ERROR error) @@ -5669,9 +5596,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_133(error); } - static void OnSuccessCallback_133(void * context, uint8_t colorPointRIntensity) + static void OnSuccessCallback_133(void * context, uint16_t colorPointBY) { - (static_cast(context))->OnSuccessResponse_133(colorPointRIntensity); + (static_cast(context))->OnSuccessResponse_133(colorPointBY); } static void OnFailureCallback_134(void * context, CHIP_ERROR error) @@ -5686,9 +5613,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_135(error); } - static void OnSuccessCallback_135(void * context, uint8_t colorPointRIntensity) + static void OnSuccessCallback_135(void * context, uint16_t colorPointBY) { - (static_cast(context))->OnSuccessResponse_135(colorPointRIntensity); + (static_cast(context))->OnSuccessResponse_135(colorPointBY); } static void OnFailureCallback_136(void * context, CHIP_ERROR error) @@ -5696,9 +5623,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_136(error); } - static void OnSuccessCallback_136(void * context, uint16_t colorPointGX) + static void OnSuccessCallback_136(void * context, uint8_t colorPointBIntensity) { - (static_cast(context))->OnSuccessResponse_136(colorPointGX); + (static_cast(context))->OnSuccessResponse_136(colorPointBIntensity); } static void OnFailureCallback_137(void * context, CHIP_ERROR error) @@ -5713,144 +5640,9 @@ class Test_TC_CC_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_138(error); } - static void OnSuccessCallback_138(void * context, uint16_t colorPointGX) - { - (static_cast(context))->OnSuccessResponse_138(colorPointGX); - } - - static void OnFailureCallback_139(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_139(error); - } - - static void OnSuccessCallback_139(void * context, uint16_t colorPointGY) - { - (static_cast(context))->OnSuccessResponse_139(colorPointGY); - } - - static void OnFailureCallback_140(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_140(error); - } - - static void OnSuccessCallback_140(void * context) { (static_cast(context))->OnSuccessResponse_140(); } - - static void OnFailureCallback_141(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_141(error); - } - - static void OnSuccessCallback_141(void * context, uint16_t colorPointGY) - { - (static_cast(context))->OnSuccessResponse_141(colorPointGY); - } - - static void OnFailureCallback_142(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_142(error); - } - - static void OnSuccessCallback_142(void * context, uint8_t colorPointGIntensity) - { - (static_cast(context))->OnSuccessResponse_142(colorPointGIntensity); - } - - static void OnFailureCallback_143(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_143(error); - } - - static void OnSuccessCallback_143(void * context) { (static_cast(context))->OnSuccessResponse_143(); } - - static void OnFailureCallback_144(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_144(error); - } - - static void OnSuccessCallback_144(void * context, uint8_t colorPointGIntensity) - { - (static_cast(context))->OnSuccessResponse_144(colorPointGIntensity); - } - - static void OnFailureCallback_145(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_145(error); - } - - static void OnSuccessCallback_145(void * context, uint16_t colorPointBX) - { - (static_cast(context))->OnSuccessResponse_145(colorPointBX); - } - - static void OnFailureCallback_146(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_146(error); - } - - static void OnSuccessCallback_146(void * context) { (static_cast(context))->OnSuccessResponse_146(); } - - static void OnFailureCallback_147(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_147(error); - } - - static void OnSuccessCallback_147(void * context, uint16_t colorPointBX) - { - (static_cast(context))->OnSuccessResponse_147(colorPointBX); - } - - static void OnFailureCallback_148(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_148(error); - } - - static void OnSuccessCallback_148(void * context, uint16_t colorPointBY) - { - (static_cast(context))->OnSuccessResponse_148(colorPointBY); - } - - static void OnFailureCallback_149(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_149(error); - } - - static void OnSuccessCallback_149(void * context) { (static_cast(context))->OnSuccessResponse_149(); } - - static void OnFailureCallback_150(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_150(error); - } - - static void OnSuccessCallback_150(void * context, uint16_t colorPointBY) - { - (static_cast(context))->OnSuccessResponse_150(colorPointBY); - } - - static void OnFailureCallback_151(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_151(error); - } - - static void OnSuccessCallback_151(void * context, uint8_t colorPointBIntensity) - { - (static_cast(context))->OnSuccessResponse_151(colorPointBIntensity); - } - - static void OnFailureCallback_152(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_152(error); - } - - static void OnSuccessCallback_152(void * context) { (static_cast(context))->OnSuccessResponse_152(); } - - static void OnFailureCallback_153(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_153(error); - } - - static void OnSuccessCallback_153(void * context, uint8_t colorPointBIntensity) + static void OnSuccessCallback_138(void * context, uint8_t colorPointBIntensity) { - (static_cast(context))->OnSuccessResponse_153(colorPointBIntensity); + (static_cast(context))->OnSuccessResponse_138(colorPointBIntensity); } // @@ -5863,7 +5655,7 @@ class Test_TC_CC_2_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestReadsMandatoryAttributeCurrentHue_1() + CHIP_ERROR TestValidateConstraintsOfAttributeCurrentHue_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -5881,30 +5673,6 @@ class Test_TC_CC_2_1Suite : public TestCommand } void OnSuccessResponse_1(uint8_t currentHue) - { - VerifyOrReturn(CheckValue("currentHue", currentHue, 0)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentHue_2() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_2(uint8_t currentHue) { VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("currentHue", currentHue, 0)); @@ -5912,7 +5680,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentHue_3() + CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentHue_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -5922,85 +5690,61 @@ class Test_TC_CC_2_1Suite : public TestCommand currentHueArgument = 0; ReturnErrorOnFailure(cluster.WriteAttribute( - currentHueArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + currentHueArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_3() { ThrowSuccessResponse(); } + void OnSuccessResponse_2() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeCurrentHue_4() + CHIP_ERROR TestReadsBackMandatoryAttributeCurrentHue_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4, true)); + this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(CHIP_ERROR error) + void OnFailureResponse_3(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_4(uint8_t currentHue) + void OnSuccessResponse_3(uint8_t currentHue) { VerifyOrReturn(CheckValue("currentHue", currentHue, 0)); NextTest(); } - CHIP_ERROR TestReadsMandatoryAttributeCurrentSaturation_5() + CHIP_ERROR TestValidateConstraintsOfAttributeCurrentSaturation_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_5(uint8_t currentSaturation) - { - VerifyOrReturn(CheckValue("currentSaturation", currentSaturation, 0)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentSaturation_6() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6, true)); + this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_4(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_6(uint8_t currentSaturation) + void OnSuccessResponse_4(uint8_t currentSaturation) { VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("currentSaturation", currentSaturation, 0)); @@ -6008,7 +5752,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentSaturation_7() + CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentSaturation_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6018,85 +5762,61 @@ class Test_TC_CC_2_1Suite : public TestCommand currentSaturationArgument = 0; ReturnErrorOnFailure(cluster.WriteAttribute( - currentSaturationArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); + currentSaturationArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(CHIP_ERROR error) + void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_7() { ThrowSuccessResponse(); } + void OnSuccessResponse_5() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeCurrentSaturation_8() + CHIP_ERROR TestReadsBackMandatoryAttributeCurrentSaturation_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8, true)); + this, OnSuccessCallback_6, OnFailureCallback_6, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_6(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_8(uint8_t currentSaturation) + void OnSuccessResponse_6(uint8_t currentSaturation) { VerifyOrReturn(CheckValue("currentSaturation", currentSaturation, 0)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeCurrentX_9() + CHIP_ERROR TestValidateConstraintsOfAttributeCurrentX_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_9(uint16_t currentX) - { - VerifyOrReturn(CheckValue("currentX", currentX, 24939U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentX_10() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10, true)); + this, OnSuccessCallback_7, OnFailureCallback_7, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_10(CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_10(uint16_t currentX) + void OnSuccessResponse_7(uint16_t currentX) { VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("currentX", currentX, 0U)); @@ -6104,7 +5824,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentX_11() + CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentX_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6114,85 +5834,61 @@ class Test_TC_CC_2_1Suite : public TestCommand currentXArgument = 24939U; ReturnErrorOnFailure(cluster.WriteAttribute( - currentXArgument, this, OnSuccessCallback_11, OnFailureCallback_11)); + currentXArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); return CHIP_NO_ERROR; } - void OnFailureResponse_11(CHIP_ERROR error) + void OnFailureResponse_8(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_11() { ThrowSuccessResponse(); } + void OnSuccessResponse_8() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeCurrentX_12() + CHIP_ERROR TestReadsBackMandatoryAttributeCurrentX_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12, true)); + this, OnSuccessCallback_9, OnFailureCallback_9, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_12(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_12(uint16_t currentX) + void OnSuccessResponse_9(uint16_t currentX) { VerifyOrReturn(CheckValue("currentX", currentX, 24939U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeCurrentY_13() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_13(uint16_t currentY) - { - VerifyOrReturn(CheckValue("currentY", currentY, 24701U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentY_14() + CHIP_ERROR TestValidateConstraintsOfAttributeCurrentY_10() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14, true)); + this, OnSuccessCallback_10, OnFailureCallback_10, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_14(CHIP_ERROR error) + void OnFailureResponse_10(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_14(uint16_t currentY) + void OnSuccessResponse_10(uint16_t currentY) { VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("currentY", currentY, 0U)); @@ -6200,7 +5896,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeCurrentY_15() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeCurrentY_11() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6210,61 +5906,61 @@ class Test_TC_CC_2_1Suite : public TestCommand currentYArgument = 24701U; ReturnErrorOnFailure(cluster.WriteAttribute( - currentYArgument, this, OnSuccessCallback_15, OnFailureCallback_15)); + currentYArgument, this, OnSuccessCallback_11, OnFailureCallback_11)); return CHIP_NO_ERROR; } - void OnFailureResponse_15(CHIP_ERROR error) + void OnFailureResponse_11(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_15() { ThrowSuccessResponse(); } + void OnSuccessResponse_11() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeCurrentY_16() + CHIP_ERROR TestReadsBackMandatoryAttributeCurrentY_12() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16, true)); + this, OnSuccessCallback_12, OnFailureCallback_12, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_16(CHIP_ERROR error) + void OnFailureResponse_12(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_16(uint16_t currentY) + void OnSuccessResponse_12(uint16_t currentY) { VerifyOrReturn(CheckValue("currentY", currentY, 24701U)); NextTest(); } - CHIP_ERROR TestValidateConstraintsOfAttributeColorTemperatureMireds_17() + CHIP_ERROR TestValidateConstraintsOfAttributeColorTemperatureMireds_13() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_17, OnFailureCallback_17, true)); + this, OnSuccessCallback_13, OnFailureCallback_13, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_17(CHIP_ERROR error) + void OnFailureResponse_13(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_17(uint16_t colorTemperature) + void OnSuccessResponse_13(uint16_t colorTemperature) { VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("colorTemperature", colorTemperature, 0U)); @@ -6272,24 +5968,24 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestValidateConstraintsOfAttributeColorMode_18() + CHIP_ERROR TestValidateConstraintsOfAttributeColorMode_14() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18, true)); + this, OnSuccessCallback_14, OnFailureCallback_14, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_18(CHIP_ERROR error) + void OnFailureResponse_14(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_18(uint8_t colorMode) + void OnSuccessResponse_14(uint8_t colorMode) { VerifyOrReturn(CheckConstraintType("colorMode", "", "enum8")); VerifyOrReturn(CheckConstraintMinValue("colorMode", colorMode, 0)); @@ -6297,54 +5993,30 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeOptions_19() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_19, OnFailureCallback_19, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_19(uint8_t colorControlOptions) - { - VerifyOrReturn(CheckValue("colorControlOptions", colorControlOptions, 0)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeOptions_20() + CHIP_ERROR TestValidateConstraintsOfAttributeOptions_15() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_20, OnFailureCallback_20, true)); + this, OnSuccessCallback_15, OnFailureCallback_15, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_20(CHIP_ERROR error) + void OnFailureResponse_15(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_20(uint8_t colorControlOptions) + void OnSuccessResponse_15(uint8_t colorControlOptions) { VerifyOrReturn(CheckConstraintType("colorControlOptions", "", "map8")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeOptions_21() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeOptions_16() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6354,90 +6026,66 @@ class Test_TC_CC_2_1Suite : public TestCommand colorControlOptionsArgument = 0; ReturnErrorOnFailure(cluster.WriteAttribute( - colorControlOptionsArgument, this, OnSuccessCallback_21, OnFailureCallback_21)); + colorControlOptionsArgument, this, OnSuccessCallback_16, OnFailureCallback_16)); return CHIP_NO_ERROR; } - void OnFailureResponse_21(CHIP_ERROR error) + void OnFailureResponse_16(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_21() { NextTest(); } + void OnSuccessResponse_16() { NextTest(); } - CHIP_ERROR TestReadsBackMandatoryAttributeOptions_22() + CHIP_ERROR TestReadsBackMandatoryAttributeOptions_17() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_22, OnFailureCallback_22, true)); + this, OnSuccessCallback_17, OnFailureCallback_17, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_22(CHIP_ERROR error) + void OnFailureResponse_17(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_22(uint8_t colorControlOptions) + void OnSuccessResponse_17(uint8_t colorControlOptions) { VerifyOrReturn(CheckValue("colorControlOptions", colorControlOptions, 0)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeEnhancedCurrentHue_23() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_23(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_23(uint16_t enhancedCurrentHue) - { - VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedCurrentHue_24() + CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedCurrentHue_18() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_24, OnFailureCallback_24, true)); + this, OnSuccessCallback_18, OnFailureCallback_18, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_24(CHIP_ERROR error) + void OnFailureResponse_18(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_24(uint16_t enhancedCurrentHue) + void OnSuccessResponse_18(uint16_t enhancedCurrentHue) { VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeEnhancedCurrentHue_25() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeEnhancedCurrentHue_19() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6447,114 +6095,90 @@ class Test_TC_CC_2_1Suite : public TestCommand enhancedCurrentHueArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - enhancedCurrentHueArgument, this, OnSuccessCallback_25, OnFailureCallback_25)); + enhancedCurrentHueArgument, this, OnSuccessCallback_19, OnFailureCallback_19)); return CHIP_NO_ERROR; } - void OnFailureResponse_25(CHIP_ERROR error) + void OnFailureResponse_19(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_25() { ThrowSuccessResponse(); } + void OnSuccessResponse_19() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeEnhancedCurrentHue_26() + CHIP_ERROR TestReadsBackMandatoryAttributeEnhancedCurrentHue_20() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_26, OnFailureCallback_26, true)); + this, OnSuccessCallback_20, OnFailureCallback_20, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_26(CHIP_ERROR error) + void OnFailureResponse_20(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_26(uint16_t enhancedCurrentHue) + void OnSuccessResponse_20(uint16_t enhancedCurrentHue) { VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, 0U)); NextTest(); } - CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedColorMode_27() + CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedColorMode_21() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_27, OnFailureCallback_27, true)); + this, OnSuccessCallback_21, OnFailureCallback_21, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_27(CHIP_ERROR error) + void OnFailureResponse_21(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_27(uint8_t enhancedColorMode) + void OnSuccessResponse_21(uint8_t enhancedColorMode) { VerifyOrReturn(CheckConstraintType("enhancedColorMode", "", "enum8")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeColorLoopActive_28() + CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopActive_22() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_28, OnFailureCallback_28, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_28(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_28(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopActive_29() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_29, OnFailureCallback_29, true)); + this, OnSuccessCallback_22, OnFailureCallback_22, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_29(CHIP_ERROR error) + void OnFailureResponse_22(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_29(uint8_t colorLoopActive) + void OnSuccessResponse_22(uint8_t colorLoopActive) { VerifyOrReturn(CheckConstraintType("colorLoopActive", "", "uint8")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopActive_30() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopActive_23() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6564,91 +6188,67 @@ class Test_TC_CC_2_1Suite : public TestCommand colorLoopActiveArgument = 0; ReturnErrorOnFailure(cluster.WriteAttribute( - colorLoopActiveArgument, this, OnSuccessCallback_30, OnFailureCallback_30)); + colorLoopActiveArgument, this, OnSuccessCallback_23, OnFailureCallback_23)); return CHIP_NO_ERROR; } - void OnFailureResponse_30(CHIP_ERROR error) + void OnFailureResponse_23(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_30() { ThrowSuccessResponse(); } + void OnSuccessResponse_23() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopActive_31() + CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopActive_24() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_31, OnFailureCallback_31, true)); + this, OnSuccessCallback_24, OnFailureCallback_24, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_31(CHIP_ERROR error) + void OnFailureResponse_24(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_31(uint8_t colorLoopActive) + void OnSuccessResponse_24(uint8_t colorLoopActive) { VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeColorLoopDirection_32() + CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopDirection_25() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_32, OnFailureCallback_32, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_32(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_32(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopDirection_33() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_33, OnFailureCallback_33, true)); + this, OnSuccessCallback_25, OnFailureCallback_25, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_33(CHIP_ERROR error) + void OnFailureResponse_25(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_33(uint8_t colorLoopDirection) + void OnSuccessResponse_25(uint8_t colorLoopDirection) { VerifyOrReturn(CheckConstraintType("colorLoopDirection", "", "uint8")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopDirection_34() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopDirection_26() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6658,91 +6258,67 @@ class Test_TC_CC_2_1Suite : public TestCommand colorLoopDirectionArgument = 0; ReturnErrorOnFailure(cluster.WriteAttribute( - colorLoopDirectionArgument, this, OnSuccessCallback_34, OnFailureCallback_34)); + colorLoopDirectionArgument, this, OnSuccessCallback_26, OnFailureCallback_26)); return CHIP_NO_ERROR; } - void OnFailureResponse_34(CHIP_ERROR error) + void OnFailureResponse_26(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_34() { ThrowSuccessResponse(); } + void OnSuccessResponse_26() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopDirection_35() + CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopDirection_27() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_35, OnFailureCallback_35, true)); + this, OnSuccessCallback_27, OnFailureCallback_27, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_35(CHIP_ERROR error) + void OnFailureResponse_27(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_35(uint8_t colorLoopDirection) + void OnSuccessResponse_27(uint8_t colorLoopDirection) { VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeColorLoopTime_36() + CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopTime_28() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_36, OnFailureCallback_36, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_36(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_36(uint16_t colorLoopTime) - { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 25U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopTime_37() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_37, OnFailureCallback_37, true)); + this, OnSuccessCallback_28, OnFailureCallback_28, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_37(CHIP_ERROR error) + void OnFailureResponse_28(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_37(uint16_t colorLoopTime) + void OnSuccessResponse_28(uint16_t colorLoopTime) { VerifyOrReturn(CheckConstraintType("colorLoopTime", "", "uint16")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopTime_38() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopTime_29() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6752,69 +6328,44 @@ class Test_TC_CC_2_1Suite : public TestCommand colorLoopTimeArgument = 25U; ReturnErrorOnFailure(cluster.WriteAttribute( - colorLoopTimeArgument, this, OnSuccessCallback_38, OnFailureCallback_38)); + colorLoopTimeArgument, this, OnSuccessCallback_29, OnFailureCallback_29)); return CHIP_NO_ERROR; } - void OnFailureResponse_38(CHIP_ERROR error) + void OnFailureResponse_29(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_38() { ThrowSuccessResponse(); } + void OnSuccessResponse_29() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopTime_39() + CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopTime_30() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_39, OnFailureCallback_39, true)); + this, OnSuccessCallback_30, OnFailureCallback_30, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_39(CHIP_ERROR error) + void OnFailureResponse_30(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_39(uint16_t colorLoopTime) + void OnSuccessResponse_30(uint16_t colorLoopTime) { VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 25U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeColorLoopStartEnhancedHue_40() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_40, OnFailureCallback_40, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_40(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_40(uint16_t colorLoopStartEnhancedHue) - { - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 8960U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStartEnhancedHue_41() + CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStartEnhancedHue_31() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6822,23 +6373,23 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_41, OnFailureCallback_41, true)); + this, OnSuccessCallback_31, OnFailureCallback_31, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_41(CHIP_ERROR error) + void OnFailureResponse_31(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_41(uint16_t colorLoopStartEnhancedHue) + void OnSuccessResponse_31(uint16_t colorLoopStartEnhancedHue) { VerifyOrReturn(CheckConstraintType("colorLoopStartEnhancedHue", "", "uint16")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStartEnhancedHue_42() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStartEnhancedHue_32() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6849,20 +6400,20 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - colorLoopStartEnhancedHueArgument, this, OnSuccessCallback_42, OnFailureCallback_42)); + colorLoopStartEnhancedHueArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); return CHIP_NO_ERROR; } - void OnFailureResponse_42(CHIP_ERROR error) + void OnFailureResponse_32(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_42() { ThrowSuccessResponse(); } + void OnSuccessResponse_32() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopStartEnhancedHue_43() + CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopStartEnhancedHue_33() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6870,49 +6421,24 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_43, OnFailureCallback_43, true)); + this, OnSuccessCallback_33, OnFailureCallback_33, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_43(CHIP_ERROR error) + void OnFailureResponse_33(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_43(uint16_t colorLoopStartEnhancedHue) + void OnSuccessResponse_33(uint16_t colorLoopStartEnhancedHue) { VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 8960U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeColorLoopStoredEnhancedHue_44() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_44, OnFailureCallback_44, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_44(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_44(uint16_t colorLoopStoredEnhancedHue) - { - VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", colorLoopStoredEnhancedHue, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStoredEnhancedHue_45() + CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStoredEnhancedHue_34() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6920,23 +6446,23 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_45, OnFailureCallback_45, true)); + this, OnSuccessCallback_34, OnFailureCallback_34, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_45(CHIP_ERROR error) + void OnFailureResponse_34(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_45(uint16_t colorLoopStoredEnhancedHue) + void OnSuccessResponse_34(uint16_t colorLoopStoredEnhancedHue) { VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStoredEnhancedHue_46() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStoredEnhancedHue_35() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6947,20 +6473,20 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - colorLoopStoredEnhancedHueArgument, this, OnSuccessCallback_46, OnFailureCallback_46)); + colorLoopStoredEnhancedHueArgument, this, OnSuccessCallback_35, OnFailureCallback_35)); return CHIP_NO_ERROR; } - void OnFailureResponse_46(CHIP_ERROR error) + void OnFailureResponse_35(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_46() { ThrowSuccessResponse(); } + void OnSuccessResponse_35() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopStoredEnhancedHue_47() + CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopStoredEnhancedHue_36() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -6968,73 +6494,49 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_47, OnFailureCallback_47, true)); + this, OnSuccessCallback_36, OnFailureCallback_36, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_47(CHIP_ERROR error) + void OnFailureResponse_36(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_47(uint16_t colorLoopStoredEnhancedHue) + void OnSuccessResponse_36(uint16_t colorLoopStoredEnhancedHue) { VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", colorLoopStoredEnhancedHue, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeColorCapabilities_48() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_48, OnFailureCallback_48, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_48(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_48(uint16_t colorCapabilities) - { - VerifyOrReturn(CheckValue("colorCapabilities", colorCapabilities, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorCapabilities_49() + CHIP_ERROR TestValidateConstraintsOfAttributeColorCapabilities_37() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_49, OnFailureCallback_49, true)); + this, OnSuccessCallback_37, OnFailureCallback_37, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_49(CHIP_ERROR error) + void OnFailureResponse_37(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_49(uint16_t colorCapabilities) + void OnSuccessResponse_37(uint16_t colorCapabilities) { VerifyOrReturn(CheckConstraintType("colorCapabilities", "", "map16")); VerifyOrReturn(CheckConstraintMinValue("colorCapabilities", colorCapabilities, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("colorCapabilities", colorCapabilities, 65279U)); + VerifyOrReturn(CheckConstraintMaxValue("colorCapabilities", colorCapabilities, 31U)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorCapabilities_50() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorCapabilities_38() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7044,85 +6546,61 @@ class Test_TC_CC_2_1Suite : public TestCommand colorCapabilitiesArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - colorCapabilitiesArgument, this, OnSuccessCallback_50, OnFailureCallback_50)); + colorCapabilitiesArgument, this, OnSuccessCallback_38, OnFailureCallback_38)); return CHIP_NO_ERROR; } - void OnFailureResponse_50(CHIP_ERROR error) + void OnFailureResponse_38(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_50() { ThrowSuccessResponse(); } + void OnSuccessResponse_38() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeColorCapabilities_51() + CHIP_ERROR TestReadsBackMandatoryAttributeColorCapabilities_39() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_51, OnFailureCallback_51, true)); + this, OnSuccessCallback_39, OnFailureCallback_39, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_51(CHIP_ERROR error) + void OnFailureResponse_39(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_51(uint16_t colorCapabilities) + void OnSuccessResponse_39(uint16_t colorCapabilities) { VerifyOrReturn(CheckValue("colorCapabilities", colorCapabilities, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeColorTempPhysicalMinMireds_52() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_52, OnFailureCallback_52, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_52(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_52(uint16_t colorTempPhysicalMin) - { - VerifyOrReturn(CheckValue("colorTempPhysicalMin", colorTempPhysicalMin, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMinMireds_53() + CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMinMireds_40() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_53, OnFailureCallback_53, true)); + this, OnSuccessCallback_40, OnFailureCallback_40, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_53(CHIP_ERROR error) + void OnFailureResponse_40(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_53(uint16_t colorTempPhysicalMin) + void OnSuccessResponse_40(uint16_t colorTempPhysicalMin) { VerifyOrReturn(CheckConstraintType("colorTempPhysicalMin", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMin", colorTempPhysicalMin, 0U)); @@ -7130,7 +6608,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMinMireds_54() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMinMireds_41() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7140,85 +6618,61 @@ class Test_TC_CC_2_1Suite : public TestCommand colorTempPhysicalMinArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - colorTempPhysicalMinArgument, this, OnSuccessCallback_54, OnFailureCallback_54)); + colorTempPhysicalMinArgument, this, OnSuccessCallback_41, OnFailureCallback_41)); return CHIP_NO_ERROR; } - void OnFailureResponse_54(CHIP_ERROR error) + void OnFailureResponse_41(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_54() { ThrowSuccessResponse(); } + void OnSuccessResponse_41() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeColorTempPhysicalMinMireds_55() + CHIP_ERROR TestReadsBackMandatoryAttributeColorTempPhysicalMinMireds_42() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_55, OnFailureCallback_55, true)); + this, OnSuccessCallback_42, OnFailureCallback_42, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_55(CHIP_ERROR error) + void OnFailureResponse_42(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_55(uint16_t colorTempPhysicalMin) + void OnSuccessResponse_42(uint16_t colorTempPhysicalMin) { VerifyOrReturn(CheckValue("colorTempPhysicalMin", colorTempPhysicalMin, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeColorTempPhysicalMaxMireds_56() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_56, OnFailureCallback_56, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_56(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_56(uint16_t colorTempPhysicalMax) - { - VerifyOrReturn(CheckValue("colorTempPhysicalMax", colorTempPhysicalMax, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMaxMireds_57() + CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMaxMireds_43() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_57, OnFailureCallback_57, true)); + this, OnSuccessCallback_43, OnFailureCallback_43, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_57(CHIP_ERROR error) + void OnFailureResponse_43(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_57(uint16_t colorTempPhysicalMax) + void OnSuccessResponse_43(uint16_t colorTempPhysicalMax) { VerifyOrReturn(CheckConstraintType("colorTempPhysicalMax", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMax", colorTempPhysicalMax, 0U)); @@ -7226,7 +6680,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMaxMireds_58() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMaxMireds_44() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7236,44 +6690,44 @@ class Test_TC_CC_2_1Suite : public TestCommand colorTempPhysicalMaxArgument = 65279U; ReturnErrorOnFailure(cluster.WriteAttribute( - colorTempPhysicalMaxArgument, this, OnSuccessCallback_58, OnFailureCallback_58)); + colorTempPhysicalMaxArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); return CHIP_NO_ERROR; } - void OnFailureResponse_58(CHIP_ERROR error) + void OnFailureResponse_44(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_58() { ThrowSuccessResponse(); } + void OnSuccessResponse_44() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackMandatoryAttributeColorTempPhysicalMaxMireds_59() + CHIP_ERROR TestReadsBackMandatoryAttributeColorTempPhysicalMaxMireds_45() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_59, OnFailureCallback_59, true)); + this, OnSuccessCallback_45, OnFailureCallback_45, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_59(CHIP_ERROR error) + void OnFailureResponse_45(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_59(uint16_t colorTempPhysicalMax) + void OnSuccessResponse_45(uint16_t colorTempPhysicalMax) { VerifyOrReturn(CheckValue("colorTempPhysicalMax", colorTempPhysicalMax, 65279U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeCoupleColorTempToLevelMinMireds_60() + CHIP_ERROR TestReadTheOptionalAttributeCoupleColorTempToLevelMinMireds_46() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7281,23 +6735,23 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_60, OnFailureCallback_60, true)); + this, OnSuccessCallback_46, OnFailureCallback_46, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_60(CHIP_ERROR error) + void OnFailureResponse_46(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_60(uint16_t coupleColorTempToLevelMinMireds) + void OnSuccessResponse_46(uint16_t coupleColorTempToLevelMinMireds) { VerifyOrReturn(CheckConstraintType("coupleColorTempToLevelMinMireds", "", "uint16")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeCoupleColorTempToLevelMinMireds_61() + CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeCoupleColorTempToLevelMinMireds_47() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7308,20 +6762,20 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - coupleColorTempToLevelMinMiredsArgument, this, OnSuccessCallback_61, OnFailureCallback_61)); + coupleColorTempToLevelMinMiredsArgument, this, OnSuccessCallback_47, OnFailureCallback_47)); return CHIP_NO_ERROR; } - void OnFailureResponse_61(CHIP_ERROR error) + void OnFailureResponse_47(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_61() { ThrowSuccessResponse(); } + void OnSuccessResponse_47() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackOptionalAttributeCoupleColorTempToLevelMinMireds_62() + CHIP_ERROR TestReadsBackOptionalAttributeCoupleColorTempToLevelMinMireds_48() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7329,24 +6783,24 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_62, OnFailureCallback_62, true)); + this, OnSuccessCallback_48, OnFailureCallback_48, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_62(CHIP_ERROR error) + void OnFailureResponse_48(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_62(uint16_t coupleColorTempToLevelMinMireds) + void OnSuccessResponse_48(uint16_t coupleColorTempToLevelMinMireds) { VerifyOrReturn(CheckValue("coupleColorTempToLevelMinMireds", coupleColorTempToLevelMinMireds, 0U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeStartUpColorTemperatureMireds_63() + CHIP_ERROR TestReadTheOptionalAttributeStartUpColorTemperatureMireds_49() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7354,17 +6808,17 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_63, OnFailureCallback_63, true)); + this, OnSuccessCallback_49, OnFailureCallback_49, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_63(CHIP_ERROR error) + void OnFailureResponse_49(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_63(uint16_t startUpColorTemperatureMireds) + void OnSuccessResponse_49(uint16_t startUpColorTemperatureMireds) { VerifyOrReturn(CheckConstraintType("startUpColorTemperatureMireds", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("startUpColorTemperatureMireds", startUpColorTemperatureMireds, 0U)); @@ -7372,7 +6826,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeStartUpColorTemperatureMireds_64() + CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeStartUpColorTemperatureMireds_50() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7383,19 +6837,19 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - startUpColorTemperatureMiredsArgument, this, OnSuccessCallback_64, OnFailureCallback_64)); + startUpColorTemperatureMiredsArgument, this, OnSuccessCallback_50, OnFailureCallback_50)); return CHIP_NO_ERROR; } - void OnFailureResponse_64(CHIP_ERROR error) + void OnFailureResponse_50(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_64() { NextTest(); } + void OnSuccessResponse_50() { NextTest(); } - CHIP_ERROR TestReadsBackOptionalAttributeStartUpColorTemperatureMireds_65() + CHIP_ERROR TestReadsBackOptionalAttributeStartUpColorTemperatureMireds_51() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7403,73 +6857,47 @@ class Test_TC_CC_2_1Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_65, OnFailureCallback_65, true)); + this, OnSuccessCallback_51, OnFailureCallback_51, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_65(CHIP_ERROR error) + void OnFailureResponse_51(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_65(uint16_t startUpColorTemperatureMireds) + void OnSuccessResponse_51(uint16_t startUpColorTemperatureMireds) { VerifyOrReturn(CheckValue("startUpColorTemperatureMireds", startUpColorTemperatureMireds, 0U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeRemainingTime_66() + CHIP_ERROR TestValidateConstraintsOfAttributeRemainingTime_52() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_66, OnFailureCallback_66, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_66(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_66(uint16_t remainingTime) - { - VerifyOrReturn(CheckValue("remainingTime", remainingTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRemainingTime_67() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_67, OnFailureCallback_67, true)); + this, OnSuccessCallback_52, OnFailureCallback_52, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_67(CHIP_ERROR error) + void OnFailureResponse_52(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_67(uint16_t remainingTime) + void OnSuccessResponse_52(uint16_t remainingTime) { VerifyOrReturn(CheckConstraintType("remainingTime", "", "uint16")); - VerifyOrReturn(CheckConstraintMinValue("remainingTime", remainingTime, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("remainingTime", remainingTime, 254U)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeRemainingTime_68() + CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeRemainingTime_53() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7479,61 +6907,61 @@ class Test_TC_CC_2_1Suite : public TestCommand remainingTimeArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - remainingTimeArgument, this, OnSuccessCallback_68, OnFailureCallback_68)); + remainingTimeArgument, this, OnSuccessCallback_53, OnFailureCallback_53)); return CHIP_NO_ERROR; } - void OnFailureResponse_68(CHIP_ERROR error) + void OnFailureResponse_53(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_68() { ThrowSuccessResponse(); } + void OnSuccessResponse_53() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackOptionalAttributeRemainingTime_69() + CHIP_ERROR TestReadsBackOptionalAttributeRemainingTime_54() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_69, OnFailureCallback_69, true)); + this, OnSuccessCallback_54, OnFailureCallback_54, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_69(CHIP_ERROR error) + void OnFailureResponse_54(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_69(uint16_t remainingTime) + void OnSuccessResponse_54(uint16_t remainingTime) { VerifyOrReturn(CheckValue("remainingTime", remainingTime, 0U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeDriftCompensation_70() + CHIP_ERROR TestReadTheOptionalAttributeDriftCompensation_55() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_70, OnFailureCallback_70, true)); + this, OnSuccessCallback_55, OnFailureCallback_55, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_70(CHIP_ERROR error) + void OnFailureResponse_55(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_70(uint8_t driftCompensation) + void OnSuccessResponse_55(uint8_t driftCompensation) { VerifyOrReturn(CheckConstraintType("driftCompensation", "", "enum8")); VerifyOrReturn(CheckConstraintMinValue("driftCompensation", driftCompensation, 0)); @@ -7541,7 +6969,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeDriftCompensation_71() + CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeDriftCompensation_56() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7551,68 +6979,68 @@ class Test_TC_CC_2_1Suite : public TestCommand driftCompensationArgument = 0; ReturnErrorOnFailure(cluster.WriteAttribute( - driftCompensationArgument, this, OnSuccessCallback_71, OnFailureCallback_71)); + driftCompensationArgument, this, OnSuccessCallback_56, OnFailureCallback_56)); return CHIP_NO_ERROR; } - void OnFailureResponse_71(CHIP_ERROR error) + void OnFailureResponse_56(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_71() { ThrowSuccessResponse(); } + void OnSuccessResponse_56() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackOptionalAttributeDriftCompensation_72() + CHIP_ERROR TestReadsBackOptionalAttributeDriftCompensation_57() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_72, OnFailureCallback_72, true)); + this, OnSuccessCallback_57, OnFailureCallback_57, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_72(CHIP_ERROR error) + void OnFailureResponse_57(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_72(uint8_t driftCompensation) + void OnSuccessResponse_57(uint8_t driftCompensation) { VerifyOrReturn(CheckValue("driftCompensation", driftCompensation, 0)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeCompensationText_73() + CHIP_ERROR TestReadTheOptionalAttributeCompensationText_58() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_73, OnFailureCallback_73, true)); + this, OnSuccessCallback_58, OnFailureCallback_58, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_73(CHIP_ERROR error) + void OnFailureResponse_58(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_73(chip::CharSpan compensationText) + void OnSuccessResponse_58(chip::CharSpan compensationText) { VerifyOrReturn(CheckConstraintType("compensationText", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("compensationText", compensationText.size(), 254)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeCompensationText_74() + CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeCompensationText_59() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7622,61 +7050,61 @@ class Test_TC_CC_2_1Suite : public TestCommand compensationTextArgument = chip::Span("garbage: not in length on purpose", 0); ReturnErrorOnFailure(cluster.WriteAttribute( - compensationTextArgument, this, OnSuccessCallback_74, OnFailureCallback_74)); + compensationTextArgument, this, OnSuccessCallback_59, OnFailureCallback_59)); return CHIP_NO_ERROR; } - void OnFailureResponse_74(CHIP_ERROR error) + void OnFailureResponse_59(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_74() { ThrowSuccessResponse(); } + void OnSuccessResponse_59() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackOptionalAttributeCompensationText_75() + CHIP_ERROR TestReadsBackOptionalAttributeCompensationText_60() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_75, OnFailureCallback_75, true)); + this, OnSuccessCallback_60, OnFailureCallback_60, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_75(CHIP_ERROR error) + void OnFailureResponse_60(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_75(chip::CharSpan compensationText) + void OnSuccessResponse_60(chip::CharSpan compensationText) { VerifyOrReturn(CheckValueAsString("compensationText", compensationText, chip::CharSpan("", 0))); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeNumberOfPrimaries_76() + CHIP_ERROR TestReadTheMandatoryAttributeNumberOfPrimaries_61() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_76, OnFailureCallback_76, true)); + this, OnSuccessCallback_61, OnFailureCallback_61, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_76(CHIP_ERROR error) + void OnFailureResponse_61(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_76(uint8_t numberOfPrimaries) + void OnSuccessResponse_61(uint8_t numberOfPrimaries) { VerifyOrReturn(CheckConstraintType("numberOfPrimaries", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("numberOfPrimaries", numberOfPrimaries, 0)); @@ -7684,7 +7112,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributeNumberOfPrimaries_77() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributeNumberOfPrimaries_62() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7694,61 +7122,61 @@ class Test_TC_CC_2_1Suite : public TestCommand numberOfPrimariesArgument = 0; ReturnErrorOnFailure(cluster.WriteAttribute( - numberOfPrimariesArgument, this, OnSuccessCallback_77, OnFailureCallback_77)); + numberOfPrimariesArgument, this, OnSuccessCallback_62, OnFailureCallback_62)); return CHIP_NO_ERROR; } - void OnFailureResponse_77(CHIP_ERROR error) + void OnFailureResponse_62(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_77() { ThrowSuccessResponse(); } + void OnSuccessResponse_62() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributeNumberOfPrimaries_78() + CHIP_ERROR TestReadBackTheMandatoryAttributeNumberOfPrimaries_63() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_78, OnFailureCallback_78, true)); + this, OnSuccessCallback_63, OnFailureCallback_63, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_78(CHIP_ERROR error) + void OnFailureResponse_63(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_78(uint8_t numberOfPrimaries) + void OnSuccessResponse_63(uint8_t numberOfPrimaries) { VerifyOrReturn(CheckValue("numberOfPrimaries", numberOfPrimaries, 0)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary1X_79() + CHIP_ERROR TestReadTheMandatoryAttributePrimary1X_64() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_79, OnFailureCallback_79, true)); + this, OnSuccessCallback_64, OnFailureCallback_64, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_79(CHIP_ERROR error) + void OnFailureResponse_64(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_79(uint16_t primary1X) + void OnSuccessResponse_64(uint16_t primary1X) { VerifyOrReturn(CheckConstraintType("primary1X", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary1X", primary1X, 0U)); @@ -7756,7 +7184,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary1X_80() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary1X_65() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7766,61 +7194,61 @@ class Test_TC_CC_2_1Suite : public TestCommand primary1XArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary1XArgument, this, OnSuccessCallback_80, OnFailureCallback_80)); + primary1XArgument, this, OnSuccessCallback_65, OnFailureCallback_65)); return CHIP_NO_ERROR; } - void OnFailureResponse_80(CHIP_ERROR error) + void OnFailureResponse_65(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_80() { ThrowSuccessResponse(); } + void OnSuccessResponse_65() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary1X_81() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary1X_66() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_81, OnFailureCallback_81, true)); + this, OnSuccessCallback_66, OnFailureCallback_66, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_81(CHIP_ERROR error) + void OnFailureResponse_66(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_81(uint16_t primary1X) + void OnSuccessResponse_66(uint16_t primary1X) { VerifyOrReturn(CheckValue("primary1X", primary1X, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary1Y_82() + CHIP_ERROR TestReadTheMandatoryAttributePrimary1Y_67() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_82, OnFailureCallback_82, true)); + this, OnSuccessCallback_67, OnFailureCallback_67, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_82(CHIP_ERROR error) + void OnFailureResponse_67(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_82(uint16_t primary1Y) + void OnSuccessResponse_67(uint16_t primary1Y) { VerifyOrReturn(CheckConstraintType("primary1Y", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary1Y", primary1Y, 0U)); @@ -7828,7 +7256,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary1Y_83() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary1Y_68() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7838,84 +7266,84 @@ class Test_TC_CC_2_1Suite : public TestCommand primary1YArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary1YArgument, this, OnSuccessCallback_83, OnFailureCallback_83)); + primary1YArgument, this, OnSuccessCallback_68, OnFailureCallback_68)); return CHIP_NO_ERROR; } - void OnFailureResponse_83(CHIP_ERROR error) + void OnFailureResponse_68(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_83() { ThrowSuccessResponse(); } + void OnSuccessResponse_68() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary1Y_84() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary1Y_69() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_84, OnFailureCallback_84, true)); + this, OnSuccessCallback_69, OnFailureCallback_69, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_84(CHIP_ERROR error) + void OnFailureResponse_69(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_84(uint16_t primary1Y) + void OnSuccessResponse_69(uint16_t primary1Y) { VerifyOrReturn(CheckValue("primary1Y", primary1Y, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary1Intensity_85() + CHIP_ERROR TestReadTheMandatoryAttributePrimary1Intensity_70() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_85, OnFailureCallback_85, true)); + this, OnSuccessCallback_70, OnFailureCallback_70, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_85(CHIP_ERROR error) + void OnFailureResponse_70(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_85(uint8_t primary1Intensity) + void OnSuccessResponse_70(uint8_t primary1Intensity) { VerifyOrReturn(CheckConstraintType("primary1Intensity", "", "uint8")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary2X_86() + CHIP_ERROR TestReadTheMandatoryAttributePrimary2X_71() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_86, OnFailureCallback_86, true)); + this, OnSuccessCallback_71, OnFailureCallback_71, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_86(CHIP_ERROR error) + void OnFailureResponse_71(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_86(uint16_t primary2X) + void OnSuccessResponse_71(uint16_t primary2X) { VerifyOrReturn(CheckConstraintType("primary2X", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary2X", primary2X, 0U)); @@ -7923,7 +7351,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary2X_87() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary2X_72() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -7933,61 +7361,61 @@ class Test_TC_CC_2_1Suite : public TestCommand primary2XArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary2XArgument, this, OnSuccessCallback_87, OnFailureCallback_87)); + primary2XArgument, this, OnSuccessCallback_72, OnFailureCallback_72)); return CHIP_NO_ERROR; } - void OnFailureResponse_87(CHIP_ERROR error) + void OnFailureResponse_72(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_87() { ThrowSuccessResponse(); } + void OnSuccessResponse_72() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary2X_88() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary2X_73() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_88, OnFailureCallback_88, true)); + this, OnSuccessCallback_73, OnFailureCallback_73, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_88(CHIP_ERROR error) + void OnFailureResponse_73(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_88(uint16_t primary2X) + void OnSuccessResponse_73(uint16_t primary2X) { VerifyOrReturn(CheckValue("primary2X", primary2X, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary2Y_89() + CHIP_ERROR TestReadTheMandatoryAttributePrimary2Y_74() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_89, OnFailureCallback_89, true)); + this, OnSuccessCallback_74, OnFailureCallback_74, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_89(CHIP_ERROR error) + void OnFailureResponse_74(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_89(uint16_t primary2Y) + void OnSuccessResponse_74(uint16_t primary2Y) { VerifyOrReturn(CheckConstraintType("primary2Y", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary2Y", primary2Y, 0U)); @@ -7995,7 +7423,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary2Y_90() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary2Y_75() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8005,84 +7433,84 @@ class Test_TC_CC_2_1Suite : public TestCommand primary2YArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary2YArgument, this, OnSuccessCallback_90, OnFailureCallback_90)); + primary2YArgument, this, OnSuccessCallback_75, OnFailureCallback_75)); return CHIP_NO_ERROR; } - void OnFailureResponse_90(CHIP_ERROR error) + void OnFailureResponse_75(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_90() { ThrowSuccessResponse(); } + void OnSuccessResponse_75() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary2Y_91() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary2Y_76() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_91, OnFailureCallback_91, true)); + this, OnSuccessCallback_76, OnFailureCallback_76, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_91(CHIP_ERROR error) + void OnFailureResponse_76(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_91(uint16_t primary2Y) + void OnSuccessResponse_76(uint16_t primary2Y) { VerifyOrReturn(CheckValue("primary2Y", primary2Y, 0U)); NextTest(); } - CHIP_ERROR TestValidateConstraintsOfAttributePrimary2Intensity_92() + CHIP_ERROR TestValidateConstraintsOfAttributePrimary2Intensity_77() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_92, OnFailureCallback_92, true)); + this, OnSuccessCallback_77, OnFailureCallback_77, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_92(CHIP_ERROR error) + void OnFailureResponse_77(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_92(uint8_t primary2Intensity) + void OnSuccessResponse_77(uint8_t primary2Intensity) { VerifyOrReturn(CheckConstraintType("primary2Intensity", "", "uint8")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary3X_93() + CHIP_ERROR TestReadTheMandatoryAttributePrimary3X_78() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_93, OnFailureCallback_93, true)); + this, OnSuccessCallback_78, OnFailureCallback_78, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_93(CHIP_ERROR error) + void OnFailureResponse_78(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_93(uint16_t primary3X) + void OnSuccessResponse_78(uint16_t primary3X) { VerifyOrReturn(CheckConstraintType("primary3X", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary3X", primary3X, 0U)); @@ -8090,7 +7518,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary3X_94() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary3X_79() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8100,61 +7528,61 @@ class Test_TC_CC_2_1Suite : public TestCommand primary3XArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary3XArgument, this, OnSuccessCallback_94, OnFailureCallback_94)); + primary3XArgument, this, OnSuccessCallback_79, OnFailureCallback_79)); return CHIP_NO_ERROR; } - void OnFailureResponse_94(CHIP_ERROR error) + void OnFailureResponse_79(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_94() { ThrowSuccessResponse(); } + void OnSuccessResponse_79() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary3X_95() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary3X_80() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_95, OnFailureCallback_95, true)); + this, OnSuccessCallback_80, OnFailureCallback_80, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_95(CHIP_ERROR error) + void OnFailureResponse_80(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_95(uint16_t primary3X) + void OnSuccessResponse_80(uint16_t primary3X) { VerifyOrReturn(CheckValue("primary3X", primary3X, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary3Y_96() + CHIP_ERROR TestReadTheMandatoryAttributePrimary3Y_81() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_96, OnFailureCallback_96, true)); + this, OnSuccessCallback_81, OnFailureCallback_81, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_96(CHIP_ERROR error) + void OnFailureResponse_81(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_96(uint16_t primary3Y) + void OnSuccessResponse_81(uint16_t primary3Y) { VerifyOrReturn(CheckConstraintType("primary3Y", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary3Y", primary3Y, 0U)); @@ -8162,7 +7590,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary3Y_97() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary3Y_82() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8172,84 +7600,84 @@ class Test_TC_CC_2_1Suite : public TestCommand primary3YArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary3YArgument, this, OnSuccessCallback_97, OnFailureCallback_97)); + primary3YArgument, this, OnSuccessCallback_82, OnFailureCallback_82)); return CHIP_NO_ERROR; } - void OnFailureResponse_97(CHIP_ERROR error) + void OnFailureResponse_82(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_97() { ThrowSuccessResponse(); } + void OnSuccessResponse_82() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary3Y_98() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary3Y_83() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_98, OnFailureCallback_98, true)); + this, OnSuccessCallback_83, OnFailureCallback_83, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_98(CHIP_ERROR error) + void OnFailureResponse_83(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_98(uint16_t primary3Y) + void OnSuccessResponse_83(uint16_t primary3Y) { VerifyOrReturn(CheckValue("primary3Y", primary3Y, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary3Intensity_99() + CHIP_ERROR TestReadTheMandatoryAttributePrimary3Intensity_84() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_99, OnFailureCallback_99, true)); + this, OnSuccessCallback_84, OnFailureCallback_84, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_99(CHIP_ERROR error) + void OnFailureResponse_84(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_99(uint8_t primary3Intensity) + void OnSuccessResponse_84(uint8_t primary3Intensity) { VerifyOrReturn(CheckConstraintType("primary3Intensity", "", "uint8")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary4X_100() + CHIP_ERROR TestReadTheMandatoryAttributePrimary4X_85() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_100, OnFailureCallback_100, true)); + this, OnSuccessCallback_85, OnFailureCallback_85, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_100(CHIP_ERROR error) + void OnFailureResponse_85(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_100(uint16_t primary4X) + void OnSuccessResponse_85(uint16_t primary4X) { VerifyOrReturn(CheckConstraintType("primary4X", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary4X", primary4X, 0U)); @@ -8257,7 +7685,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary4X_101() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary4X_86() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8267,61 +7695,61 @@ class Test_TC_CC_2_1Suite : public TestCommand primary4XArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary4XArgument, this, OnSuccessCallback_101, OnFailureCallback_101)); + primary4XArgument, this, OnSuccessCallback_86, OnFailureCallback_86)); return CHIP_NO_ERROR; } - void OnFailureResponse_101(CHIP_ERROR error) + void OnFailureResponse_86(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_101() { ThrowSuccessResponse(); } + void OnSuccessResponse_86() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary4X_102() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary4X_87() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_102, OnFailureCallback_102, true)); + this, OnSuccessCallback_87, OnFailureCallback_87, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_102(CHIP_ERROR error) + void OnFailureResponse_87(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_102(uint16_t primary4X) + void OnSuccessResponse_87(uint16_t primary4X) { VerifyOrReturn(CheckValue("primary4X", primary4X, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary4Y_103() + CHIP_ERROR TestReadTheMandatoryAttributePrimary4Y_88() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_103, OnFailureCallback_103, true)); + this, OnSuccessCallback_88, OnFailureCallback_88, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_103(CHIP_ERROR error) + void OnFailureResponse_88(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_103(uint16_t primary4Y) + void OnSuccessResponse_88(uint16_t primary4Y) { VerifyOrReturn(CheckConstraintType("primary4Y", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary4Y", primary4Y, 0U)); @@ -8329,7 +7757,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary4Y_104() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary4Y_89() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8339,84 +7767,84 @@ class Test_TC_CC_2_1Suite : public TestCommand primary4YArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary4YArgument, this, OnSuccessCallback_104, OnFailureCallback_104)); + primary4YArgument, this, OnSuccessCallback_89, OnFailureCallback_89)); return CHIP_NO_ERROR; } - void OnFailureResponse_104(CHIP_ERROR error) + void OnFailureResponse_89(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_104() { ThrowSuccessResponse(); } + void OnSuccessResponse_89() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary4Y_105() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary4Y_90() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_105, OnFailureCallback_105, true)); + this, OnSuccessCallback_90, OnFailureCallback_90, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_105(CHIP_ERROR error) + void OnFailureResponse_90(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_105(uint16_t primary4Y) + void OnSuccessResponse_90(uint16_t primary4Y) { VerifyOrReturn(CheckValue("primary4Y", primary4Y, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary4Intensity_106() + CHIP_ERROR TestReadTheMandatoryAttributePrimary4Intensity_91() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_106, OnFailureCallback_106, true)); + this, OnSuccessCallback_91, OnFailureCallback_91, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_106(CHIP_ERROR error) + void OnFailureResponse_91(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_106(uint8_t primary4Intensity) + void OnSuccessResponse_91(uint8_t primary4Intensity) { VerifyOrReturn(CheckConstraintType("primary4Intensity", "", "uint8")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary5X_107() + CHIP_ERROR TestReadTheMandatoryAttributePrimary5X_92() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_107, OnFailureCallback_107, true)); + this, OnSuccessCallback_92, OnFailureCallback_92, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_107(CHIP_ERROR error) + void OnFailureResponse_92(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_107(uint16_t primary5X) + void OnSuccessResponse_92(uint16_t primary5X) { VerifyOrReturn(CheckConstraintType("primary5X", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary5X", primary5X, 0U)); @@ -8424,7 +7852,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary5X_108() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary5X_93() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8434,61 +7862,61 @@ class Test_TC_CC_2_1Suite : public TestCommand primary5XArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary5XArgument, this, OnSuccessCallback_108, OnFailureCallback_108)); + primary5XArgument, this, OnSuccessCallback_93, OnFailureCallback_93)); return CHIP_NO_ERROR; } - void OnFailureResponse_108(CHIP_ERROR error) + void OnFailureResponse_93(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_108() { ThrowSuccessResponse(); } + void OnSuccessResponse_93() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary5X_109() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary5X_94() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_109, OnFailureCallback_109, true)); + this, OnSuccessCallback_94, OnFailureCallback_94, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_109(CHIP_ERROR error) + void OnFailureResponse_94(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_109(uint16_t primary5X) + void OnSuccessResponse_94(uint16_t primary5X) { VerifyOrReturn(CheckValue("primary5X", primary5X, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary5Y_110() + CHIP_ERROR TestReadTheMandatoryAttributePrimary5Y_95() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_110, OnFailureCallback_110, true)); + this, OnSuccessCallback_95, OnFailureCallback_95, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_110(CHIP_ERROR error) + void OnFailureResponse_95(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_110(uint16_t primary5Y) + void OnSuccessResponse_95(uint16_t primary5Y) { VerifyOrReturn(CheckConstraintType("primary5Y", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary5Y", primary5Y, 0U)); @@ -8496,7 +7924,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary5Y_111() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary5Y_96() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8506,84 +7934,84 @@ class Test_TC_CC_2_1Suite : public TestCommand primary5YArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary5YArgument, this, OnSuccessCallback_111, OnFailureCallback_111)); + primary5YArgument, this, OnSuccessCallback_96, OnFailureCallback_96)); return CHIP_NO_ERROR; } - void OnFailureResponse_111(CHIP_ERROR error) + void OnFailureResponse_96(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_111() { ThrowSuccessResponse(); } + void OnSuccessResponse_96() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary5Y_112() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary5Y_97() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_112, OnFailureCallback_112, true)); + this, OnSuccessCallback_97, OnFailureCallback_97, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_112(CHIP_ERROR error) + void OnFailureResponse_97(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_112(uint16_t primary5Y) + void OnSuccessResponse_97(uint16_t primary5Y) { VerifyOrReturn(CheckValue("primary5Y", primary5Y, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary5Intensity_113() + CHIP_ERROR TestReadTheMandatoryAttributePrimary5Intensity_98() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_113, OnFailureCallback_113, true)); + this, OnSuccessCallback_98, OnFailureCallback_98, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_113(CHIP_ERROR error) + void OnFailureResponse_98(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_113(uint8_t primary5Intensity) + void OnSuccessResponse_98(uint8_t primary5Intensity) { VerifyOrReturn(CheckConstraintType("primary5Intensity", "", "uint8")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary6X_114() + CHIP_ERROR TestReadTheMandatoryAttributePrimary6X_99() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_114, OnFailureCallback_114, true)); + this, OnSuccessCallback_99, OnFailureCallback_99, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_114(CHIP_ERROR error) + void OnFailureResponse_99(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_114(uint16_t primary6X) + void OnSuccessResponse_99(uint16_t primary6X) { VerifyOrReturn(CheckConstraintType("primary6X", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary6X", primary6X, 0U)); @@ -8591,7 +8019,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary6X_115() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary6X_100() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8601,61 +8029,61 @@ class Test_TC_CC_2_1Suite : public TestCommand primary6XArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary6XArgument, this, OnSuccessCallback_115, OnFailureCallback_115)); + primary6XArgument, this, OnSuccessCallback_100, OnFailureCallback_100)); return CHIP_NO_ERROR; } - void OnFailureResponse_115(CHIP_ERROR error) + void OnFailureResponse_100(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_115() { ThrowSuccessResponse(); } + void OnSuccessResponse_100() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary6X_116() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary6X_101() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_116, OnFailureCallback_116, true)); + this, OnSuccessCallback_101, OnFailureCallback_101, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_116(CHIP_ERROR error) + void OnFailureResponse_101(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_116(uint16_t primary6X) + void OnSuccessResponse_101(uint16_t primary6X) { VerifyOrReturn(CheckValue("primary6X", primary6X, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary6Y_117() + CHIP_ERROR TestReadTheMandatoryAttributePrimary6Y_102() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_117, OnFailureCallback_117, true)); + this, OnSuccessCallback_102, OnFailureCallback_102, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_117(CHIP_ERROR error) + void OnFailureResponse_102(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_117(uint16_t primary6Y) + void OnSuccessResponse_102(uint16_t primary6Y) { VerifyOrReturn(CheckConstraintType("primary6Y", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("primary6Y", primary6Y, 0U)); @@ -8663,7 +8091,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary6Y_118() + CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary6Y_103() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8673,84 +8101,84 @@ class Test_TC_CC_2_1Suite : public TestCommand primary6YArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - primary6YArgument, this, OnSuccessCallback_118, OnFailureCallback_118)); + primary6YArgument, this, OnSuccessCallback_103, OnFailureCallback_103)); return CHIP_NO_ERROR; } - void OnFailureResponse_118(CHIP_ERROR error) + void OnFailureResponse_103(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_118() { ThrowSuccessResponse(); } + void OnSuccessResponse_103() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary6Y_119() + CHIP_ERROR TestReadBackTheMandatoryAttributePrimary6Y_104() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_119, OnFailureCallback_119, true)); + this, OnSuccessCallback_104, OnFailureCallback_104, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_119(CHIP_ERROR error) + void OnFailureResponse_104(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_119(uint16_t primary6Y) + void OnSuccessResponse_104(uint16_t primary6Y) { VerifyOrReturn(CheckValue("primary6Y", primary6Y, 0U)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributePrimary6Intensity_120() + CHIP_ERROR TestReadTheMandatoryAttributePrimary6Intensity_105() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_120, OnFailureCallback_120, true)); + this, OnSuccessCallback_105, OnFailureCallback_105, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_120(CHIP_ERROR error) + void OnFailureResponse_105(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_120(uint8_t primary6Intensity) + void OnSuccessResponse_105(uint8_t primary6Intensity) { VerifyOrReturn(CheckConstraintType("primary6Intensity", "", "uint8")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeWhitePointX_121() + CHIP_ERROR TestReadTheOptionalAttributeWhitePointX_106() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_121, OnFailureCallback_121, true)); + this, OnSuccessCallback_106, OnFailureCallback_106, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_121(CHIP_ERROR error) + void OnFailureResponse_106(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_121(uint16_t whitePointX) + void OnSuccessResponse_106(uint16_t whitePointX) { VerifyOrReturn(CheckConstraintType("whitePointX", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("whitePointX", whitePointX, 0U)); @@ -8758,7 +8186,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultOptionalAttributeWhitePointX_122() + CHIP_ERROR TestWriteTheDefaultOptionalAttributeWhitePointX_107() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8768,60 +8196,60 @@ class Test_TC_CC_2_1Suite : public TestCommand whitePointXArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - whitePointXArgument, this, OnSuccessCallback_122, OnFailureCallback_122)); + whitePointXArgument, this, OnSuccessCallback_107, OnFailureCallback_107)); return CHIP_NO_ERROR; } - void OnFailureResponse_122(CHIP_ERROR error) + void OnFailureResponse_107(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_122() { NextTest(); } + void OnSuccessResponse_107() { NextTest(); } - CHIP_ERROR TestReadBackTheOptionalAttributeWhitePointX_123() + CHIP_ERROR TestReadBackTheOptionalAttributeWhitePointX_108() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_123, OnFailureCallback_123, true)); + this, OnSuccessCallback_108, OnFailureCallback_108, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_123(CHIP_ERROR error) + void OnFailureResponse_108(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_123(uint16_t whitePointX) + void OnSuccessResponse_108(uint16_t whitePointX) { VerifyOrReturn(CheckValue("whitePointX", whitePointX, 0U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeWhitePointY_124() + CHIP_ERROR TestReadTheOptionalAttributeWhitePointY_109() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_124, OnFailureCallback_124, true)); + this, OnSuccessCallback_109, OnFailureCallback_109, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_124(CHIP_ERROR error) + void OnFailureResponse_109(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_124(uint16_t whitePointY) + void OnSuccessResponse_109(uint16_t whitePointY) { VerifyOrReturn(CheckConstraintType("whitePointY", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("whitePointY", whitePointY, 0U)); @@ -8829,7 +8257,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultOptionalAttributeWhitePointY_125() + CHIP_ERROR TestWriteTheDefaultOptionalAttributeWhitePointY_110() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8839,60 +8267,60 @@ class Test_TC_CC_2_1Suite : public TestCommand whitePointYArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - whitePointYArgument, this, OnSuccessCallback_125, OnFailureCallback_125)); + whitePointYArgument, this, OnSuccessCallback_110, OnFailureCallback_110)); return CHIP_NO_ERROR; } - void OnFailureResponse_125(CHIP_ERROR error) + void OnFailureResponse_110(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_125() { NextTest(); } + void OnSuccessResponse_110() { NextTest(); } - CHIP_ERROR TestReadBackTheOptionalAttributeWhitePointY_126() + CHIP_ERROR TestReadBackTheOptionalAttributeWhitePointY_111() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_126, OnFailureCallback_126, true)); + this, OnSuccessCallback_111, OnFailureCallback_111, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_126(CHIP_ERROR error) + void OnFailureResponse_111(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_126(uint16_t whitePointY) + void OnSuccessResponse_111(uint16_t whitePointY) { VerifyOrReturn(CheckValue("whitePointY", whitePointY, 0U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeColorPointRX_127() + CHIP_ERROR TestReadTheOptionalAttributeColorPointRX_112() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_127, OnFailureCallback_127, true)); + this, OnSuccessCallback_112, OnFailureCallback_112, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_127(CHIP_ERROR error) + void OnFailureResponse_112(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_127(uint16_t colorPointRX) + void OnSuccessResponse_112(uint16_t colorPointRX) { VerifyOrReturn(CheckConstraintType("colorPointRX", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("colorPointRX", colorPointRX, 0U)); @@ -8900,7 +8328,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRX_128() + CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRX_113() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8910,60 +8338,60 @@ class Test_TC_CC_2_1Suite : public TestCommand colorPointRXArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointRXArgument, this, OnSuccessCallback_128, OnFailureCallback_128)); + colorPointRXArgument, this, OnSuccessCallback_113, OnFailureCallback_113)); return CHIP_NO_ERROR; } - void OnFailureResponse_128(CHIP_ERROR error) + void OnFailureResponse_113(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_128() { NextTest(); } + void OnSuccessResponse_113() { NextTest(); } - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRX_129() + CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRX_114() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_129, OnFailureCallback_129, true)); + this, OnSuccessCallback_114, OnFailureCallback_114, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_129(CHIP_ERROR error) + void OnFailureResponse_114(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_129(uint16_t colorPointRX) + void OnSuccessResponse_114(uint16_t colorPointRX) { VerifyOrReturn(CheckValue("colorPointRX", colorPointRX, 0U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeColorPointRY_130() + CHIP_ERROR TestReadTheOptionalAttributeColorPointRY_115() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_130, OnFailureCallback_130, true)); + this, OnSuccessCallback_115, OnFailureCallback_115, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_130(CHIP_ERROR error) + void OnFailureResponse_115(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_130(uint16_t colorPointRY) + void OnSuccessResponse_115(uint16_t colorPointRY) { VerifyOrReturn(CheckConstraintType("colorPointRY", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("colorPointRY", colorPointRY, 0U)); @@ -8971,7 +8399,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRY_131() + CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRY_116() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -8981,66 +8409,66 @@ class Test_TC_CC_2_1Suite : public TestCommand colorPointRYArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointRYArgument, this, OnSuccessCallback_131, OnFailureCallback_131)); + colorPointRYArgument, this, OnSuccessCallback_116, OnFailureCallback_116)); return CHIP_NO_ERROR; } - void OnFailureResponse_131(CHIP_ERROR error) + void OnFailureResponse_116(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_131() { NextTest(); } + void OnSuccessResponse_116() { NextTest(); } - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRY_132() + CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRY_117() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_132, OnFailureCallback_132, true)); + this, OnSuccessCallback_117, OnFailureCallback_117, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_132(CHIP_ERROR error) + void OnFailureResponse_117(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_132(uint16_t colorPointRY) + void OnSuccessResponse_117(uint16_t colorPointRY) { VerifyOrReturn(CheckValue("colorPointRY", colorPointRY, 0U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeColorPointRIntensity_133() + CHIP_ERROR TestReadTheOptionalAttributeColorPointRIntensity_118() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_133, OnFailureCallback_133, true)); + this, OnSuccessCallback_118, OnFailureCallback_118, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_133(CHIP_ERROR error) + void OnFailureResponse_118(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_133(uint8_t colorPointRIntensity) + void OnSuccessResponse_118(uint8_t colorPointRIntensity) { VerifyOrReturn(CheckConstraintType("colorPointRIntensity", "", "uint8")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRIntensity_134() + CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRIntensity_119() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -9050,60 +8478,60 @@ class Test_TC_CC_2_1Suite : public TestCommand colorPointRIntensityArgument = 0; ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointRIntensityArgument, this, OnSuccessCallback_134, OnFailureCallback_134)); + colorPointRIntensityArgument, this, OnSuccessCallback_119, OnFailureCallback_119)); return CHIP_NO_ERROR; } - void OnFailureResponse_134(CHIP_ERROR error) + void OnFailureResponse_119(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_134() { NextTest(); } + void OnSuccessResponse_119() { NextTest(); } - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRIntensity_135() + CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRIntensity_120() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_135, OnFailureCallback_135, true)); + this, OnSuccessCallback_120, OnFailureCallback_120, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_135(CHIP_ERROR error) + void OnFailureResponse_120(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_135(uint8_t colorPointRIntensity) + void OnSuccessResponse_120(uint8_t colorPointRIntensity) { VerifyOrReturn(CheckValue("colorPointRIntensity", colorPointRIntensity, 0)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeColorPointGX_136() + CHIP_ERROR TestReadTheOptionalAttributeColorPointGX_121() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_136, OnFailureCallback_136, true)); + this, OnSuccessCallback_121, OnFailureCallback_121, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_136(CHIP_ERROR error) + void OnFailureResponse_121(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_136(uint16_t colorPointGX) + void OnSuccessResponse_121(uint16_t colorPointGX) { VerifyOrReturn(CheckConstraintType("colorPointGX", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("colorPointGX", colorPointGX, 0U)); @@ -9111,7 +8539,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGX_137() + CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGX_122() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -9121,60 +8549,60 @@ class Test_TC_CC_2_1Suite : public TestCommand colorPointGXArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointGXArgument, this, OnSuccessCallback_137, OnFailureCallback_137)); + colorPointGXArgument, this, OnSuccessCallback_122, OnFailureCallback_122)); return CHIP_NO_ERROR; } - void OnFailureResponse_137(CHIP_ERROR error) + void OnFailureResponse_122(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_137() { NextTest(); } + void OnSuccessResponse_122() { NextTest(); } - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGX_138() + CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGX_123() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_138, OnFailureCallback_138, true)); + this, OnSuccessCallback_123, OnFailureCallback_123, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_138(CHIP_ERROR error) + void OnFailureResponse_123(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_138(uint16_t colorPointGX) + void OnSuccessResponse_123(uint16_t colorPointGX) { VerifyOrReturn(CheckValue("colorPointGX", colorPointGX, 0U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeColorPointGY_139() + CHIP_ERROR TestReadTheOptionalAttributeColorPointGY_124() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_139, OnFailureCallback_139, true)); + this, OnSuccessCallback_124, OnFailureCallback_124, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_139(CHIP_ERROR error) + void OnFailureResponse_124(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_139(uint16_t colorPointGY) + void OnSuccessResponse_124(uint16_t colorPointGY) { VerifyOrReturn(CheckConstraintType("colorPointGY", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("colorPointGY", colorPointGY, 0U)); @@ -9182,7 +8610,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGY_140() + CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGY_125() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -9192,66 +8620,66 @@ class Test_TC_CC_2_1Suite : public TestCommand colorPointGYArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointGYArgument, this, OnSuccessCallback_140, OnFailureCallback_140)); + colorPointGYArgument, this, OnSuccessCallback_125, OnFailureCallback_125)); return CHIP_NO_ERROR; } - void OnFailureResponse_140(CHIP_ERROR error) + void OnFailureResponse_125(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_140() { NextTest(); } + void OnSuccessResponse_125() { NextTest(); } - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGY_141() + CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGY_126() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_141, OnFailureCallback_141, true)); + this, OnSuccessCallback_126, OnFailureCallback_126, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_141(CHIP_ERROR error) + void OnFailureResponse_126(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_141(uint16_t colorPointGY) + void OnSuccessResponse_126(uint16_t colorPointGY) { VerifyOrReturn(CheckValue("colorPointGY", colorPointGY, 0U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeColorPointGIntensity_142() + CHIP_ERROR TestReadTheOptionalAttributeColorPointGIntensity_127() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_142, OnFailureCallback_142, true)); + this, OnSuccessCallback_127, OnFailureCallback_127, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_142(CHIP_ERROR error) + void OnFailureResponse_127(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_142(uint8_t colorPointGIntensity) + void OnSuccessResponse_127(uint8_t colorPointGIntensity) { VerifyOrReturn(CheckConstraintType("colorPointGIntensity", "", "uint8")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGIntensity_143() + CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGIntensity_128() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -9261,60 +8689,60 @@ class Test_TC_CC_2_1Suite : public TestCommand colorPointGIntensityArgument = 0; ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointGIntensityArgument, this, OnSuccessCallback_143, OnFailureCallback_143)); + colorPointGIntensityArgument, this, OnSuccessCallback_128, OnFailureCallback_128)); return CHIP_NO_ERROR; } - void OnFailureResponse_143(CHIP_ERROR error) + void OnFailureResponse_128(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_143() { NextTest(); } + void OnSuccessResponse_128() { NextTest(); } - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGIntensity_144() + CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGIntensity_129() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_144, OnFailureCallback_144, true)); + this, OnSuccessCallback_129, OnFailureCallback_129, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_144(CHIP_ERROR error) + void OnFailureResponse_129(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_144(uint8_t colorPointGIntensity) + void OnSuccessResponse_129(uint8_t colorPointGIntensity) { VerifyOrReturn(CheckValue("colorPointGIntensity", colorPointGIntensity, 0)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeColorPointBX_145() + CHIP_ERROR TestReadTheOptionalAttributeColorPointBX_130() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_145, OnFailureCallback_145, true)); + this, OnSuccessCallback_130, OnFailureCallback_130, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_145(CHIP_ERROR error) + void OnFailureResponse_130(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_145(uint16_t colorPointBX) + void OnSuccessResponse_130(uint16_t colorPointBX) { VerifyOrReturn(CheckConstraintType("colorPointBX", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("colorPointBX", colorPointBX, 0U)); @@ -9322,7 +8750,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBX_146() + CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBX_131() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -9332,60 +8760,60 @@ class Test_TC_CC_2_1Suite : public TestCommand colorPointBXArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointBXArgument, this, OnSuccessCallback_146, OnFailureCallback_146)); + colorPointBXArgument, this, OnSuccessCallback_131, OnFailureCallback_131)); return CHIP_NO_ERROR; } - void OnFailureResponse_146(CHIP_ERROR error) + void OnFailureResponse_131(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_146() { NextTest(); } + void OnSuccessResponse_131() { NextTest(); } - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBX_147() + CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBX_132() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_147, OnFailureCallback_147, true)); + this, OnSuccessCallback_132, OnFailureCallback_132, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_147(CHIP_ERROR error) + void OnFailureResponse_132(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_147(uint16_t colorPointBX) + void OnSuccessResponse_132(uint16_t colorPointBX) { VerifyOrReturn(CheckValue("colorPointBX", colorPointBX, 0U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeColorPointBY_148() + CHIP_ERROR TestReadTheOptionalAttributeColorPointBY_133() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_148, OnFailureCallback_148, true)); + this, OnSuccessCallback_133, OnFailureCallback_133, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_148(CHIP_ERROR error) + void OnFailureResponse_133(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_148(uint16_t colorPointBY) + void OnSuccessResponse_133(uint16_t colorPointBY) { VerifyOrReturn(CheckConstraintType("colorPointBY", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("colorPointBY", colorPointBY, 0U)); @@ -9393,7 +8821,7 @@ class Test_TC_CC_2_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBY_149() + CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBY_134() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -9403,66 +8831,66 @@ class Test_TC_CC_2_1Suite : public TestCommand colorPointBYArgument = 0U; ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointBYArgument, this, OnSuccessCallback_149, OnFailureCallback_149)); + colorPointBYArgument, this, OnSuccessCallback_134, OnFailureCallback_134)); return CHIP_NO_ERROR; } - void OnFailureResponse_149(CHIP_ERROR error) + void OnFailureResponse_134(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_149() { NextTest(); } + void OnSuccessResponse_134() { NextTest(); } - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBY_150() + CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBY_135() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_150, OnFailureCallback_150, true)); + this, OnSuccessCallback_135, OnFailureCallback_135, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_150(CHIP_ERROR error) + void OnFailureResponse_135(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_150(uint16_t colorPointBY) + void OnSuccessResponse_135(uint16_t colorPointBY) { VerifyOrReturn(CheckValue("colorPointBY", colorPointBY, 0U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeColorPointBIntensity_151() + CHIP_ERROR TestReadTheOptionalAttributeColorPointBIntensity_136() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_151, OnFailureCallback_151, true)); + this, OnSuccessCallback_136, OnFailureCallback_136, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_151(CHIP_ERROR error) + void OnFailureResponse_136(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_151(uint8_t colorPointBIntensity) + void OnSuccessResponse_136(uint8_t colorPointBIntensity) { VerifyOrReturn(CheckConstraintType("colorPointBIntensity", "", "uint8")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBIntensity_152() + CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBIntensity_137() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -9472,36 +8900,36 @@ class Test_TC_CC_2_1Suite : public TestCommand colorPointBIntensityArgument = 0; ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointBIntensityArgument, this, OnSuccessCallback_152, OnFailureCallback_152)); + colorPointBIntensityArgument, this, OnSuccessCallback_137, OnFailureCallback_137)); return CHIP_NO_ERROR; } - void OnFailureResponse_152(CHIP_ERROR error) + void OnFailureResponse_137(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_152() { NextTest(); } + void OnSuccessResponse_137() { NextTest(); } - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBIntensity_153() + CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBIntensity_138() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_153, OnFailureCallback_153, true)); + this, OnSuccessCallback_138, OnFailureCallback_138, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_153(CHIP_ERROR error) + void OnFailureResponse_138(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_153(uint8_t colorPointBIntensity) + void OnSuccessResponse_138(uint8_t colorPointBIntensity) { VerifyOrReturn(CheckValue("colorPointBIntensity", colorPointBIntensity, 0)); @@ -32367,60 +31795,20 @@ class Test_TC_OO_2_1Suite : public TestCommand err = TestReadTheMandatoryAttributeOnOff_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : write the default value of mandatory attribute: OnOff\n"); - err = TestWriteTheDefaultValueOfMandatoryAttributeOnOff_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : read LT attribute: GlobalSceneControl\n"); + err = TestReadLtAttributeGlobalSceneControl_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : reads back mandatory attribute: OnOff\n"); - err = TestReadsBackMandatoryAttributeOnOff_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : read LT attribute: OnTime\n"); + err = TestReadLtAttributeOnTime_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read LT attribute: GlobalSceneControl\n"); - err = TestReadLtAttributeGlobalSceneControl_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : read LT attribute: OffWaitTime\n"); + err = TestReadLtAttributeOffWaitTime_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read LT attribute: OnTime\n"); - err = TestReadLtAttributeOnTime_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read LT attribute: OffWaitTime\n"); - err = TestReadLtAttributeOffWaitTime_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : read LT attribute: StartUpOnOff\n"); - err = TestReadLtAttributeStartUpOnOff_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : write the default value to LT attribute: GlobalSceneControl\n"); - err = TestWriteTheDefaultValueToLtAttributeGlobalSceneControl_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : write the default value to LT attribute: OnTime\n"); - err = TestWriteTheDefaultValueToLtAttributeOnTime_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : write the default value to LT attribute: OffWaitTime\n"); - err = TestWriteTheDefaultValueToLtAttributeOffWaitTime_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : write the default value to LT attribute: StartUpOnOff\n"); - err = TestWriteTheDefaultValueToLtAttributeStartUpOnOff_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : reads back LT attribute: GlobalSceneControl\n"); - err = TestReadsBackLtAttributeGlobalSceneControl_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : reads back LT attribute: OnTime\n"); - err = TestReadsBackLtAttributeOnTime_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : reads back LT attribute: OffWaitTime\n"); - err = TestReadsBackLtAttributeOffWaitTime_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : reads back LT attribute: StartUpOnOff\n"); - err = TestReadsBackLtAttributeStartUpOnOff_15(); + ChipLogProgress(chipTool, " ***** Test Step 5 : read LT attribute: StartUpOnOff\n"); + err = TestReadLtAttributeStartUpOnOff_5(); break; } @@ -32433,7 +31821,7 @@ class Test_TC_OO_2_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; + const uint16_t mTestCount = 6; chip::Optional mNodeId; chip::Optional mCluster; @@ -32462,16 +31850,19 @@ class Test_TC_OO_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context, bool globalSceneControl) + { + (static_cast(context))->OnSuccessResponse_2(globalSceneControl); + } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_3(void * context, bool onOff) + static void OnSuccessCallback_3(void * context, uint16_t onTime) { - (static_cast(context))->OnSuccessResponse_3(onOff); + (static_cast(context))->OnSuccessResponse_3(onTime); } static void OnFailureCallback_4(void * context, CHIP_ERROR error) @@ -32479,9 +31870,9 @@ class Test_TC_OO_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_4(error); } - static void OnSuccessCallback_4(void * context, bool globalSceneControl) + static void OnSuccessCallback_4(void * context, uint16_t offWaitTime) { - (static_cast(context))->OnSuccessResponse_4(globalSceneControl); + (static_cast(context))->OnSuccessResponse_4(offWaitTime); } static void OnFailureCallback_5(void * context, CHIP_ERROR error) @@ -32489,97 +31880,9 @@ class Test_TC_OO_2_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_5(error); } - static void OnSuccessCallback_5(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_5(onTime); - } - - static void OnFailureCallback_6(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_6(error); - } - - static void OnSuccessCallback_6(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_6(offWaitTime); - } - - static void OnFailureCallback_7(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_7(error); - } - - static void OnSuccessCallback_7(void * context, uint8_t startUpOnOff) - { - (static_cast(context))->OnSuccessResponse_7(startUpOnOff); - } - - static void OnFailureCallback_8(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_8(error); - } - - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_9(error); - } - - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } - - static void OnFailureCallback_10(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_10(error); - } - - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } - - static void OnFailureCallback_11(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_11(error); - } - - static void OnSuccessCallback_11(void * context) { (static_cast(context))->OnSuccessResponse_11(); } - - static void OnFailureCallback_12(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_12(error); - } - - static void OnSuccessCallback_12(void * context, bool globalSceneControl) - { - (static_cast(context))->OnSuccessResponse_12(globalSceneControl); - } - - static void OnFailureCallback_13(void * context, CHIP_ERROR error) + static void OnSuccessCallback_5(void * context, uint8_t startUpOnOff) { - (static_cast(context))->OnFailureResponse_13(error); - } - - static void OnSuccessCallback_13(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_13(onTime); - } - - static void OnFailureCallback_14(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_14(error); - } - - static void OnSuccessCallback_14(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_14(offWaitTime); - } - - static void OnFailureCallback_15(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_15(error); - } - - static void OnSuccessCallback_15(void * context, uint8_t startUpOnOff) - { - (static_cast(context))->OnSuccessResponse_15(startUpOnOff); + (static_cast(context))->OnSuccessResponse_5(startUpOnOff); } // @@ -32611,336 +31914,99 @@ class Test_TC_OO_2_1Suite : public TestCommand void OnSuccessResponse_1(bool onOff) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValueOfMandatoryAttributeOnOff_2() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool onOffArgument; - onOffArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - onOffArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + VerifyOrReturn(CheckConstraintType("onOff", "", "bool")); NextTest(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeOnOff_3() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_3(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadLtAttributeGlobalSceneControl_4() + CHIP_ERROR TestReadLtAttributeGlobalSceneControl_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_4(bool globalSceneControl) - { - VerifyOrReturn(CheckValue("globalSceneControl", globalSceneControl, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadLtAttributeOnTime_5() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_5(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadLtAttributeOffWaitTime_6() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_6(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadLtAttributeStartUpOnOff_7() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_7(uint8_t startUpOnOff) - { - VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeGlobalSceneControl_8() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool globalSceneControlArgument; - globalSceneControlArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - globalSceneControlArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_8() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOnTime_9() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t onTimeArgument; - onTimeArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - onTimeArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_9() { NextTest(); } - - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOffWaitTime_10() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t offWaitTimeArgument; - offWaitTimeArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - offWaitTimeArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_10() { NextTest(); } - - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeStartUpOnOff_11() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t startUpOnOffArgument; - startUpOnOffArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - startUpOnOffArgument, this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_11() { NextTest(); } - - CHIP_ERROR TestReadsBackLtAttributeGlobalSceneControl_12() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12, true)); + this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_12(CHIP_ERROR error) + void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_12(bool globalSceneControl) + void OnSuccessResponse_2(bool globalSceneControl) { - VerifyOrReturn(CheckValue("globalSceneControl", globalSceneControl, 1)); - + VerifyOrReturn(CheckConstraintType("globalSceneControl", "", "bool")); NextTest(); } - CHIP_ERROR TestReadsBackLtAttributeOnTime_13() + CHIP_ERROR TestReadLtAttributeOnTime_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13, true)); + this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_13(CHIP_ERROR error) + void OnFailureResponse_3(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_13(uint16_t onTime) + void OnSuccessResponse_3(uint16_t onTime) { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - + VerifyOrReturn(CheckConstraintType("onTime", "", "uint16")); NextTest(); } - CHIP_ERROR TestReadsBackLtAttributeOffWaitTime_14() + CHIP_ERROR TestReadLtAttributeOffWaitTime_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14, true)); + this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_14(CHIP_ERROR error) + void OnFailureResponse_4(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_14(uint16_t offWaitTime) + void OnSuccessResponse_4(uint16_t offWaitTime) { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - + VerifyOrReturn(CheckConstraintType("offWaitTime", "", "uint16")); NextTest(); } - CHIP_ERROR TestReadsBackLtAttributeStartUpOnOff_15() + CHIP_ERROR TestReadLtAttributeStartUpOnOff_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_15, OnFailureCallback_15, true)); + this, OnSuccessCallback_5, OnFailureCallback_5, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_15(CHIP_ERROR error) + void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_15(uint8_t startUpOnOff) + void OnSuccessResponse_5(uint8_t startUpOnOff) { - VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); - + VerifyOrReturn(CheckConstraintType("startUpOnOff", "", "enum8")); NextTest(); } }; @@ -33004,44 +32070,68 @@ class Test_TC_OO_2_2Suite : public TestCommand err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send Off Command\n"); - err = TestSendOffCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Send On Command\n"); + err = TestSendOnCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Send Toggle Command\n"); - err = TestSendToggleCommand_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Send Off Command\n"); + err = TestSendOffCommand_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is true after toggle command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Send Toggle Command\n"); - err = TestSendToggleCommand_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Send Off Command\n"); + err = TestSendOffCommand_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after toggle command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Send On Command\n"); - err = TestSendOnCommand_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Send Toggle Command\n"); + err = TestSendToggleCommand_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 1000ms\n"); + err = TestWait1000ms_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Send Off Command\n"); - err = TestSendOffCommand_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Check on/off attribute value is true after toggle command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Send Toggle Command\n"); + err = TestSendToggleCommand_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 1000ms\n"); + err = TestWait1000ms_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Check on/off attribute value is false after toggle command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : User prompt Set OnOff attribute manually to on\n"); + err = TestUserPromptSetOnOffAttributeManuallyToOn_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : User prompt Set OnOff attribute manually to off\n"); + err = TestUserPromptSetOnOffAttributeManuallyToOff_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Reset Off Command\n"); + err = TestResetOffCommand_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20(); break; } @@ -33054,7 +32144,7 @@ class Test_TC_OO_2_2Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 15; + const uint16_t mTestCount = 21; chip::Optional mNodeId; chip::Optional mCluster; @@ -33118,24 +32208,34 @@ class Test_TC_OO_2_2Suite : public TestCommand (static_cast(context))->OnSuccessResponse_10(onOff); } - static void OnFailureCallback_12(void * context, CHIP_ERROR error) + static void OnFailureCallback_13(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_12(error); + (static_cast(context))->OnFailureResponse_13(error); } - static void OnSuccessCallback_12(void * context, bool onOff) + static void OnSuccessCallback_13(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_12(onOff); + (static_cast(context))->OnSuccessResponse_13(onOff); } - static void OnFailureCallback_14(void * context, CHIP_ERROR error) + static void OnFailureCallback_16(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_14(error); + (static_cast(context))->OnFailureResponse_16(error); } - static void OnSuccessCallback_14(void * context, bool onOff) + static void OnSuccessCallback_16(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_14(onOff); + (static_cast(context))->OnSuccessResponse_16(onOff); + } + + static void OnFailureCallback_20(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_20(error); + } + + static void OnSuccessCallback_20(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_20(onOff); } // @@ -33250,10 +32350,10 @@ class Test_TC_OO_2_2Suite : public TestCommand NextTest(); } - CHIP_ERROR TestSendOffCommand_5() + CHIP_ERROR TestSendOnCommand_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -33277,7 +32377,7 @@ class Test_TC_OO_2_2Suite : public TestCommand void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; @@ -33296,15 +32396,15 @@ class Test_TC_OO_2_2Suite : public TestCommand void OnSuccessResponse_6(bool onOff) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestSendToggleCommand_7() + CHIP_ERROR TestSendOffCommand_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -33328,7 +32428,7 @@ class Test_TC_OO_2_2Suite : public TestCommand void OnSuccessResponse_7() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_8() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; @@ -33347,15 +32447,15 @@ class Test_TC_OO_2_2Suite : public TestCommand void OnSuccessResponse_8(bool onOff) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("onOff", onOff, 0)); NextTest(); } - CHIP_ERROR TestSendToggleCommand_9() + CHIP_ERROR TestSendOffCommand_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -33379,7 +32479,7 @@ class Test_TC_OO_2_2Suite : public TestCommand void OnSuccessResponse_9() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_10() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; @@ -33403,10 +32503,10 @@ class Test_TC_OO_2_2Suite : public TestCommand NextTest(); } - CHIP_ERROR TestSendOnCommand_11() + CHIP_ERROR TestSendToggleCommand_11() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + using RequestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; RequestType request; @@ -33430,31 +32530,106 @@ class Test_TC_OO_2_2Suite : public TestCommand void OnSuccessResponse_11() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_12() + CHIP_ERROR TestWait1000ms_12() + { + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_13() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12, true)); + this, OnSuccessCallback_13, OnFailureCallback_13, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_12(CHIP_ERROR error) + void OnFailureResponse_13(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_12(bool onOff) + void OnSuccessResponse_13(bool onOff) { VerifyOrReturn(CheckValue("onOff", onOff, 1)); NextTest(); } - CHIP_ERROR TestSendOffCommand_13() + CHIP_ERROR TestSendToggleCommand_14() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_14(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_14(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_14(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_14() { NextTest(); } + + CHIP_ERROR TestWait1000ms_15() + { + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_16() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_16, OnFailureCallback_16, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_16(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_16(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + + NextTest(); + } + + CHIP_ERROR TestUserPromptSetOnOffAttributeManuallyToOn_17() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operate on device to set OnOff attribute manually to on"); + } + + CHIP_ERROR TestUserPromptSetOnOffAttributeManuallyToOff_18() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operate on device to set OnOff attribute manually to off"); + } + + CHIP_ERROR TestResetOffCommand_19() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; @@ -33462,43 +32637,43 @@ class Test_TC_OO_2_2Suite : public TestCommand RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_13(); + (static_cast(context))->OnSuccessResponse_19(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_13(error); + (static_cast(context))->OnFailureResponse_19(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_13(CHIP_ERROR error) + void OnFailureResponse_19(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_13() { NextTest(); } + void OnSuccessResponse_19() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_14() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14, true)); + this, OnSuccessCallback_20, OnFailureCallback_20, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_14(CHIP_ERROR error) + void OnFailureResponse_20(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_14(bool onOff) + void OnSuccessResponse_20(bool onOff) { VerifyOrReturn(CheckValue("onOff", onOff, 0)); @@ -35656,206 +34831,18 @@ class Test_TC_PS_1_1Suite : public TestCommand } }; -class Test_TC_PRS_1_1Suite : public TestCommand -{ -public: - Test_TC_PRS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_PRS_1_1", credsIssuerConfig), mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - } - - ~Test_TC_PRS_1_1Suite() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : Write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute constraints: AttributeList\n"); - err = TestReadTheGlobalAttributeConstraintsAttributeList_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override - { - bool isExpectedDnssdResult = false; - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); - } - - static void OnFailureCallback_1(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_1(error); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_2(error); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_3(error); - } - - static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) - { - (static_cast(context))->OnSuccessResponse_3(attributeList); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 3U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsAttributeList_3() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) - { - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - NextTest(); - } -}; - -class Test_TC_PRS_2_1Suite : public TestCommand +class Test_TC_PS_2_1Suite : public TestCommand { public: - Test_TC_PRS_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_PRS_2_1", credsIssuerConfig), mTestIndex(0) + Test_TC_PS_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PS_2_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_PRS_2_1Suite() {} + ~Test_TC_PS_2_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -35864,12 +34851,12 @@ class Test_TC_PRS_2_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PS_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PS_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -35887,40 +34874,40 @@ class Test_TC_PRS_2_1Suite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the mandatory attribute constraints: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMeasuredValue_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Test Harness Client reads Status attribute from Server DUT\n"); + err = TestTestHarnessClientReadsStatusAttributeFromServerDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Write the default values to mandatory attribute: MeasuredValue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeMeasuredValue_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Test Harness Client reads Order attribute from Server DUT\n"); + err = TestTestHarnessClientReadsOrderAttributeFromServerDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads back mandatory attribute: MeasuredValue\n"); - err = TestReadsBackMandatoryAttributeMeasuredValue_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Test Harness Client reads Description attribute from Server DUT\n"); + err = TestTestHarnessClientReadsDescriptionAttributeFromServerDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the mandatory attribute constraints: MinMeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Test Harness Client reads BatVoltage from Server DUT\n"); + err = TestTestHarnessClientReadsBatVoltageFromServerDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write the default values to mandatory attribute: MinMeasuredValue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeMinMeasuredValue_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Test Harness Client reads BatPercentRemaining from Server DUT\n"); + err = TestTestHarnessClientReadsBatPercentRemainingFromServerDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads back mandatory attribute: MinMeasuredValue\n"); - err = TestReadsBackMandatoryAttributeMinMeasuredValue_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Test Harness Client reads BatTimeRemaining from Server DUT\n"); + err = TestTestHarnessClientReadsBatTimeRemainingFromServerDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the mandatory attribute constraints: MaxMeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Test Harness Client reads BatChargeLevel from Server DUT\n"); + err = TestTestHarnessClientReadsBatChargeLevelFromServerDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write the default values to mandatory attribute: MaxMeasuredValue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeMaxMeasuredValue_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Test Harness Client reads ActiveBatFaults from Server DUT\n"); + err = TestTestHarnessClientReadsActiveBatFaultsFromServerDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads back mandatory attribute: MaxMeasuredValue\n"); - err = TestReadsBackMandatoryAttributeMaxMeasuredValue_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Test Harness Client reads BatChargeState from Server DUT\n"); + err = TestTestHarnessClientReadsBatChargeStateFromServerDut_9(); break; } @@ -35949,83 +34936,92 @@ class Test_TC_PRS_2_1Suite : public TestCommand static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_1(void * context, const chip::app::DataModel::Nullable & measuredValue) + static void OnSuccessCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnSuccessResponse_1(measuredValue); + (static_cast(context))->OnSuccessResponse_1(status); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context, uint8_t order) + { + (static_cast(context))->OnSuccessResponse_2(order); + } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_3(void * context, const chip::app::DataModel::Nullable & measuredValue) + static void OnSuccessCallback_3(void * context, chip::CharSpan description) { - (static_cast(context))->OnSuccessResponse_3(measuredValue); + (static_cast(context))->OnSuccessResponse_3(description); } static void OnFailureCallback_4(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_4(error); + (static_cast(context))->OnFailureResponse_4(error); } - static void OnSuccessCallback_4(void * context, const chip::app::DataModel::Nullable & minMeasuredValue) + static void OnSuccessCallback_4(void * context, uint32_t batteryVoltage) { - (static_cast(context))->OnSuccessResponse_4(minMeasuredValue); + (static_cast(context))->OnSuccessResponse_4(batteryVoltage); } static void OnFailureCallback_5(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_5(error); + (static_cast(context))->OnFailureResponse_5(error); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + static void OnSuccessCallback_5(void * context, uint8_t batteryPercentRemaining) + { + (static_cast(context))->OnSuccessResponse_5(batteryPercentRemaining); + } static void OnFailureCallback_6(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_6(error); + (static_cast(context))->OnFailureResponse_6(error); } - static void OnSuccessCallback_6(void * context, const chip::app::DataModel::Nullable & minMeasuredValue) + static void OnSuccessCallback_6(void * context, uint32_t batteryTimeRemaining) { - (static_cast(context))->OnSuccessResponse_6(minMeasuredValue); + (static_cast(context))->OnSuccessResponse_6(batteryTimeRemaining); } static void OnFailureCallback_7(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_7(error); + (static_cast(context))->OnFailureResponse_7(error); } - static void OnSuccessCallback_7(void * context, const chip::app::DataModel::Nullable & maxMeasuredValue) + static void OnSuccessCallback_7(void * context, uint8_t batteryChargeLevel) { - (static_cast(context))->OnSuccessResponse_7(maxMeasuredValue); + (static_cast(context))->OnSuccessResponse_7(batteryChargeLevel); } static void OnFailureCallback_8(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_8(error); + (static_cast(context))->OnFailureResponse_8(error); } - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + static void OnSuccessCallback_8(void * context, const chip::app::DataModel::DecodableList & activeBatteryFaults) + { + (static_cast(context))->OnSuccessResponse_8(activeBatteryFaults); + } static void OnFailureCallback_9(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_9(error); + (static_cast(context))->OnFailureResponse_9(error); } - static void OnSuccessCallback_9(void * context, const chip::app::DataModel::Nullable & maxMeasuredValue) + static void OnSuccessCallback_9(void * context, uint8_t batteryChargeState) { - (static_cast(context))->OnSuccessResponse_9(maxMeasuredValue); + (static_cast(context))->OnSuccessResponse_9(batteryChargeState); } // @@ -36038,13 +35034,13 @@ class Test_TC_PRS_2_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMeasuredValue_1() + CHIP_ERROR TestTestHarnessClientReadsStatusAttributeFromServerDut_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; + chip::Controller::PowerSourceClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } @@ -36055,43 +35051,44 @@ class Test_TC_PRS_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_1(const chip::app::DataModel::Nullable & measuredValue) + void OnSuccessResponse_1(uint8_t status) { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); + VerifyOrReturn(CheckConstraintType("status", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("status", status, 0)); + VerifyOrReturn(CheckConstraintMaxValue("status", status, 3)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMeasuredValue_2() + CHIP_ERROR TestTestHarnessClientReadsOrderAttributeFromServerDut_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; + chip::Controller::PowerSourceClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable measuredValueArgument; - measuredValueArgument.SetNonNull(); - measuredValueArgument.Value() = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - measuredValueArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + ThrowFailureResponse(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } + void OnSuccessResponse_2(uint8_t order) + { + VerifyOrReturn(CheckConstraintType("order", "", "uint8")); + NextTest(); + } - CHIP_ERROR TestReadsBackMandatoryAttributeMeasuredValue_3() + CHIP_ERROR TestTestHarnessClientReadsDescriptionAttributeFromServerDut_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; + chip::Controller::PowerSourceClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } @@ -36102,23 +35099,20 @@ class Test_TC_PRS_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_3(const chip::app::DataModel::Nullable & measuredValue) + void OnSuccessResponse_3(chip::CharSpan description) { - VerifyOrReturn(CheckValueNonNull("measuredValue", measuredValue)); - VerifyOrReturn(CheckValue("measuredValue.Value()", measuredValue.Value(), 0)); - + VerifyOrReturn(CheckConstraintType("description", "", "string")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_4() + CHIP_ERROR TestTestHarnessClientReadsBatVoltageFromServerDut_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; + chip::Controller::PowerSourceClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } @@ -36128,46 +35122,45 @@ class Test_TC_PRS_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_4(const chip::app::DataModel::Nullable & minMeasuredValue) + void OnSuccessResponse_4(uint32_t batteryVoltage) { - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); + VerifyOrReturn(CheckConstraintType("batteryVoltage", "", "uint32")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMinMeasuredValue_5() + CHIP_ERROR TestTestHarnessClientReadsBatPercentRemainingFromServerDut_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; + chip::Controller::PowerSourceClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable minMeasuredValueArgument; - minMeasuredValueArgument.SetNonNull(); - minMeasuredValueArgument.Value() = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - minMeasuredValueArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5, true)); return CHIP_NO_ERROR; } void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + ThrowFailureResponse(); } - void OnSuccessResponse_5() { ThrowSuccessResponse(); } + void OnSuccessResponse_5(uint8_t batteryPercentRemaining) + { + VerifyOrReturn(CheckConstraintType("batteryPercentRemaining", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("batteryPercentRemaining", batteryPercentRemaining, 0)); + VerifyOrReturn(CheckConstraintMaxValue("batteryPercentRemaining", batteryPercentRemaining, 200)); + NextTest(); + } - CHIP_ERROR TestReadsBackMandatoryAttributeMinMeasuredValue_6() + CHIP_ERROR TestTestHarnessClientReadsBatTimeRemainingFromServerDut_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; + chip::Controller::PowerSourceClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); return CHIP_NO_ERROR; } @@ -36177,23 +35170,20 @@ class Test_TC_PRS_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_6(const chip::app::DataModel::Nullable & minMeasuredValue) + void OnSuccessResponse_6(uint32_t batteryTimeRemaining) { - VerifyOrReturn(CheckValueNonNull("minMeasuredValue", minMeasuredValue)); - VerifyOrReturn(CheckValue("minMeasuredValue.Value()", minMeasuredValue.Value(), 0)); - + VerifyOrReturn(CheckConstraintType("batteryTimeRemaining", "", "uint32")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_7() + CHIP_ERROR TestTestHarnessClientReadsBatChargeLevelFromServerDut_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; + chip::Controller::PowerSourceClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7, true)); return CHIP_NO_ERROR; } @@ -36203,46 +35193,45 @@ class Test_TC_PRS_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_7(const chip::app::DataModel::Nullable & maxMeasuredValue) + void OnSuccessResponse_7(uint8_t batteryChargeLevel) { - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); + VerifyOrReturn(CheckConstraintType("batteryChargeLevel", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("batteryChargeLevel", batteryChargeLevel, 0)); + VerifyOrReturn(CheckConstraintMaxValue("batteryChargeLevel", batteryChargeLevel, 2)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMaxMeasuredValue_8() + CHIP_ERROR TestTestHarnessClientReadsActiveBatFaultsFromServerDut_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; + chip::Controller::PowerSourceClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable maxMeasuredValueArgument; - maxMeasuredValueArgument.SetNonNull(); - maxMeasuredValueArgument.Value() = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - maxMeasuredValueArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_8, OnFailureCallback_8, true)); return CHIP_NO_ERROR; } void OnFailureResponse_8(CHIP_ERROR error) { chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + ThrowFailureResponse(); } - void OnSuccessResponse_8() { ThrowSuccessResponse(); } + void OnSuccessResponse_8(const chip::app::DataModel::DecodableList & activeBatteryFaults) + { + VerifyOrReturn(CheckConstraintType("activeBatteryFaults", "", "list")); + NextTest(); + } - CHIP_ERROR TestReadsBackMandatoryAttributeMaxMeasuredValue_9() + CHIP_ERROR TestTestHarnessClientReadsBatChargeStateFromServerDut_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; + chip::Controller::PowerSourceClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_9, OnFailureCallback_9, true)); return CHIP_NO_ERROR; } @@ -36252,27 +35241,27 @@ class Test_TC_PRS_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_9(const chip::app::DataModel::Nullable & maxMeasuredValue) + void OnSuccessResponse_9(uint8_t batteryChargeState) { - VerifyOrReturn(CheckValueNonNull("maxMeasuredValue", maxMeasuredValue)); - VerifyOrReturn(CheckValue("maxMeasuredValue.Value()", maxMeasuredValue.Value(), 0)); - + VerifyOrReturn(CheckConstraintType("batteryChargeState", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("batteryChargeState", batteryChargeState, 0)); + VerifyOrReturn(CheckConstraintMaxValue("batteryChargeState", batteryChargeState, 3)); NextTest(); } }; -class Test_TC_PCC_1_1Suite : public TestCommand +class Test_TC_PRS_1_1Suite : public TestCommand { public: - Test_TC_PCC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_PCC_1_1", credsIssuerConfig), mTestIndex(0) + Test_TC_PRS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PRS_1_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_PCC_1_1Suite() {} + ~Test_TC_PRS_1_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -36281,12 +35270,12 @@ class Test_TC_PCC_1_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -36309,16 +35298,12 @@ class Test_TC_PCC_1_1Suite : public TestCommand break; case 2: ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + " ***** Test Step 2 : Write the default values to mandatory global attribute: ClusterRevision\n"); err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the optional global attribute: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_4(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute constraints: AttributeList\n"); + err = TestReadTheGlobalAttributeConstraintsAttributeList_3(); break; } @@ -36331,7 +35316,7 @@ class Test_TC_PCC_1_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; @@ -36347,39 +35332,29 @@ class Test_TC_PCC_1_1Suite : public TestCommand static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_1(error); } static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_3(error); } static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) { - (static_cast(context))->OnSuccessResponse_3(attributeList); - } - - static void OnFailureCallback_4(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_4(error); - } - - static void OnSuccessCallback_4(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_4(featureMap); + (static_cast(context))->OnSuccessResponse_3(attributeList); } // @@ -36395,12 +35370,11 @@ class Test_TC_PCC_1_1Suite : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; + chip::Controller::PressureMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } @@ -36419,14 +35393,14 @@ class Test_TC_PCC_1_1Suite : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; + chip::Controller::PressureMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 3U; ReturnErrorOnFailure( - cluster.WriteAttribute( + cluster.WriteAttribute( clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); return CHIP_NO_ERROR; } @@ -36440,15 +35414,14 @@ class Test_TC_PCC_1_1Suite : public TestCommand void OnSuccessResponse_2() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsAttributeList_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; + chip::Controller::PressureMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } @@ -36463,44 +35436,20 @@ class Test_TC_PCC_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); } - - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_4() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_4(uint32_t featureMap) - { - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - NextTest(); - } }; -class Test_TC_PCC_2_1Suite : public TestCommand +class Test_TC_PRS_2_1Suite : public TestCommand { public: - Test_TC_PCC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_PCC_2_1", credsIssuerConfig), mTestIndex(0) + Test_TC_PRS_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PRS_2_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_PCC_2_1Suite() {} + ~Test_TC_PRS_2_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -36509,12 +35458,12 @@ class Test_TC_PCC_2_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -36532,200 +35481,40 @@ class Test_TC_PCC_2_1Suite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the mandatory attribute constraints: MeasuredValue\n"); + err = TestReadTheMandatoryAttributeConstraintsMeasuredValue_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MaxSpeed\n"); - err = TestReadTheMandatoryAttributeMaxSpeed_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Write the default values to mandatory attribute: MeasuredValue\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeMeasuredValue_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: MaxFlow\n"); - err = TestReadTheMandatoryAttributeMaxFlow_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads back mandatory attribute: MeasuredValue\n"); + err = TestReadsBackMandatoryAttributeMeasuredValue_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the mandatory attribute constraints: MinMeasuredValue\n"); + err = TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Write the default values to mandatory attribute: MinMeasuredValue\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeMinMeasuredValue_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads back mandatory attribute: MinMeasuredValue\n"); + err = TestReadsBackMandatoryAttributeMinMeasuredValue_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the mandatory attribute constraints: MaxMeasuredValue\n"); + err = TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: MaxSpeed\n"); - err = TestReadTheMandatoryAttributeMaxSpeed_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Write the default values to mandatory attribute: MaxMeasuredValue\n"); + err = TestWriteTheDefaultValuesToMandatoryAttributeMaxMeasuredValue_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: MaxFlow\n"); - err = TestReadTheMandatoryAttributeMaxFlow_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : read the optional attribute: MinConstPressure\n"); - err = TestReadTheOptionalAttributeMinConstPressure_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: MaxConstPressure\n"); - err = TestReadTheOptionalAttributeMaxConstPressure_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : read the optional attribute: MinCompPressure\n"); - err = TestReadTheOptionalAttributeMinCompPressure_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : read the optional attribute: MaxCompPressure\n"); - err = TestReadTheOptionalAttributeMaxCompPressure_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : read the optional attribute: MinConstSpeed\n"); - err = TestReadTheOptionalAttributeMinConstSpeed_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : read the optional attribute: MaxConstSpeed\n"); - err = TestReadTheOptionalAttributeMaxConstSpeed_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : read the optional attribute: MinConstFlow\n"); - err = TestReadTheOptionalAttributeMinConstFlow_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : read the optional attribute: MaxConstFlow\n"); - err = TestReadTheOptionalAttributeMaxConstFlow_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : read the optional attribute: MinConstTemp\n"); - err = TestReadTheOptionalAttributeMinConstTemp_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : read the optional attribute: MaxConstTemp\n"); - err = TestReadTheOptionalAttributeMaxConstTemp_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : read the optional attribute: Speed\n"); - err = TestReadTheOptionalAttributeSpeed_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : read the optional attribute: Power\n"); - err = TestReadTheOptionalAttributePower_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : write to the optional attribute: LifetimeEnergyConsumed\n"); - err = TestWriteToTheOptionalAttributeLifetimeEnergyConsumed_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : read the optional attribute: MinConstPressure\n"); - err = TestReadTheOptionalAttributeMinConstPressure_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : read the optional attribute: MaxConstPressure\n"); - err = TestReadTheOptionalAttributeMaxConstPressure_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : read the optional attribute: MinCompPressure\n"); - err = TestReadTheOptionalAttributeMinCompPressure_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : read the optional attribute: MaxCompPressure\n"); - err = TestReadTheOptionalAttributeMaxCompPressure_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : read the optional attribute: MinConstSpeed\n"); - err = TestReadTheOptionalAttributeMinConstSpeed_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : read the optional attribute: MaxConstSpeed\n"); - err = TestReadTheOptionalAttributeMaxConstSpeed_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : read the optional attribute: MinConstFlow\n"); - err = TestReadTheOptionalAttributeMinConstFlow_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : read the optional attribute: MaxConstFlow\n"); - err = TestReadTheOptionalAttributeMaxConstFlow_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : read the optional attribute: MinConstTemp\n"); - err = TestReadTheOptionalAttributeMinConstTemp_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : read the optional attribute: MaxConstTemp\n"); - err = TestReadTheOptionalAttributeMaxConstTemp_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : read the optional attribute: Speed\n"); - err = TestReadTheOptionalAttributeSpeed_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : read the optional attribute: Power\n"); - err = TestReadTheOptionalAttributePower_47(); - break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_49(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Reads back mandatory attribute: MaxMeasuredValue\n"); + err = TestReadsBackMandatoryAttributeMaxMeasuredValue_9(); break; } @@ -36738,7 +35527,7 @@ class Test_TC_PCC_2_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 50; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -36754,489 +35543,437 @@ class Test_TC_PCC_2_1Suite : public TestCommand static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_1(void * context, int16_t maxPressure) + static void OnSuccessCallback_1(void * context, const chip::app::DataModel::Nullable & measuredValue) { - (static_cast(context))->OnSuccessResponse_1(maxPressure); + (static_cast(context))->OnSuccessResponse_1(measuredValue); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context, uint16_t maxSpeed) - { - (static_cast(context))->OnSuccessResponse_2(maxSpeed); - } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_3(void * context, uint16_t maxFlow) + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::Nullable & measuredValue) { - (static_cast(context))->OnSuccessResponse_3(maxFlow); + (static_cast(context))->OnSuccessResponse_3(measuredValue); } static void OnFailureCallback_4(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_4(error); + (static_cast(context))->OnFailureResponse_4(error); } - static void OnSuccessCallback_4(void * context, uint8_t effectiveOperationMode) + static void OnSuccessCallback_4(void * context, const chip::app::DataModel::Nullable & minMeasuredValue) { - (static_cast(context))->OnSuccessResponse_4(effectiveOperationMode); + (static_cast(context))->OnSuccessResponse_4(minMeasuredValue); } static void OnFailureCallback_5(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_5(error); + (static_cast(context))->OnFailureResponse_5(error); } - static void OnSuccessCallback_5(void * context, uint8_t effectiveControlMode) - { - (static_cast(context))->OnSuccessResponse_5(effectiveControlMode); - } + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } static void OnFailureCallback_6(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_6(error); + (static_cast(context))->OnFailureResponse_6(error); } - static void OnSuccessCallback_6(void * context, int16_t capacity) + static void OnSuccessCallback_6(void * context, const chip::app::DataModel::Nullable & minMeasuredValue) { - (static_cast(context))->OnSuccessResponse_6(capacity); + (static_cast(context))->OnSuccessResponse_6(minMeasuredValue); } static void OnFailureCallback_7(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_7(error); + (static_cast(context))->OnFailureResponse_7(error); } - static void OnSuccessCallback_7(void * context, int16_t maxPressure) + static void OnSuccessCallback_7(void * context, const chip::app::DataModel::Nullable & maxMeasuredValue) { - (static_cast(context))->OnSuccessResponse_7(maxPressure); + (static_cast(context))->OnSuccessResponse_7(maxMeasuredValue); } static void OnFailureCallback_8(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_8(error); + (static_cast(context))->OnFailureResponse_8(error); } - static void OnSuccessCallback_8(void * context, uint16_t maxSpeed) - { - (static_cast(context))->OnSuccessResponse_8(maxSpeed); - } + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } static void OnFailureCallback_9(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_9(error); + (static_cast(context))->OnFailureResponse_9(error); } - static void OnSuccessCallback_9(void * context, uint16_t maxFlow) + static void OnSuccessCallback_9(void * context, const chip::app::DataModel::Nullable & maxMeasuredValue) { - (static_cast(context))->OnSuccessResponse_9(maxFlow); + (static_cast(context))->OnSuccessResponse_9(maxMeasuredValue); } - static void OnFailureCallback_10(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_10(error); - } + // + // Tests methods + // - static void OnSuccessCallback_10(void * context, uint8_t effectiveOperationMode) + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { - (static_cast(context))->OnSuccessResponse_10(effectiveOperationMode); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - static void OnFailureCallback_11(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMeasuredValue_1() { - (static_cast(context))->OnFailureResponse_11(error); - } - - static void OnSuccessCallback_11(void * context, uint8_t effectiveControlMode) - { - (static_cast(context))->OnSuccessResponse_11(effectiveControlMode); - } - - static void OnFailureCallback_12(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_12(error); - } - - static void OnSuccessCallback_12(void * context, int16_t capacity) - { - (static_cast(context))->OnSuccessResponse_12(capacity); - } - - static void OnFailureCallback_13(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_13(error); - } - - static void OnSuccessCallback_13(void * context, int16_t minConstPressure) - { - (static_cast(context))->OnSuccessResponse_13(minConstPressure); - } - - static void OnFailureCallback_14(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_14(error); - } - - static void OnSuccessCallback_14(void * context, int16_t maxConstPressure) - { - (static_cast(context))->OnSuccessResponse_14(maxConstPressure); - } - - static void OnFailureCallback_15(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_15(error); - } - - static void OnSuccessCallback_15(void * context, int16_t minCompPressure) - { - (static_cast(context))->OnSuccessResponse_15(minCompPressure); - } - - static void OnFailureCallback_16(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_16(error); - } - - static void OnSuccessCallback_16(void * context, int16_t maxCompPressure) - { - (static_cast(context))->OnSuccessResponse_16(maxCompPressure); - } - - static void OnFailureCallback_17(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_17(error); - } - - static void OnSuccessCallback_17(void * context, uint16_t minConstSpeed) - { - (static_cast(context))->OnSuccessResponse_17(minConstSpeed); - } - - static void OnFailureCallback_18(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_18(error); - } - - static void OnSuccessCallback_18(void * context, uint16_t maxConstSpeed) - { - (static_cast(context))->OnSuccessResponse_18(maxConstSpeed); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PressureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnFailureCallback_19(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_19(error); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_19(void * context, uint16_t minConstFlow) + void OnFailureResponse_1(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_19(minConstFlow); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnFailureCallback_20(void * context, CHIP_ERROR error) + void OnSuccessResponse_1(const chip::app::DataModel::Nullable & measuredValue) { - (static_cast(context))->OnFailureResponse_20(error); + VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); + NextTest(); } - static void OnSuccessCallback_20(void * context, uint16_t maxConstFlow) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMeasuredValue_2() { - (static_cast(context))->OnSuccessResponse_20(maxConstFlow); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PressureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnFailureCallback_21(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_21(error); - } + chip::app::DataModel::Nullable measuredValueArgument; + measuredValueArgument.SetNonNull(); + measuredValueArgument.Value() = 0; - static void OnSuccessCallback_21(void * context, int16_t minConstTemp) - { - (static_cast(context))->OnSuccessResponse_21(minConstTemp); + ReturnErrorOnFailure(cluster.WriteAttribute( + measuredValueArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_22(void * context, CHIP_ERROR error) + void OnFailureResponse_2(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_22(error); + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); } - static void OnSuccessCallback_22(void * context, int16_t maxConstTemp) - { - (static_cast(context))->OnSuccessResponse_22(maxConstTemp); - } + void OnSuccessResponse_2() { ThrowSuccessResponse(); } - static void OnFailureCallback_23(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadsBackMandatoryAttributeMeasuredValue_3() { - (static_cast(context))->OnFailureResponse_23(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PressureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_23(void * context, uint16_t pumpStatus) - { - (static_cast(context))->OnSuccessResponse_23(pumpStatus); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_24(void * context, CHIP_ERROR error) + void OnFailureResponse_3(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_24(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_24(void * context, uint16_t pumpStatus) + void OnSuccessResponse_3(const chip::app::DataModel::Nullable & measuredValue) { - (static_cast(context))->OnSuccessResponse_24(pumpStatus); - } + VerifyOrReturn(CheckValueNonNull("measuredValue", measuredValue)); + VerifyOrReturn(CheckValue("measuredValue.Value()", measuredValue.Value(), 0)); - static void OnFailureCallback_25(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_25(error); + NextTest(); } - static void OnSuccessCallback_25(void * context, uint16_t speed) + CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_4() { - (static_cast(context))->OnSuccessResponse_25(speed); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PressureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnFailureCallback_26(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_26(error); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_26(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) + void OnFailureResponse_4(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_26(lifetimeRunningHours); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnFailureCallback_27(void * context, CHIP_ERROR error) + void OnSuccessResponse_4(const chip::app::DataModel::Nullable & minMeasuredValue) { - (static_cast(context))->OnFailureResponse_27(error); + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); + NextTest(); } - static void OnSuccessCallback_27(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMinMeasuredValue_5() { - (static_cast(context))->OnSuccessResponse_27(lifetimeRunningHours); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PressureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnFailureCallback_28(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_28(error); - } + chip::app::DataModel::Nullable minMeasuredValueArgument; + minMeasuredValueArgument.SetNonNull(); + minMeasuredValueArgument.Value() = 0; - static void OnSuccessCallback_28(void * context, uint32_t power) - { - (static_cast(context))->OnSuccessResponse_28(power); + ReturnErrorOnFailure( + cluster.WriteAttribute( + minMeasuredValueArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_29(void * context, CHIP_ERROR error) + void OnFailureResponse_5(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_29(error); + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); } - static void OnSuccessCallback_29(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) - { - (static_cast(context))->OnSuccessResponse_29(lifetimeEnergyConsumed); - } + void OnSuccessResponse_5() { ThrowSuccessResponse(); } - static void OnFailureCallback_30(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadsBackMandatoryAttributeMinMeasuredValue_6() { - (static_cast(context))->OnFailureResponse_30(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PressureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_30(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) - { - (static_cast(context))->OnSuccessResponse_30(lifetimeEnergyConsumed); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_31(void * context, CHIP_ERROR error) + void OnFailureResponse_6(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_31(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_31(void * context) { (static_cast(context))->OnSuccessResponse_31(); } - - static void OnFailureCallback_32(void * context, CHIP_ERROR error) + void OnSuccessResponse_6(const chip::app::DataModel::Nullable & minMeasuredValue) { - (static_cast(context))->OnFailureResponse_32(error); - } + VerifyOrReturn(CheckValueNonNull("minMeasuredValue", minMeasuredValue)); + VerifyOrReturn(CheckValue("minMeasuredValue.Value()", minMeasuredValue.Value(), 0)); - static void OnSuccessCallback_32(void * context, int16_t minConstPressure) - { - (static_cast(context))->OnSuccessResponse_32(minConstPressure); + NextTest(); } - static void OnFailureCallback_33(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_7() { - (static_cast(context))->OnFailureResponse_33(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PressureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_33(void * context, int16_t maxConstPressure) - { - (static_cast(context))->OnSuccessResponse_33(maxConstPressure); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7, true)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_34(void * context, CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_34(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_34(void * context, int16_t minCompPressure) + void OnSuccessResponse_7(const chip::app::DataModel::Nullable & maxMeasuredValue) { - (static_cast(context))->OnSuccessResponse_34(minCompPressure); + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); + NextTest(); } - static void OnFailureCallback_35(void * context, CHIP_ERROR error) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMaxMeasuredValue_8() { - (static_cast(context))->OnFailureResponse_35(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PressureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_35(void * context, int16_t maxCompPressure) - { - (static_cast(context))->OnSuccessResponse_35(maxCompPressure); - } + chip::app::DataModel::Nullable maxMeasuredValueArgument; + maxMeasuredValueArgument.SetNonNull(); + maxMeasuredValueArgument.Value() = 0; - static void OnFailureCallback_36(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_36(error); + ReturnErrorOnFailure( + cluster.WriteAttribute( + maxMeasuredValueArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_36(void * context, uint16_t minConstSpeed) + void OnFailureResponse_8(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_36(minConstSpeed); + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); } - static void OnFailureCallback_37(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_37(error); - } + void OnSuccessResponse_8() { ThrowSuccessResponse(); } - static void OnSuccessCallback_37(void * context, uint16_t maxConstSpeed) + CHIP_ERROR TestReadsBackMandatoryAttributeMaxMeasuredValue_9() { - (static_cast(context))->OnSuccessResponse_37(maxConstSpeed); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PressureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnFailureCallback_38(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_38(error); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_9, OnFailureCallback_9, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_38(void * context, uint16_t minConstFlow) + void OnFailureResponse_9(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_38(minConstFlow); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnFailureCallback_39(void * context, CHIP_ERROR error) + void OnSuccessResponse_9(const chip::app::DataModel::Nullable & maxMeasuredValue) { - (static_cast(context))->OnFailureResponse_39(error); - } + VerifyOrReturn(CheckValueNonNull("maxMeasuredValue", maxMeasuredValue)); + VerifyOrReturn(CheckValue("maxMeasuredValue.Value()", maxMeasuredValue.Value(), 0)); - static void OnSuccessCallback_39(void * context, uint16_t maxConstFlow) - { - (static_cast(context))->OnSuccessResponse_39(maxConstFlow); + NextTest(); } +}; - static void OnFailureCallback_40(void * context, CHIP_ERROR error) +class Test_TC_PCC_1_1Suite : public TestCommand +{ +public: + Test_TC_PCC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PCC_1_1", credsIssuerConfig), mTestIndex(0) { - (static_cast(context))->OnFailureResponse_40(error); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - static void OnSuccessCallback_40(void * context, int16_t minConstTemp) - { - (static_cast(context))->OnSuccessResponse_40(minConstTemp); - } + ~Test_TC_PCC_1_1Suite() {} - static void OnFailureCallback_41(void * context, CHIP_ERROR error) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_41(error); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnSuccessCallback_41(void * context, int16_t maxConstTemp) - { - (static_cast(context))->OnSuccessResponse_41(maxConstTemp); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); + } - static void OnFailureCallback_42(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_42(error); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - static void OnSuccessCallback_42(void * context, uint16_t pumpStatus) - { - (static_cast(context))->OnSuccessResponse_42(pumpStatus); - } + Wait(); - static void OnFailureCallback_43(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_43(error); - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_4(); + break; + } - static void OnSuccessCallback_43(void * context, uint16_t pumpStatus) - { - (static_cast(context))->OnSuccessResponse_43(pumpStatus); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnFailureCallback_44(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_44(error); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; - static void OnSuccessCallback_44(void * context, uint16_t speed) - { - (static_cast(context))->OnSuccessResponse_44(speed); - } + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; - static void OnFailureCallback_45(void * context, CHIP_ERROR error) + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override { - (static_cast(context))->OnFailureResponse_45(error); - } + bool isExpectedDnssdResult = false; - static void OnSuccessCallback_45(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) - { - (static_cast(context))->OnSuccessResponse_45(lifetimeRunningHours); + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); } - static void OnFailureCallback_46(void * context, CHIP_ERROR error) + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_46(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_46(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_46(lifetimeRunningHours); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } - static void OnFailureCallback_47(void * context, CHIP_ERROR error) + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_47(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_47(void * context, uint32_t power) - { - (static_cast(context))->OnSuccessResponse_47(power); - } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - static void OnFailureCallback_48(void * context, CHIP_ERROR error) + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_48(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_48(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) { - (static_cast(context))->OnSuccessResponse_48(lifetimeEnergyConsumed); + (static_cast(context))->OnSuccessResponse_3(attributeList); } - static void OnFailureCallback_49(void * context, CHIP_ERROR error) + static void OnFailureCallback_4(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_49(error); + (static_cast(context))->OnFailureResponse_4(error); } - static void OnSuccessCallback_49(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + static void OnSuccessCallback_4(void * context, uint32_t featureMap) { - (static_cast(context))->OnSuccessResponse_49(lifetimeEnergyConsumed); + (static_cast(context))->OnSuccessResponse_4(featureMap); } // @@ -37249,14 +35986,14 @@ class Test_TC_PCC_2_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_1() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( + cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } @@ -37267,44 +36004,45 @@ class Test_TC_PCC_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_1(int16_t maxPressure) + void OnSuccessResponse_1(uint16_t clusterRevision) { - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_2() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); + uint16_t clusterRevisionArgument; + clusterRevisionArgument = 3U; + ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2, true)); + cluster.WriteAttribute( + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); return CHIP_NO_ERROR; } void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_2(uint16_t maxSpeed) - { - VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_3() + void OnSuccessResponse_2() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } @@ -37314,20 +36052,20 @@ class Test_TC_PCC_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t maxFlow) + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) { - VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_4() + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( + cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } @@ -37338,1974 +36076,1835 @@ class Test_TC_PCC_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_4(uint8_t effectiveOperationMode) + void OnSuccessResponse_4(uint32_t featureMap) { - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); } +}; - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_5() +class Test_TC_PCC_2_1Suite : public TestCommand +{ +public: + Test_TC_PCC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PCC_2_1", credsIssuerConfig), mTestIndex(0) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5, true)); - return CHIP_NO_ERROR; + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - void OnFailureResponse_5(CHIP_ERROR error) + ~Test_TC_PCC_2_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MaxSpeed\n"); + err = TestReadTheMandatoryAttributeMaxSpeed_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: MaxFlow\n"); + err = TestReadTheMandatoryAttributeMaxFlow_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: MaxSpeed\n"); + err = TestReadTheMandatoryAttributeMaxSpeed_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: MaxFlow\n"); + err = TestReadTheMandatoryAttributeMaxFlow_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : read the optional attribute: MinConstPressure\n"); + err = TestReadTheOptionalAttributeMinConstPressure_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: MaxConstPressure\n"); + err = TestReadTheOptionalAttributeMaxConstPressure_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : read the optional attribute: MinCompPressure\n"); + err = TestReadTheOptionalAttributeMinCompPressure_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : read the optional attribute: MaxCompPressure\n"); + err = TestReadTheOptionalAttributeMaxCompPressure_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : read the optional attribute: MinConstSpeed\n"); + err = TestReadTheOptionalAttributeMinConstSpeed_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : read the optional attribute: MaxConstSpeed\n"); + err = TestReadTheOptionalAttributeMaxConstSpeed_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : read the optional attribute: MinConstFlow\n"); + err = TestReadTheOptionalAttributeMinConstFlow_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : read the optional attribute: MaxConstFlow\n"); + err = TestReadTheOptionalAttributeMaxConstFlow_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : read the optional attribute: MinConstTemp\n"); + err = TestReadTheOptionalAttributeMinConstTemp_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : read the optional attribute: MaxConstTemp\n"); + err = TestReadTheOptionalAttributeMaxConstTemp_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : read the optional attribute: Speed\n"); + err = TestReadTheOptionalAttributeSpeed_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : read the optional attribute: Power\n"); + err = TestReadTheOptionalAttributePower_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : write to the optional attribute: LifetimeEnergyConsumed\n"); + err = TestWriteToTheOptionalAttributeLifetimeEnergyConsumed_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : read the optional attribute: MinConstPressure\n"); + err = TestReadTheOptionalAttributeMinConstPressure_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : read the optional attribute: MaxConstPressure\n"); + err = TestReadTheOptionalAttributeMaxConstPressure_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : read the optional attribute: MinCompPressure\n"); + err = TestReadTheOptionalAttributeMinCompPressure_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : read the optional attribute: MaxCompPressure\n"); + err = TestReadTheOptionalAttributeMaxCompPressure_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : read the optional attribute: MinConstSpeed\n"); + err = TestReadTheOptionalAttributeMinConstSpeed_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : read the optional attribute: MaxConstSpeed\n"); + err = TestReadTheOptionalAttributeMaxConstSpeed_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : read the optional attribute: MinConstFlow\n"); + err = TestReadTheOptionalAttributeMinConstFlow_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : read the optional attribute: MaxConstFlow\n"); + err = TestReadTheOptionalAttributeMaxConstFlow_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : read the optional attribute: MinConstTemp\n"); + err = TestReadTheOptionalAttributeMinConstTemp_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : read the optional attribute: MaxConstTemp\n"); + err = TestReadTheOptionalAttributeMaxConstTemp_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : read the optional attribute: Speed\n"); + err = TestReadTheOptionalAttributeSpeed_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : read the optional attribute: Power\n"); + err = TestReadTheOptionalAttributePower_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_49(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnSuccessResponse_5(uint8_t effectiveControlMode) +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 50; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override { - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_6() + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_1(error); } - void OnFailureResponse_6(CHIP_ERROR error) + static void OnSuccessCallback_1(void * context, int16_t maxPressure) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_1(maxPressure); } - void OnSuccessResponse_6(int16_t capacity) + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); - NextTest(); + (static_cast(context))->OnFailureResponse_2(error); } - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_7() + static void OnSuccessCallback_2(void * context, uint16_t maxSpeed) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_2(maxSpeed); } - void OnFailureResponse_7(CHIP_ERROR error) + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_3(error); } - void OnSuccessResponse_7(int16_t maxPressure) + static void OnSuccessCallback_3(void * context, uint16_t maxFlow) { - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_3(maxFlow); } - CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_8() + static void OnFailureCallback_4(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_4(error); } - void OnFailureResponse_8(CHIP_ERROR error) + static void OnSuccessCallback_4(void * context, uint8_t effectiveOperationMode) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_4(effectiveOperationMode); } - void OnSuccessResponse_8(uint16_t maxSpeed) + static void OnFailureCallback_5(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); - NextTest(); + (static_cast(context))->OnFailureResponse_5(error); } - CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_9() + static void OnSuccessCallback_5(void * context, uint8_t effectiveControlMode) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_5(effectiveControlMode); } - void OnFailureResponse_9(CHIP_ERROR error) + static void OnFailureCallback_6(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_6(error); } - void OnSuccessResponse_9(uint16_t maxFlow) + static void OnSuccessCallback_6(void * context, int16_t capacity) { - VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_6(capacity); } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_10() + static void OnFailureCallback_7(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_7(error); } - void OnFailureResponse_10(CHIP_ERROR error) + static void OnSuccessCallback_7(void * context, int16_t maxPressure) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_7(maxPressure); } - void OnSuccessResponse_10(uint8_t effectiveOperationMode) + static void OnFailureCallback_8(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); - NextTest(); + (static_cast(context))->OnFailureResponse_8(error); } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_11() + static void OnSuccessCallback_8(void * context, uint16_t maxSpeed) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_8(maxSpeed); } - void OnFailureResponse_11(CHIP_ERROR error) + static void OnFailureCallback_9(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_9(error); } - void OnSuccessResponse_11(uint8_t effectiveControlMode) + static void OnSuccessCallback_9(void * context, uint16_t maxFlow) { - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); - NextTest(); + (static_cast(context))->OnSuccessResponse_9(maxFlow); } - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_12() + static void OnFailureCallback_10(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_10(error); } - void OnFailureResponse_12(CHIP_ERROR error) + static void OnSuccessCallback_10(void * context, uint8_t effectiveOperationMode) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_10(effectiveOperationMode); } - void OnSuccessResponse_12(int16_t capacity) + static void OnFailureCallback_11(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); - NextTest(); + (static_cast(context))->OnFailureResponse_11(error); } - CHIP_ERROR TestReadTheOptionalAttributeMinConstPressure_13() + static void OnSuccessCallback_11(void * context, uint8_t effectiveControlMode) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_11(effectiveControlMode); } - void OnFailureResponse_13(CHIP_ERROR error) + static void OnFailureCallback_12(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_12(error); } - void OnSuccessResponse_13(int16_t minConstPressure) + static void OnSuccessCallback_12(void * context, int16_t capacity) { - VerifyOrReturn(CheckConstraintType("minConstPressure", "", "int16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_12(capacity); } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstPressure_14() + static void OnFailureCallback_13(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_13(error); } - void OnFailureResponse_14(CHIP_ERROR error) + static void OnSuccessCallback_13(void * context, int16_t minConstPressure) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_13(minConstPressure); } - void OnSuccessResponse_14(int16_t maxConstPressure) + static void OnFailureCallback_14(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckConstraintType("maxConstPressure", "", "int16")); - NextTest(); + (static_cast(context))->OnFailureResponse_14(error); } - CHIP_ERROR TestReadTheOptionalAttributeMinCompPressure_15() + static void OnSuccessCallback_14(void * context, int16_t maxConstPressure) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_15, OnFailureCallback_15, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_14(maxConstPressure); } - void OnFailureResponse_15(CHIP_ERROR error) + static void OnFailureCallback_15(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_15(error); } - void OnSuccessResponse_15(int16_t minCompPressure) + static void OnSuccessCallback_15(void * context, int16_t minCompPressure) { - VerifyOrReturn(CheckConstraintType("minCompPressure", "", "int16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_15(minCompPressure); } - CHIP_ERROR TestReadTheOptionalAttributeMaxCompPressure_16() + static void OnFailureCallback_16(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_16(error); } - void OnFailureResponse_16(CHIP_ERROR error) + static void OnSuccessCallback_16(void * context, int16_t maxCompPressure) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_16(maxCompPressure); } - void OnSuccessResponse_16(int16_t maxCompPressure) + static void OnFailureCallback_17(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckConstraintType("maxCompPressure", "", "int16")); - NextTest(); + (static_cast(context))->OnFailureResponse_17(error); } - CHIP_ERROR TestReadTheOptionalAttributeMinConstSpeed_17() + static void OnSuccessCallback_17(void * context, uint16_t minConstSpeed) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_17, OnFailureCallback_17, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_17(minConstSpeed); } - void OnFailureResponse_17(CHIP_ERROR error) + static void OnFailureCallback_18(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_18(error); } - void OnSuccessResponse_17(uint16_t minConstSpeed) + static void OnSuccessCallback_18(void * context, uint16_t maxConstSpeed) { - VerifyOrReturn(CheckConstraintType("minConstSpeed", "", "uint16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_18(maxConstSpeed); } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstSpeed_18() + static void OnFailureCallback_19(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_19(error); + } - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_19(void * context, uint16_t minConstFlow) + { + (static_cast(context))->OnSuccessResponse_19(minConstFlow); } - void OnFailureResponse_18(CHIP_ERROR error) + static void OnFailureCallback_20(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_20(error); } - void OnSuccessResponse_18(uint16_t maxConstSpeed) + static void OnSuccessCallback_20(void * context, uint16_t maxConstFlow) { - VerifyOrReturn(CheckConstraintType("maxConstSpeed", "", "uint16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_20(maxConstFlow); } - CHIP_ERROR TestReadTheOptionalAttributeMinConstFlow_19() + static void OnFailureCallback_21(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_21(error); + } - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_19, OnFailureCallback_19, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_21(void * context, int16_t minConstTemp) + { + (static_cast(context))->OnSuccessResponse_21(minConstTemp); } - void OnFailureResponse_19(CHIP_ERROR error) + static void OnFailureCallback_22(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_22(error); } - void OnSuccessResponse_19(uint16_t minConstFlow) + static void OnSuccessCallback_22(void * context, int16_t maxConstTemp) { - VerifyOrReturn(CheckConstraintType("minConstFlow", "", "uint16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_22(maxConstTemp); } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstFlow_20() + static void OnFailureCallback_23(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_23(error); + } - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_20, OnFailureCallback_20, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_23(void * context, uint16_t pumpStatus) + { + (static_cast(context))->OnSuccessResponse_23(pumpStatus); } - void OnFailureResponse_20(CHIP_ERROR error) + static void OnFailureCallback_24(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_24(error); } - void OnSuccessResponse_20(uint16_t maxConstFlow) + static void OnSuccessCallback_24(void * context, uint16_t pumpStatus) { - VerifyOrReturn(CheckConstraintType("maxConstFlow", "", "uint16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_24(pumpStatus); } - CHIP_ERROR TestReadTheOptionalAttributeMinConstTemp_21() + static void OnFailureCallback_25(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_25(error); + } - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_21, OnFailureCallback_21, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_25(void * context, uint16_t speed) + { + (static_cast(context))->OnSuccessResponse_25(speed); } - void OnFailureResponse_21(CHIP_ERROR error) + static void OnFailureCallback_26(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_26(error); } - void OnSuccessResponse_21(int16_t minConstTemp) + static void OnSuccessCallback_26(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) { - VerifyOrReturn(CheckConstraintType("minConstTemp", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("minConstTemp", minConstTemp, -27315)); - NextTest(); + (static_cast(context))->OnSuccessResponse_26(lifetimeRunningHours); } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstTemp_22() + static void OnFailureCallback_27(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_27(error); + } - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_22, OnFailureCallback_22, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_27(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) + { + (static_cast(context))->OnSuccessResponse_27(lifetimeRunningHours); } - void OnFailureResponse_22(CHIP_ERROR error) + static void OnFailureCallback_28(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_28(error); } - void OnSuccessResponse_22(int16_t maxConstTemp) + static void OnSuccessCallback_28(void * context, uint32_t power) { - VerifyOrReturn(CheckConstraintType("maxConstTemp", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("maxConstTemp", maxConstTemp, -27315)); - NextTest(); + (static_cast(context))->OnSuccessResponse_28(power); } - CHIP_ERROR TestReadTheOptionalAttributePumpStatus_23() + static void OnFailureCallback_29(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_29(error); + } - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_29(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + (static_cast(context))->OnSuccessResponse_29(lifetimeEnergyConsumed); } - void OnFailureResponse_23(CHIP_ERROR error) + static void OnFailureCallback_30(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_30(error); } - void OnSuccessResponse_23(uint16_t pumpStatus) + static void OnSuccessCallback_30(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) { - VerifyOrReturn(CheckValue("pumpStatus", pumpStatus, 0U)); + (static_cast(context))->OnSuccessResponse_30(lifetimeEnergyConsumed); + } - NextTest(); + static void OnFailureCallback_31(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_31(error); } - CHIP_ERROR TestReadTheOptionalAttributePumpStatus_24() + static void OnSuccessCallback_31(void * context) { (static_cast(context))->OnSuccessResponse_31(); } + + static void OnFailureCallback_32(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_32(error); + } - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_24, OnFailureCallback_24, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_32(void * context, int16_t minConstPressure) + { + (static_cast(context))->OnSuccessResponse_32(minConstPressure); } - void OnFailureResponse_24(CHIP_ERROR error) + static void OnFailureCallback_33(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_33(error); } - void OnSuccessResponse_24(uint16_t pumpStatus) + static void OnSuccessCallback_33(void * context, int16_t maxConstPressure) { - VerifyOrReturn(CheckConstraintType("pumpStatus", "", "map16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_33(maxConstPressure); } - CHIP_ERROR TestReadTheOptionalAttributeSpeed_25() + static void OnFailureCallback_34(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_34(error); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_25, OnFailureCallback_25, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_34(void * context, int16_t minCompPressure) + { + (static_cast(context))->OnSuccessResponse_34(minCompPressure); } - void OnFailureResponse_25(CHIP_ERROR error) + static void OnFailureCallback_35(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_35(error); } - void OnSuccessResponse_25(uint16_t speed) + static void OnSuccessCallback_35(void * context, int16_t maxCompPressure) { - VerifyOrReturn(CheckConstraintType("speed", "", "uint16")); - NextTest(); + (static_cast(context))->OnSuccessResponse_35(maxCompPressure); } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_26() + static void OnFailureCallback_36(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_36(error); + } - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_26, OnFailureCallback_26, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_36(void * context, uint16_t minConstSpeed) + { + (static_cast(context))->OnSuccessResponse_36(minConstSpeed); } - void OnFailureResponse_26(CHIP_ERROR error) + static void OnFailureCallback_37(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_37(error); } - void OnSuccessResponse_26(const chip::app::DataModel::Nullable & lifetimeRunningHours) + static void OnSuccessCallback_37(void * context, uint16_t maxConstSpeed) { - VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); - VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 0UL)); + (static_cast(context))->OnSuccessResponse_37(maxConstSpeed); + } - NextTest(); + static void OnFailureCallback_38(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_38(error); } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_27() + static void OnSuccessCallback_38(void * context, uint16_t minConstFlow) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_38(minConstFlow); + } - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_27, OnFailureCallback_27, true)); - return CHIP_NO_ERROR; + static void OnFailureCallback_39(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_39(error); } - void OnFailureResponse_27(CHIP_ERROR error) + static void OnSuccessCallback_39(void * context, uint16_t maxConstFlow) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_39(maxConstFlow); } - void OnSuccessResponse_27(const chip::app::DataModel::Nullable & lifetimeRunningHours) + static void OnFailureCallback_40(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckConstraintType("lifetimeRunningHours", "", "uint24")); - NextTest(); + (static_cast(context))->OnFailureResponse_40(error); } - CHIP_ERROR TestReadTheOptionalAttributePower_28() + static void OnSuccessCallback_40(void * context, int16_t minConstTemp) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_40(minConstTemp); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_28, OnFailureCallback_28, true)); - return CHIP_NO_ERROR; + static void OnFailureCallback_41(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_41(error); } - void OnFailureResponse_28(CHIP_ERROR error) + static void OnSuccessCallback_41(void * context, int16_t maxConstTemp) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_41(maxConstTemp); } - void OnSuccessResponse_28(uint32_t power) + static void OnFailureCallback_42(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckConstraintType("power", "", "uint24")); - NextTest(); + (static_cast(context))->OnFailureResponse_42(error); } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_29() + static void OnSuccessCallback_42(void * context, uint16_t pumpStatus) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_42(pumpStatus); + } - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_29, OnFailureCallback_29, true)); - return CHIP_NO_ERROR; + static void OnFailureCallback_43(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_43(error); } - void OnFailureResponse_29(CHIP_ERROR error) + static void OnSuccessCallback_43(void * context, uint16_t pumpStatus) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_43(pumpStatus); } - void OnSuccessResponse_29(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + static void OnFailureCallback_44(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); - VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 0UL)); + (static_cast(context))->OnFailureResponse_44(error); + } - NextTest(); + static void OnSuccessCallback_44(void * context, uint16_t speed) + { + (static_cast(context))->OnSuccessResponse_44(speed); } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_30() + static void OnFailureCallback_45(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_45(error); + } - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_30, OnFailureCallback_30, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_45(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) + { + (static_cast(context))->OnSuccessResponse_45(lifetimeRunningHours); } - void OnFailureResponse_30(CHIP_ERROR error) + static void OnFailureCallback_46(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_46(error); } - void OnSuccessResponse_30(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + static void OnSuccessCallback_46(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) { - VerifyOrReturn(CheckConstraintType("lifetimeEnergyConsumed", "", "uint32")); - NextTest(); + (static_cast(context))->OnSuccessResponse_46(lifetimeRunningHours); } - CHIP_ERROR TestWriteToTheOptionalAttributeLifetimeEnergyConsumed_31() + static void OnFailureCallback_47(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_47(error); + } - chip::app::DataModel::Nullable lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument.SetNonNull(); - lifetimeEnergyConsumedArgument.Value() = 0UL; + static void OnSuccessCallback_47(void * context, uint32_t power) + { + (static_cast(context))->OnSuccessResponse_47(power); + } - ReturnErrorOnFailure( - cluster.WriteAttribute( - lifetimeEnergyConsumedArgument, this, OnSuccessCallback_31, OnFailureCallback_31)); - return CHIP_NO_ERROR; + static void OnFailureCallback_48(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_48(error); } - void OnFailureResponse_31(CHIP_ERROR error) + static void OnSuccessCallback_48(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) { - chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_48(lifetimeEnergyConsumed); } - void OnSuccessResponse_31() { NextTest(); } + static void OnFailureCallback_49(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_49(error); + } - CHIP_ERROR TestReadTheOptionalAttributeMinConstPressure_32() + static void OnSuccessCallback_49(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + (static_cast(context))->OnSuccessResponse_49(lifetimeEnergyConsumed); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_32, OnFailureCallback_32, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_32(CHIP_ERROR error) + void OnFailureResponse_1(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_32(int16_t minConstPressure) + void OnSuccessResponse_1(int16_t maxPressure) { - VerifyOrReturn(CheckConstraintType("minConstPressure", "", "int16")); + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstPressure_33() + CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_33, OnFailureCallback_33, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_33(CHIP_ERROR error) + void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_33(int16_t maxConstPressure) + void OnSuccessResponse_2(uint16_t maxSpeed) { - VerifyOrReturn(CheckConstraintType("maxConstPressure", "", "int16")); + VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeMinCompPressure_34() + CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_34, OnFailureCallback_34, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_34(CHIP_ERROR error) + void OnFailureResponse_3(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_34(int16_t minCompPressure) + void OnSuccessResponse_3(uint16_t maxFlow) { - VerifyOrReturn(CheckConstraintType("minCompPressure", "", "int16")); + VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeMaxCompPressure_35() + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_35, OnFailureCallback_35, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_35(CHIP_ERROR error) + void OnFailureResponse_4(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_35(int16_t maxCompPressure) + void OnSuccessResponse_4(uint8_t effectiveOperationMode) { - VerifyOrReturn(CheckConstraintType("maxCompPressure", "", "int16")); + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeMinConstSpeed_36() + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_36, OnFailureCallback_36, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_36(CHIP_ERROR error) + void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_36(uint16_t minConstSpeed) + void OnSuccessResponse_5(uint8_t effectiveControlMode) { - VerifyOrReturn(CheckConstraintType("minConstSpeed", "", "uint16")); + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstSpeed_37() + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_37, OnFailureCallback_37, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_37(CHIP_ERROR error) + void OnFailureResponse_6(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_37(uint16_t maxConstSpeed) + void OnSuccessResponse_6(int16_t capacity) { - VerifyOrReturn(CheckConstraintType("maxConstSpeed", "", "uint16")); + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeMinConstFlow_38() + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_38, OnFailureCallback_38, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_38(CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_38(uint16_t minConstFlow) + void OnSuccessResponse_7(int16_t maxPressure) { - VerifyOrReturn(CheckConstraintType("minConstFlow", "", "uint16")); + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstFlow_39() + CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_39, OnFailureCallback_39, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_8, OnFailureCallback_8, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_39(CHIP_ERROR error) + void OnFailureResponse_8(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_39(uint16_t maxConstFlow) + void OnSuccessResponse_8(uint16_t maxSpeed) { - VerifyOrReturn(CheckConstraintType("maxConstFlow", "", "uint16")); + VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeMinConstTemp_40() + CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_40, OnFailureCallback_40, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_9, OnFailureCallback_9, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_40(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_40(int16_t minConstTemp) + void OnSuccessResponse_9(uint16_t maxFlow) { - VerifyOrReturn(CheckConstraintType("minConstTemp", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("minConstTemp", minConstTemp, -27315)); + VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstTemp_41() + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_10() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_41, OnFailureCallback_41, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_10, OnFailureCallback_10, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_41(CHIP_ERROR error) + void OnFailureResponse_10(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_41(int16_t maxConstTemp) + void OnSuccessResponse_10(uint8_t effectiveOperationMode) { - VerifyOrReturn(CheckConstraintType("maxConstTemp", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("maxConstTemp", maxConstTemp, -27315)); + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributePumpStatus_42() + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_11() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_42, OnFailureCallback_42, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_11, OnFailureCallback_11, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_42(CHIP_ERROR error) + void OnFailureResponse_11(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_42(uint16_t pumpStatus) + void OnSuccessResponse_11(uint8_t effectiveControlMode) { - VerifyOrReturn(CheckValue("pumpStatus", pumpStatus, 0U)); - + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributePumpStatus_43() + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_12() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_43, OnFailureCallback_43, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_12, OnFailureCallback_12, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_43(CHIP_ERROR error) + void OnFailureResponse_12(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_43(uint16_t pumpStatus) + void OnSuccessResponse_12(int16_t capacity) { - VerifyOrReturn(CheckConstraintType("pumpStatus", "", "map16")); + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeSpeed_44() + CHIP_ERROR TestReadTheOptionalAttributeMinConstPressure_13() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_44, OnFailureCallback_44, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_13, OnFailureCallback_13, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_44(CHIP_ERROR error) + void OnFailureResponse_13(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_44(uint16_t speed) + void OnSuccessResponse_13(int16_t minConstPressure) { - VerifyOrReturn(CheckConstraintType("speed", "", "uint16")); + VerifyOrReturn(CheckConstraintType("minConstPressure", "", "int16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_45() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstPressure_14() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_45, OnFailureCallback_45, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_14, OnFailureCallback_14, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_45(CHIP_ERROR error) + void OnFailureResponse_14(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_45(const chip::app::DataModel::Nullable & lifetimeRunningHours) + void OnSuccessResponse_14(int16_t maxConstPressure) { - VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); - VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 0UL)); - + VerifyOrReturn(CheckConstraintType("maxConstPressure", "", "int16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_46() + CHIP_ERROR TestReadTheOptionalAttributeMinCompPressure_15() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_46, OnFailureCallback_46, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_15, OnFailureCallback_15, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_46(CHIP_ERROR error) + void OnFailureResponse_15(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_46(const chip::app::DataModel::Nullable & lifetimeRunningHours) + void OnSuccessResponse_15(int16_t minCompPressure) { - VerifyOrReturn(CheckConstraintType("lifetimeRunningHours", "", "uint24")); + VerifyOrReturn(CheckConstraintType("minCompPressure", "", "int16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributePower_47() + CHIP_ERROR TestReadTheOptionalAttributeMaxCompPressure_16() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_47, OnFailureCallback_47, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_16, OnFailureCallback_16, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_47(CHIP_ERROR error) + void OnFailureResponse_16(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_47(uint32_t power) + void OnSuccessResponse_16(int16_t maxCompPressure) { - VerifyOrReturn(CheckConstraintType("power", "", "uint24")); + VerifyOrReturn(CheckConstraintType("maxCompPressure", "", "int16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_48() + CHIP_ERROR TestReadTheOptionalAttributeMinConstSpeed_17() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_48, OnFailureCallback_48, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_17, OnFailureCallback_17, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_48(CHIP_ERROR error) + void OnFailureResponse_17(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_48(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + void OnSuccessResponse_17(uint16_t minConstSpeed) { - VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); - VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 0UL)); - + VerifyOrReturn(CheckConstraintType("minConstSpeed", "", "uint16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_49() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstSpeed_18() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_49, OnFailureCallback_49, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_18, OnFailureCallback_18, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_49(CHIP_ERROR error) + void OnFailureResponse_18(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_49(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + void OnSuccessResponse_18(uint16_t maxConstSpeed) { - VerifyOrReturn(CheckConstraintType("lifetimeEnergyConsumed", "", "uint32")); + VerifyOrReturn(CheckConstraintType("maxConstSpeed", "", "uint16")); NextTest(); } -}; -class Test_TC_PCC_2_2Suite : public TestCommand -{ -public: - Test_TC_PCC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_PCC_2_2", credsIssuerConfig), mTestIndex(0) + CHIP_ERROR TestReadTheOptionalAttributeMinConstFlow_19() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ~Test_TC_PCC_2_2Suite() {} + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_19, OnFailureCallback_19, true)); + return CHIP_NO_ERROR; + } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnFailureResponse_19(CHIP_ERROR error) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Write 1 to the OperationMode attribute to DUT: OperationMode\n"); - if (ShouldSkip("A_OPERATIONMODE")) - { - NextTest(); - return; - } - err = TestWrite1ToTheOperationModeAttributeToDutOperationMode_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Write 2 to the OperationMode attribute to DUT: OperationMode\n"); - if (ShouldSkip("A_OPERATIONMODE")) - { - NextTest(); - return; - } - err = TestWrite2ToTheOperationModeAttributeToDutOperationMode_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write 3 to the OperationMode attribute to DUT: OperationMode\n"); - if (ShouldSkip("A_OPERATIONMODE")) - { - NextTest(); - return; - } - err = TestWrite3ToTheOperationModeAttributeToDutOperationMode_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnSuccessResponse_19(uint16_t minConstFlow) { - bool isExpectedDnssdResult = false; - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + VerifyOrReturn(CheckConstraintType("minConstFlow", "", "uint16")); NextTest(); } - static void OnFailureCallback_1(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheOptionalAttributeMaxConstFlow_20() { - (static_cast(context))->OnFailureResponse_1(error); - } - - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnFailureCallback_2(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_2(error); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_20, OnFailureCallback_20, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, CHIP_ERROR error) + void OnFailureResponse_20(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + void OnSuccessResponse_20(uint16_t maxConstFlow) { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + VerifyOrReturn(CheckConstraintType("maxConstFlow", "", "uint16")); + NextTest(); } - CHIP_ERROR TestWrite1ToTheOperationModeAttributeToDutOperationMode_1() + CHIP_ERROR TestReadTheOptionalAttributeMinConstTemp_21() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t operationModeArgument; - operationModeArgument = 1; - ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); + cluster.ReadAttribute( + this, OnSuccessCallback_21, OnFailureCallback_21, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_1(CHIP_ERROR error) + void OnFailureResponse_21(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_21(int16_t minConstTemp) + { + VerifyOrReturn(CheckConstraintType("minConstTemp", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("minConstTemp", minConstTemp, -27315)); + NextTest(); + } - CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_2() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstTemp_22() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t operationModeArgument; - operationModeArgument = 2; - ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + cluster.ReadAttribute( + this, OnSuccessCallback_22, OnFailureCallback_22, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_2(CHIP_ERROR error) + void OnFailureResponse_22(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_22(int16_t maxConstTemp) + { + VerifyOrReturn(CheckConstraintType("maxConstTemp", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("maxConstTemp", maxConstTemp, -27315)); + NextTest(); + } - CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_3() + CHIP_ERROR TestReadTheOptionalAttributePumpStatus_23() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t operationModeArgument; - operationModeArgument = 3; - ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + cluster.ReadAttribute( + this, OnSuccessCallback_23, OnFailureCallback_23, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_23(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } -}; - -class Test_TC_PCC_2_3Suite : public TestCommand -{ -public: - Test_TC_PCC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_PCC_2_3", credsIssuerConfig), mTestIndex(0) + void OnSuccessResponse_23(uint16_t pumpStatus) { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - } + VerifyOrReturn(CheckValue("pumpStatus", pumpStatus, 0U)); - ~Test_TC_PCC_2_3Suite() {} + NextTest(); + } - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadTheOptionalAttributePumpStatus_24() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Write 0 to the OperationMode attribute to DUT\n"); - if (ShouldSkip("A_OPERATIONMODE")) - { - NextTest(); - return; - } - err = TestWrite0ToTheOperationModeAttributeToDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); - if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) - { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveOperationMode_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write 0 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite0ToTheControlModeAttributeToDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: EffectiveControlMode\n"); - if (ShouldSkip("A_EFFECTIVECONTROLMODE")) - { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveControlMode_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write 1 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite1ToTheControlModeAttributeToDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Write 2 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite2ToTheControlModeAttributeToDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write 3 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite3ToTheControlModeAttributeToDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write 5 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite5ToTheControlModeAttributeToDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write 7 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite7ToTheControlModeAttributeToDut_9(); - break; - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_24, OnFailureCallback_24, true)); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnFailureResponse_24(CHIP_ERROR error) { - bool isExpectedDnssdResult = false; + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + } - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + void OnSuccessResponse_24(uint16_t pumpStatus) + { + VerifyOrReturn(CheckConstraintType("pumpStatus", "", "map16")); NextTest(); } - static void OnFailureCallback_1(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheOptionalAttributeSpeed_25() { - (static_cast(context))->OnFailureResponse_1(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_25, OnFailureCallback_25, true)); + return CHIP_NO_ERROR; + } - static void OnFailureCallback_2(void * context, CHIP_ERROR error) + void OnFailureResponse_25(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - static void OnSuccessCallback_2(void * context, uint8_t effectiveOperationMode) + void OnSuccessResponse_25(uint16_t speed) { - (static_cast(context))->OnSuccessResponse_2(effectiveOperationMode); + VerifyOrReturn(CheckConstraintType("speed", "", "uint16")); + NextTest(); } - static void OnFailureCallback_3(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_26() { - (static_cast(context))->OnFailureResponse_3(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_26, OnFailureCallback_26, true)); + return CHIP_NO_ERROR; + } - static void OnFailureCallback_4(void * context, CHIP_ERROR error) + void OnFailureResponse_26(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_4(error); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - static void OnSuccessCallback_4(void * context, uint8_t effectiveControlMode) + void OnSuccessResponse_26(const chip::app::DataModel::Nullable & lifetimeRunningHours) { - (static_cast(context))->OnSuccessResponse_4(effectiveControlMode); + VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); + VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 0UL)); + + NextTest(); } - static void OnFailureCallback_5(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_27() { - (static_cast(context))->OnFailureResponse_5(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_27, OnFailureCallback_27, true)); + return CHIP_NO_ERROR; + } - static void OnFailureCallback_6(void * context, CHIP_ERROR error) + void OnFailureResponse_27(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_6(error); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - - static void OnFailureCallback_7(void * context, CHIP_ERROR error) + void OnSuccessResponse_27(const chip::app::DataModel::Nullable & lifetimeRunningHours) { - (static_cast(context))->OnFailureResponse_7(error); + VerifyOrReturn(CheckConstraintType("lifetimeRunningHours", "", "uint24")); + NextTest(); } - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - - static void OnFailureCallback_8(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheOptionalAttributePower_28() { - (static_cast(context))->OnFailureResponse_8(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_28, OnFailureCallback_28, true)); + return CHIP_NO_ERROR; + } - static void OnFailureCallback_9(void * context, CHIP_ERROR error) + void OnFailureResponse_28(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_9(error); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + void OnSuccessResponse_28(uint32_t power) { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + VerifyOrReturn(CheckConstraintType("power", "", "uint24")); + NextTest(); } - CHIP_ERROR TestWrite0ToTheOperationModeAttributeToDut_1() + CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_29() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t operationModeArgument; - operationModeArgument = 0; - ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); + cluster.ReadAttribute( + this, OnSuccessCallback_29, OnFailureCallback_29, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_1(CHIP_ERROR error) + void OnFailureResponse_29(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_29(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); + VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 0UL)); - CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_2() + NextTest(); + } + + CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_30() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_30, OnFailureCallback_30, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_2(CHIP_ERROR error) + void OnFailureResponse_30(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t effectiveOperationMode) + void OnSuccessResponse_30(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) { - VerifyOrReturn(CheckValue("effectiveOperationMode", effectiveOperationMode, 0)); - + VerifyOrReturn(CheckConstraintType("lifetimeEnergyConsumed", "", "uint32")); NextTest(); } - CHIP_ERROR TestWrite0ToTheControlModeAttributeToDut_3() + CHIP_ERROR TestWriteToTheOptionalAttributeLifetimeEnergyConsumed_31() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 0; + chip::app::DataModel::Nullable lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument.SetNonNull(); + lifetimeEnergyConsumedArgument.Value() = 0UL; ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + cluster.WriteAttribute( + lifetimeEnergyConsumedArgument, this, OnSuccessCallback_31, OnFailureCallback_31)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_31(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_31() { NextTest(); } - CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_4() + CHIP_ERROR TestReadTheOptionalAttributeMinConstPressure_32() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_32, OnFailureCallback_32, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(CHIP_ERROR error) + void OnFailureResponse_32(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_4(uint8_t effectiveControlMode) + void OnSuccessResponse_32(int16_t minConstPressure) { - VerifyOrReturn(CheckValue("effectiveControlMode", effectiveControlMode, 0)); - + VerifyOrReturn(CheckConstraintType("minConstPressure", "", "int16")); NextTest(); } - CHIP_ERROR TestWrite1ToTheControlModeAttributeToDut_5() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstPressure_33() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 1; - ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); + cluster.ReadAttribute( + this, OnSuccessCallback_33, OnFailureCallback_33, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_5(CHIP_ERROR error) + void OnFailureResponse_33(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_5() { NextTest(); } + void OnSuccessResponse_33(int16_t maxConstPressure) + { + VerifyOrReturn(CheckConstraintType("maxConstPressure", "", "int16")); + NextTest(); + } - CHIP_ERROR TestWrite2ToTheControlModeAttributeToDut_6() + CHIP_ERROR TestReadTheOptionalAttributeMinCompPressure_34() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 2; - ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_6, OnFailureCallback_6)); + cluster.ReadAttribute( + this, OnSuccessCallback_34, OnFailureCallback_34, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_34(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_34(int16_t minCompPressure) + { + VerifyOrReturn(CheckConstraintType("minCompPressure", "", "int16")); + NextTest(); + } - CHIP_ERROR TestWrite3ToTheControlModeAttributeToDut_7() + CHIP_ERROR TestReadTheOptionalAttributeMaxCompPressure_35() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 3; - ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); + cluster.ReadAttribute( + this, OnSuccessCallback_35, OnFailureCallback_35, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(CHIP_ERROR error) + void OnFailureResponse_35(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_7() { NextTest(); } + void OnSuccessResponse_35(int16_t maxCompPressure) + { + VerifyOrReturn(CheckConstraintType("maxCompPressure", "", "int16")); + NextTest(); + } - CHIP_ERROR TestWrite5ToTheControlModeAttributeToDut_8() + CHIP_ERROR TestReadTheOptionalAttributeMinConstSpeed_36() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 5; - ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + cluster.ReadAttribute( + this, OnSuccessCallback_36, OnFailureCallback_36, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_36(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_8() { NextTest(); } + void OnSuccessResponse_36(uint16_t minConstSpeed) + { + VerifyOrReturn(CheckConstraintType("minConstSpeed", "", "uint16")); + NextTest(); + } - CHIP_ERROR TestWrite7ToTheControlModeAttributeToDut_9() + CHIP_ERROR TestReadTheOptionalAttributeMaxConstSpeed_37() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 7; - ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); + cluster.ReadAttribute( + this, OnSuccessCallback_37, OnFailureCallback_37, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_9(CHIP_ERROR error) + void OnFailureResponse_37(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_9() { NextTest(); } -}; - -class Test_TC_PCC_2_4Suite : public TestCommand -{ -public: - Test_TC_PCC_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_PCC_2_4", credsIssuerConfig), mTestIndex(0) + void OnSuccessResponse_37(uint16_t maxConstSpeed) { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + VerifyOrReturn(CheckConstraintType("maxConstSpeed", "", "uint16")); + NextTest(); } - ~Test_TC_PCC_2_4Suite() {} - - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadTheOptionalAttributeMinConstFlow_38() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_4\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_4\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Write 1 to the LifetimeRunningHours attribute to DUT\n"); - err = TestWrite1ToTheLifetimeRunningHoursAttributeToDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: LifetimeRunningHours\n"); - err = TestReadsTheAttributeLifetimeRunningHours_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write 2 to the LifetimeRunningHours attribute to DUT\n"); - err = TestWrite2ToTheLifetimeRunningHoursAttributeToDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: LifetimeRunningHours\n"); - err = TestReadsTheAttributeLifetimeRunningHours_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write 3 to the LifetimeRunningHours attribute to DUT\n"); - err = TestWrite3ToTheLifetimeRunningHoursAttributeToDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: LifetimeRunningHours\n"); - err = TestReadsTheAttributeLifetimeRunningHours_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write 1 to the LifetimeEnergyConsumed attribute to DUT\n"); - err = TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write 2 to the LifetimeEnergyConsumed attribute to DUT\n"); - err = TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the attribute: LifetimeEnergyConsumed\n"); - err = TestReadsTheAttributeLifetimeEnergyConsumed_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Write 3 to the LifetimeEnergyConsumed attribute to DUT\n"); - err = TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the attribute: LifetimeEnergyConsumed\n"); - err = TestReadsTheAttributeLifetimeEnergyConsumed_11(); - break; - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_38, OnFailureCallback_38, true)); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnFailureResponse_38(CHIP_ERROR error) { - bool isExpectedDnssdResult = false; - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - static void OnFailureCallback_1(void * context, CHIP_ERROR error) + void OnSuccessResponse_38(uint16_t minConstFlow) { - (static_cast(context))->OnFailureResponse_1(error); + VerifyOrReturn(CheckConstraintType("minConstFlow", "", "uint16")); + NextTest(); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - - static void OnFailureCallback_2(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheOptionalAttributeMaxConstFlow_39() { - (static_cast(context))->OnFailureResponse_2(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_2(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) - { - (static_cast(context))->OnSuccessResponse_2(lifetimeRunningHours); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_39, OnFailureCallback_39, true)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_3(void * context, CHIP_ERROR error) + void OnFailureResponse_39(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, CHIP_ERROR error) + void OnSuccessResponse_39(uint16_t maxConstFlow) { - (static_cast(context))->OnFailureResponse_4(error); + VerifyOrReturn(CheckConstraintType("maxConstFlow", "", "uint16")); + NextTest(); } - static void OnSuccessCallback_4(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) + CHIP_ERROR TestReadTheOptionalAttributeMinConstTemp_40() { - (static_cast(context))->OnSuccessResponse_4(lifetimeRunningHours); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_40, OnFailureCallback_40, true)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_5(void * context, CHIP_ERROR error) + void OnFailureResponse_40(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_5(error); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, CHIP_ERROR error) + void OnSuccessResponse_40(int16_t minConstTemp) { - (static_cast(context))->OnFailureResponse_6(error); + VerifyOrReturn(CheckConstraintType("minConstTemp", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("minConstTemp", minConstTemp, -27315)); + NextTest(); } - static void OnSuccessCallback_6(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) + CHIP_ERROR TestReadTheOptionalAttributeMaxConstTemp_41() { - (static_cast(context))->OnSuccessResponse_6(lifetimeRunningHours); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_41, OnFailureCallback_41, true)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_7(void * context, CHIP_ERROR error) + void OnFailureResponse_41(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_7(error); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - - static void OnFailureCallback_8(void * context, CHIP_ERROR error) + void OnSuccessResponse_41(int16_t maxConstTemp) { - (static_cast(context))->OnFailureResponse_8(error); + VerifyOrReturn(CheckConstraintType("maxConstTemp", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("maxConstTemp", maxConstTemp, -27315)); + NextTest(); } - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheOptionalAttributePumpStatus_42() { - (static_cast(context))->OnFailureResponse_9(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_42, OnFailureCallback_42, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_9(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + void OnFailureResponse_42(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_9(lifetimeEnergyConsumed); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - static void OnFailureCallback_10(void * context, CHIP_ERROR error) + void OnSuccessResponse_42(uint16_t pumpStatus) { - (static_cast(context))->OnFailureResponse_10(error); - } + VerifyOrReturn(CheckValue("pumpStatus", pumpStatus, 0U)); - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + NextTest(); + } - static void OnFailureCallback_11(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheOptionalAttributePumpStatus_43() { - (static_cast(context))->OnFailureResponse_11(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_43, OnFailureCallback_43, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_11(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + void OnFailureResponse_43(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_11(lifetimeEnergyConsumed); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + void OnSuccessResponse_43(uint16_t pumpStatus) { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + VerifyOrReturn(CheckConstraintType("pumpStatus", "", "map16")); + NextTest(); } - CHIP_ERROR TestWrite1ToTheLifetimeRunningHoursAttributeToDut_1() + CHIP_ERROR TestReadTheOptionalAttributeSpeed_44() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable lifetimeRunningHoursArgument; - lifetimeRunningHoursArgument.SetNonNull(); - lifetimeRunningHoursArgument.Value() = 1UL; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - lifetimeRunningHoursArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_44, OnFailureCallback_44, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_1(CHIP_ERROR error) + void OnFailureResponse_44(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_44(uint16_t speed) + { + VerifyOrReturn(CheckConstraintType("speed", "", "uint16")); + NextTest(); + } - CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_2() + CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_45() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -39313,173 +37912,72 @@ class Test_TC_PCC_2_4Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2, true)); + this, OnSuccessCallback_45, OnFailureCallback_45, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_2(CHIP_ERROR error) + void OnFailureResponse_45(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_2(const chip::app::DataModel::Nullable & lifetimeRunningHours) + void OnSuccessResponse_45(const chip::app::DataModel::Nullable & lifetimeRunningHours) { VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); - VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 1UL)); + VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 0UL)); NextTest(); } - CHIP_ERROR TestWrite2ToTheLifetimeRunningHoursAttributeToDut_3() + CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_46() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable lifetimeRunningHoursArgument; - lifetimeRunningHoursArgument.SetNonNull(); - lifetimeRunningHoursArgument.Value() = 2UL; - ReturnErrorOnFailure( - cluster.WriteAttribute( - lifetimeRunningHoursArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + cluster.ReadAttribute( + this, OnSuccessCallback_46, OnFailureCallback_46, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_46(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_4() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_4(const chip::app::DataModel::Nullable & lifetimeRunningHours) + void OnSuccessResponse_46(const chip::app::DataModel::Nullable & lifetimeRunningHours) { - VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); - VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 2UL)); - + VerifyOrReturn(CheckConstraintType("lifetimeRunningHours", "", "uint24")); NextTest(); } - CHIP_ERROR TestWrite3ToTheLifetimeRunningHoursAttributeToDut_5() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable lifetimeRunningHoursArgument; - lifetimeRunningHoursArgument.SetNonNull(); - lifetimeRunningHoursArgument.Value() = 3UL; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - lifetimeRunningHoursArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_6() + CHIP_ERROR TestReadTheOptionalAttributePower_47() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_47, OnFailureCallback_47, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_47(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_6(const chip::app::DataModel::Nullable & lifetimeRunningHours) + void OnSuccessResponse_47(uint32_t power) { - VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); - VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 3UL)); - + VerifyOrReturn(CheckConstraintType("power", "", "uint24")); NextTest(); } - CHIP_ERROR TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument.SetNonNull(); - lifetimeEnergyConsumedArgument.Value() = 1UL; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - lifetimeEnergyConsumedArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_8() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument.SetNonNull(); - lifetimeEnergyConsumedArgument.Value() = 2UL; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - lifetimeEnergyConsumedArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_9() + CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_48() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -39487,49 +37985,25 @@ class Test_TC_PCC_2_4Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9, true)); + this, OnSuccessCallback_48, OnFailureCallback_48, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_9(CHIP_ERROR error) + void OnFailureResponse_48(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_9(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + void OnSuccessResponse_48(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) { VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); - VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 2UL)); + VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 0UL)); NextTest(); } - CHIP_ERROR TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_10() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable lifetimeEnergyConsumedArgument; - lifetimeEnergyConsumedArgument.SetNonNull(); - lifetimeEnergyConsumedArgument.Value() = 3UL; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - lifetimeEnergyConsumedArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_10() { NextTest(); } - - CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_11() + CHIP_ERROR TestReadTheOptionalAttributeLifetimeEnergyConsumed_49() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -39537,37 +38011,35 @@ class Test_TC_PCC_2_4Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11, true)); + this, OnSuccessCallback_49, OnFailureCallback_49, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_11(CHIP_ERROR error) + void OnFailureResponse_49(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_11(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + void OnSuccessResponse_49(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) { - VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); - VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 3UL)); - + VerifyOrReturn(CheckConstraintType("lifetimeEnergyConsumed", "", "uint32")); NextTest(); } }; -class Test_TC_RH_1_1Suite : public TestCommand +class Test_TC_PCC_2_2Suite : public TestCommand { public: - Test_TC_RH_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_RH_1_1", credsIssuerConfig), mTestIndex(0) + Test_TC_PCC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PCC_2_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_RH_1_1Suite() {} + ~Test_TC_PCC_2_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -39576,12 +38048,12 @@ class Test_TC_RH_1_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -39599,17 +38071,31 @@ class Test_TC_RH_1_1Suite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Write 1 to the OperationMode attribute to DUT: OperationMode\n"); + if (ShouldSkip("A_OPERATIONMODE")) + { + NextTest(); + return; + } + err = TestWrite1ToTheOperationModeAttributeToDutOperationMode_1(); break; case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Write 2 to the OperationMode attribute to DUT: OperationMode\n"); + if (ShouldSkip("A_OPERATIONMODE")) + { + NextTest(); + return; + } + err = TestWrite2ToTheOperationModeAttributeToDutOperationMode_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write 3 to the OperationMode attribute to DUT: OperationMode\n"); + if (ShouldSkip("A_OPERATIONMODE")) + { + NextTest(); + return; + } + err = TestWrite3ToTheOperationModeAttributeToDutOperationMode_3(); break; } @@ -39638,30 +38124,24 @@ class Test_TC_RH_1_1Suite : public TestCommand static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) - { - (static_cast(context))->OnSuccessResponse_3(attributeList); - } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } // // Tests methods @@ -39673,15 +38153,18 @@ class Test_TC_RH_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestWrite1ToTheOperationModeAttributeToDutOperationMode_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); + uint8_t operationModeArgument; + operationModeArgument = 1; + ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1, true)); + cluster.WriteAttribute( + operationModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); return CHIP_NO_ERROR; } @@ -39691,45 +38174,43 @@ class Test_TC_RH_1_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - } + void OnSuccessResponse_1() { NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 1U; + uint8_t operationModeArgument; + operationModeArgument = 2; ReturnErrorOnFailure( - cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + cluster.WriteAttribute( + operationModeArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); return CHIP_NO_ERROR; } void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + ThrowFailureResponse(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); + uint8_t operationModeArgument; + operationModeArgument = 3; + ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3, true)); + cluster.WriteAttribute( + operationModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); return CHIP_NO_ERROR; } @@ -39739,25 +38220,21 @@ class Test_TC_RH_1_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) - { - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - NextTest(); - } + void OnSuccessResponse_3() { NextTest(); } }; -class Test_TC_RH_2_1Suite : public TestCommand +class Test_TC_PCC_2_3Suite : public TestCommand { public: - Test_TC_RH_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_RH_2_1", credsIssuerConfig), mTestIndex(0) + Test_TC_PCC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PCC_2_3", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_RH_2_1Suite() {} + ~Test_TC_PCC_2_3Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -39766,12 +38243,12 @@ class Test_TC_RH_2_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -39789,20 +38266,85 @@ class Test_TC_RH_2_1Suite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads constraints of attribute: MeasuredValue\n"); - err = TestReadsConstraintsOfAttributeMeasuredValue_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Write 0 to the OperationMode attribute to DUT\n"); + if (ShouldSkip("A_OPERATIONMODE")) + { + NextTest(); + return; + } + err = TestWrite0ToTheOperationModeAttributeToDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads constraints of attribute: MinMeasuredValue\n"); - err = TestReadsConstraintsOfAttributeMinMeasuredValue_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) + { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveOperationMode_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the optional attribute: Tolerance\n"); - err = TestReadsTheOptionalAttributeTolerance_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write 0 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite0ToTheControlModeAttributeToDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads constraints of attribute: Tolerance\n"); - err = TestReadsConstraintsOfAttributeTolerance_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) + { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Write 1 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite1ToTheControlModeAttributeToDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Write 2 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite2ToTheControlModeAttributeToDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write 3 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite3ToTheControlModeAttributeToDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Write 5 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite5ToTheControlModeAttributeToDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Write 7 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite7ToTheControlModeAttributeToDut_9(); break; } @@ -39815,7 +38357,7 @@ class Test_TC_RH_2_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -39831,44 +38373,73 @@ class Test_TC_RH_2_1Suite : public TestCommand static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_1(void * context, uint16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_1(measuredValue); - } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context, uint16_t minMeasuredValue) + static void OnSuccessCallback_2(void * context, uint8_t effectiveOperationMode) { - (static_cast(context))->OnSuccessResponse_2(minMeasuredValue); + (static_cast(context))->OnSuccessResponse_2(effectiveOperationMode); } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_3(void * context, uint16_t tolerance) + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_3(tolerance); + (static_cast(context))->OnFailureResponse_4(error); } - static void OnFailureCallback_4(void * context, CHIP_ERROR error) + static void OnSuccessCallback_4(void * context, uint8_t effectiveControlMode) { - (static_cast(context))->OnFailureResponse_4(error); + (static_cast(context))->OnSuccessResponse_4(effectiveControlMode); } - static void OnSuccessCallback_4(void * context, uint16_t tolerance) + static void OnFailureCallback_5(void * context, CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_4(tolerance); + (static_cast(context))->OnFailureResponse_5(error); + } + + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + + static void OnFailureCallback_7(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_7(error); + } + + static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + + static void OnFailureCallback_8(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_8(error); } + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } + // // Tests methods // @@ -39879,15 +38450,18 @@ class Test_TC_RH_2_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestReadsConstraintsOfAttributeMeasuredValue_1() + CHIP_ERROR TestWrite0ToTheOperationModeAttributeToDut_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); + uint8_t operationModeArgument; + operationModeArgument = 0; + ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1, true)); + cluster.WriteAttribute( + operationModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); return CHIP_NO_ERROR; } @@ -39897,20 +38471,16 @@ class Test_TC_RH_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); - } + void OnSuccessResponse_1() { NextTest(); } - CHIP_ERROR TestReadsConstraintsOfAttributeMinMeasuredValue_2() + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( + cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } @@ -39921,47 +38491,44 @@ class Test_TC_RH_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t minMeasuredValue) + void OnSuccessResponse_2(uint8_t effectiveOperationMode) { - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", minMeasuredValue, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", minMeasuredValue, 9999U)); + VerifyOrReturn(CheckValue("effectiveOperationMode", effectiveOperationMode, 0)); + NextTest(); } - CHIP_ERROR TestReadsTheOptionalAttributeTolerance_3() + CHIP_ERROR TestWrite0ToTheControlModeAttributeToDut_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); + uint8_t controlModeArgument; + controlModeArgument = 0; + ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3, true)); + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); return CHIP_NO_ERROR; } void OnFailureResponse_3(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t tolerance) - { - VerifyOrReturn(CheckValue("tolerance", tolerance, 0U)); - - NextTest(); - } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestReadsConstraintsOfAttributeTolerance_4() + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( + cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } @@ -39969,194 +38536,144 @@ class Test_TC_RH_2_1Suite : public TestCommand void OnFailureResponse_4(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_4(uint16_t tolerance) + void OnSuccessResponse_4(uint8_t effectiveControlMode) { - VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); - VerifyOrReturn(CheckConstraintMinValue("tolerance", tolerance, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("tolerance", tolerance, 2048U)); + VerifyOrReturn(CheckValue("effectiveControlMode", effectiveControlMode, 0)); + NextTest(); } -}; -class Test_TC_RH_2_2Suite : public TestCommand -{ -public: - Test_TC_RH_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_RH_2_2", credsIssuerConfig), mTestIndex(0) + CHIP_ERROR TestWrite1ToTheControlModeAttributeToDut_5() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - } - - ~Test_TC_RH_2_2Suite() {} + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + uint8_t controlModeArgument; + controlModeArgument = 1; - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_2_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads MeasuredValue attribute from DUT\n"); - if (ShouldSkip("A_RELATIVEHUMIDITY")) - { - NextTest(); - return; - } - err = TestReadsMeasuredValueAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute: MeasuredValue\n"); - if (ShouldSkip("A_RELATIVEHUMIDITY")) - { - NextTest(); - return; - } - err = TestReadTheMandatoryAttributeMeasuredValue_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + ReturnErrorOnFailure( + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + void OnFailureResponse_5(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; + void OnSuccessResponse_5() { NextTest(); } - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + CHIP_ERROR TestWrite2ToTheControlModeAttributeToDut_6() { - bool isExpectedDnssdResult = false; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); - } + uint8_t controlModeArgument; + controlModeArgument = 2; - static void OnFailureCallback_1(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_1(error); + ReturnErrorOnFailure( + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_6, OnFailureCallback_6)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_1(void * context, uint16_t measuredValue) + void OnFailureResponse_6(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_1(measuredValue); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnFailureCallback_2(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_2(error); - } + void OnSuccessResponse_6() { NextTest(); } - static void OnSuccessCallback_2(void * context, uint16_t measuredValue) + CHIP_ERROR TestWrite3ToTheControlModeAttributeToDut_7() { - (static_cast(context))->OnSuccessResponse_2(measuredValue); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - // - // Tests methods - // + uint8_t controlModeArgument; + controlModeArgument = 3; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + ReturnErrorOnFailure( + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(CHIP_ERROR error) { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - CHIP_ERROR TestReadsMeasuredValueAttributeFromDut_1() + void OnSuccessResponse_7() { NextTest(); } + + CHIP_ERROR TestWrite5ToTheControlModeAttributeToDut_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); + uint8_t controlModeArgument; + controlModeArgument = 5; + ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1, true)); + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); return CHIP_NO_ERROR; } - void OnFailureResponse_1(CHIP_ERROR error) + void OnFailureResponse_8(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); - } + void OnSuccessResponse_8() { NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_2() + CHIP_ERROR TestWrite7ToTheControlModeAttributeToDut_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); + uint8_t controlModeArgument; + controlModeArgument = 7; + ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2, true)); + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); return CHIP_NO_ERROR; } - void OnFailureResponse_2(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); - } + void OnSuccessResponse_9() { NextTest(); } }; -class Test_TC_SWTCH_2_1Suite : public TestCommand +class Test_TC_PCC_2_4Suite : public TestCommand { public: - Test_TC_SWTCH_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_SWTCH_2_1", credsIssuerConfig), mTestIndex(0) + Test_TC_PCC_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PCC_2_4", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_SWTCH_2_1Suite() {} + ~Test_TC_PCC_2_4Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -40165,12 +38682,12 @@ class Test_TC_SWTCH_2_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWTCH_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -40188,28 +38705,48 @@ class Test_TC_SWTCH_2_1Suite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read NumberOfPositions attribute\n"); - err = TestReadNumberOfPositionsAttribute_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Write 1 to the LifetimeRunningHours attribute to DUT\n"); + err = TestWrite1ToTheLifetimeRunningHoursAttributeToDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read NumberOfPositions attribute\n"); - err = TestReadNumberOfPositionsAttribute_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: LifetimeRunningHours\n"); + err = TestReadsTheAttributeLifetimeRunningHours_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); - err = TestReadCurrentPositionAttribute_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write 2 to the LifetimeRunningHours attribute to DUT\n"); + err = TestWrite2ToTheLifetimeRunningHoursAttributeToDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentPosition attribute\n"); - err = TestReadCurrentPositionAttribute_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: LifetimeRunningHours\n"); + err = TestReadsTheAttributeLifetimeRunningHours_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read MultiPressMax attribute\n"); - err = TestReadMultiPressMaxAttribute_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Write 3 to the LifetimeRunningHours attribute to DUT\n"); + err = TestWrite3ToTheLifetimeRunningHoursAttributeToDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read MultiPressMax attribute\n"); - err = TestReadMultiPressMaxAttribute_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: LifetimeRunningHours\n"); + err = TestReadsTheAttributeLifetimeRunningHours_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write 1 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Write 2 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Write 3 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_11(); break; } @@ -40222,7 +38759,7 @@ class Test_TC_SWTCH_2_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -40238,62 +38775,94 @@ class Test_TC_SWTCH_2_1Suite : public TestCommand static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_1(void * context, uint8_t numberOfPositions) - { - (static_cast(context))->OnSuccessResponse_1(numberOfPositions); - } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context, uint8_t numberOfPositions) + static void OnSuccessCallback_2(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) { - (static_cast(context))->OnSuccessResponse_2(numberOfPositions); + (static_cast(context))->OnSuccessResponse_2(lifetimeRunningHours); } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_3(void * context, uint8_t currentPosition) - { - (static_cast(context))->OnSuccessResponse_3(currentPosition); - } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } static void OnFailureCallback_4(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_4(error); + (static_cast(context))->OnFailureResponse_4(error); } - static void OnSuccessCallback_4(void * context, uint8_t currentPosition) + static void OnSuccessCallback_4(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) { - (static_cast(context))->OnSuccessResponse_4(currentPosition); + (static_cast(context))->OnSuccessResponse_4(lifetimeRunningHours); } static void OnFailureCallback_5(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_5(error); + (static_cast(context))->OnFailureResponse_5(error); } - static void OnSuccessCallback_5(void * context, uint8_t multiPressMax) + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + + static void OnFailureCallback_6(void * context, CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_5(multiPressMax); + (static_cast(context))->OnFailureResponse_6(error); } - static void OnFailureCallback_6(void * context, CHIP_ERROR error) + static void OnSuccessCallback_6(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) { - (static_cast(context))->OnFailureResponse_6(error); + (static_cast(context))->OnSuccessResponse_6(lifetimeRunningHours); } - static void OnSuccessCallback_6(void * context, uint8_t multiPressMax) + static void OnFailureCallback_7(void * context, CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_6(multiPressMax); + (static_cast(context))->OnFailureResponse_7(error); + } + + static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + + static void OnFailureCallback_8(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_8(error); + } + + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void OnSuccessCallback_9(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + (static_cast(context))->OnSuccessResponse_9(lifetimeEnergyConsumed); + } + + static void OnFailureCallback_10(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_10(error); + } + + static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + + static void OnFailureCallback_11(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_11(error); + } + + static void OnSuccessCallback_11(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + (static_cast(context))->OnSuccessResponse_11(lifetimeEnergyConsumed); } // @@ -40306,14 +38875,19 @@ class Test_TC_SWTCH_2_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestReadNumberOfPositionsAttribute_1() + CHIP_ERROR TestWrite1ToTheLifetimeRunningHoursAttributeToDut_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::SwitchClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1, true)); + chip::app::DataModel::Nullable lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument.SetNonNull(); + lifetimeRunningHoursArgument.Value() = 1UL; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + lifetimeRunningHoursArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); return CHIP_NO_ERROR; } @@ -40323,21 +38897,17 @@ class Test_TC_SWTCH_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_1(uint8_t numberOfPositions) - { - VerifyOrReturn(CheckValue("numberOfPositions", numberOfPositions, 2)); - - NextTest(); - } + void OnSuccessResponse_1() { NextTest(); } - CHIP_ERROR TestReadNumberOfPositionsAttribute_2() + CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::SwitchClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } @@ -40347,21 +38917,27 @@ class Test_TC_SWTCH_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t numberOfPositions) + void OnSuccessResponse_2(const chip::app::DataModel::Nullable & lifetimeRunningHours) { - VerifyOrReturn(CheckConstraintType("numberOfPositions", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("numberOfPositions", numberOfPositions, 2)); + VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); + VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 1UL)); + NextTest(); } - CHIP_ERROR TestReadCurrentPositionAttribute_3() + CHIP_ERROR TestWrite2ToTheLifetimeRunningHoursAttributeToDut_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::SwitchClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3, true)); + chip::app::DataModel::Nullable lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument.SetNonNull(); + lifetimeRunningHoursArgument.Value() = 2UL; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + lifetimeRunningHoursArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); return CHIP_NO_ERROR; } @@ -40371,21 +38947,17 @@ class Test_TC_SWTCH_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_3(uint8_t currentPosition) - { - VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); - - NextTest(); - } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestReadCurrentPositionAttribute_4() + CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::SwitchClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } @@ -40395,21 +38967,27 @@ class Test_TC_SWTCH_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_4(uint8_t currentPosition) + void OnSuccessResponse_4(const chip::app::DataModel::Nullable & lifetimeRunningHours) { - VerifyOrReturn(CheckConstraintType("currentPosition", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("currentPosition", currentPosition, 0)); + VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); + VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 2UL)); + NextTest(); } - CHIP_ERROR TestReadMultiPressMaxAttribute_5() + CHIP_ERROR TestWrite3ToTheLifetimeRunningHoursAttributeToDut_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::SwitchClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5, true)); + chip::app::DataModel::Nullable lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument.SetNonNull(); + lifetimeRunningHoursArgument.Value() = 3UL; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + lifetimeRunningHoursArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); return CHIP_NO_ERROR; } @@ -40419,554 +38997,171 @@ class Test_TC_SWTCH_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_5(uint8_t multiPressMax) + void OnSuccessResponse_5() { NextTest(); } + + CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_6() { - VerifyOrReturn(CheckValue("multiPressMax", multiPressMax, 2)); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_6(const chip::app::DataModel::Nullable & lifetimeRunningHours) + { + VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); + VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 3UL)); NextTest(); } - CHIP_ERROR TestReadMultiPressMaxAttribute_6() + CHIP_ERROR TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::SwitchClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6, true)); + chip::app::DataModel::Nullable lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument.SetNonNull(); + lifetimeEnergyConsumedArgument.Value() = 1UL; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + lifetimeEnergyConsumedArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_6(uint8_t multiPressMax) + void OnSuccessResponse_7() { NextTest(); } + + CHIP_ERROR TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_8() { - VerifyOrReturn(CheckConstraintType("multiPressMax", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("multiPressMax", multiPressMax, 2)); - NextTest(); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument.SetNonNull(); + lifetimeEnergyConsumedArgument.Value() = 2UL; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + lifetimeEnergyConsumedArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + return CHIP_NO_ERROR; } -}; -class Test_TC_SWTCH_2_2Suite : public TestCommand -{ -public: - Test_TC_SWTCH_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_SWTCH_2_2", credsIssuerConfig), mTestIndex(0) + void OnFailureResponse_8(CHIP_ERROR error) { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - ~Test_TC_SWTCH_2_2Suite() {} + void OnSuccessResponse_8() { NextTest(); } - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_9() { - CHIP_ERROR err = CHIP_NO_ERROR; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWTCH_2_2\n"); - } + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_9, OnFailureCallback_9, true)); + return CHIP_NO_ERROR; + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + void OnFailureResponse_9(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - Wait(); + void OnSuccessResponse_9(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); + VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 2UL)); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : User interaction needed\n"); - err = TestUserInteractionNeeded_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : User interaction needed\n"); - err = TestUserInteractionNeeded_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); - err = TestReadCurrentPositionAttribute_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : User interaction needed\n"); - err = TestUserInteractionNeeded_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : User interaction needed\n"); - err = TestUserInteractionNeeded_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : User interaction needed\n"); - err = TestUserInteractionNeeded_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read CurrentPosition attribute\n"); - err = TestReadCurrentPositionAttribute_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : User interaction needed\n"); - err = TestUserInteractionNeeded_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : User interaction needed\n"); - err = TestUserInteractionNeeded_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : User interaction needed\n"); - err = TestUserInteractionNeeded_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : User interaction needed\n"); - err = TestUserInteractionNeeded_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : User interaction needed\n"); - err = TestUserInteractionNeeded_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : User interaction needed\n"); - err = TestUserInteractionNeeded_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : User interaction needed\n"); - err = TestUserInteractionNeeded_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 3000ms\n"); - err = TestWait3000ms_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : User interaction needed\n"); - err = TestUserInteractionNeeded_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : User interaction needed\n"); - err = TestUserInteractionNeeded_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : User interaction needed\n"); - err = TestUserInteractionNeeded_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : User interaction needed\n"); - err = TestUserInteractionNeeded_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : User interaction needed\n"); - err = TestUserInteractionNeeded_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : User interaction needed\n"); - err = TestUserInteractionNeeded_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 3000ms\n"); - err = TestWait3000ms_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : User interaction needed\n"); - err = TestUserInteractionNeeded_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : User interaction needed\n"); - err = TestUserInteractionNeeded_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : User interaction needed\n"); - err = TestUserInteractionNeeded_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : User interaction needed\n"); - err = TestUserInteractionNeeded_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : User interaction needed\n"); - err = TestUserInteractionNeeded_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : User interaction needed\n"); - err = TestUserInteractionNeeded_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : User interaction needed\n"); - err = TestUserInteractionNeeded_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : User interaction needed\n"); - err = TestUserInteractionNeeded_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : User interaction needed\n"); - err = TestUserInteractionNeeded_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : User interaction needed\n"); - err = TestUserInteractionNeeded_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : User interaction needed\n"); - err = TestUserInteractionNeeded_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : User interaction needed\n"); - err = TestUserInteractionNeeded_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : User interaction needed\n"); - err = TestUserInteractionNeeded_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : User interaction needed\n"); - err = TestUserInteractionNeeded_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : User interaction needed\n"); - err = TestUserInteractionNeeded_37(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 38; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override - { - bool isExpectedDnssdResult = false; - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); NextTest(); } - static void OnFailureCallback_3(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_3(error); - } - - static void OnSuccessCallback_3(void * context, uint8_t currentPosition) - { - (static_cast(context))->OnSuccessResponse_3(currentPosition); - } - - static void OnFailureCallback_7(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_7(error); - } - - static void OnSuccessCallback_7(void * context, uint8_t currentPosition) - { - (static_cast(context))->OnSuccessResponse_7(currentPosition); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - } - - CHIP_ERROR TestUserInteractionNeeded_1() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Set up subscription to SwitchLatched event"); - } - - CHIP_ERROR TestUserInteractionNeeded_2() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator sets switch to first position"); - } - - CHIP_ERROR TestReadCurrentPositionAttribute_3() + CHIP_ERROR TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_10() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::SwitchClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3, true)); + chip::app::DataModel::Nullable lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument.SetNonNull(); + lifetimeEnergyConsumedArgument.Value() = 3UL; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + lifetimeEnergyConsumedArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_10(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_3(uint8_t currentPosition) - { - VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); - - NextTest(); - } - - CHIP_ERROR TestUserInteractionNeeded_4() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator sets switch to second position"); - } - - CHIP_ERROR TestUserInteractionNeeded_5() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Set up subscription to InitialPress event"); - } - - CHIP_ERROR TestUserInteractionNeeded_6() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator does not operate switch"); - } + void OnSuccessResponse_10() { NextTest(); } - CHIP_ERROR TestReadCurrentPositionAttribute_7() + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_11() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::SwitchClusterTest cluster; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_11, OnFailureCallback_11, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(CHIP_ERROR error) + void OnFailureResponse_11(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_7(uint8_t currentPosition) + void OnSuccessResponse_11(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) { - VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); + VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); + VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 3UL)); NextTest(); } - - CHIP_ERROR TestUserInteractionNeeded_8() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator sets switch to second position"); - } - - CHIP_ERROR TestUserInteractionNeeded_9() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator does not operate switch (release switch)"); - } - - CHIP_ERROR TestUserInteractionNeeded_10() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Set up subscription to InitialPress and ShortRelease events"); - } - - CHIP_ERROR TestUserInteractionNeeded_11() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator does not operate switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_12() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch (press briefly)"); - } - - CHIP_ERROR TestUserInteractionNeeded_13() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_14() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch for 5 seconds"); - } - - CHIP_ERROR TestWait3000ms_15() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(3000); - } - - CHIP_ERROR TestUserInteractionNeeded_16() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_17() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events"); - } - - CHIP_ERROR TestUserInteractionNeeded_18() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator does not operate switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_19() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch (press briefly)"); - } - - CHIP_ERROR TestUserInteractionNeeded_20() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_21() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch for 5 seconds"); - } - - CHIP_ERROR TestWait3000ms_22() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(3000); - } - - CHIP_ERROR TestUserInteractionNeeded_23() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_24() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events"); - } - - CHIP_ERROR TestUserInteractionNeeded_25() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator does not operate switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_26() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch (press briefly)"); - } - - CHIP_ERROR TestUserInteractionNeeded_27() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_28() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch (press briefly)"); - } - - CHIP_ERROR TestUserInteractionNeeded_29() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_30() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch again (press briefly)"); - } - - CHIP_ERROR TestUserInteractionNeeded_31() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_32() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch again (press briefly)"); - } - - CHIP_ERROR TestUserInteractionNeeded_33() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_34() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch again (press briefly)"); - } - - CHIP_ERROR TestUserInteractionNeeded_35() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); - } - - CHIP_ERROR TestUserInteractionNeeded_36() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch again (press briefly)"); - } - - CHIP_ERROR TestUserInteractionNeeded_37() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); - } }; -class Test_TC_TM_1_1Suite : public TestCommand +class Test_TC_RH_1_1Suite : public TestCommand { public: - Test_TC_TM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_TM_1_1", credsIssuerConfig), mTestIndex(0) + Test_TC_RH_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_RH_1_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_TM_1_1Suite() {} + ~Test_TC_RH_1_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -40975,12 +39170,12 @@ class Test_TC_TM_1_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -41037,29 +39232,29 @@ class Test_TC_TM_1_1Suite : public TestCommand static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_1(error); } static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_3(error); } static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) { - (static_cast(context))->OnSuccessResponse_3(attributeList); + (static_cast(context))->OnSuccessResponse_3(attributeList); } // @@ -41075,11 +39270,11 @@ class Test_TC_TM_1_1Suite : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( + cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } @@ -41099,14 +39294,14 @@ class Test_TC_TM_1_1Suite : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); uint16_t clusterRevisionArgument; - clusterRevisionArgument = 4U; + clusterRevisionArgument = 1U; ReturnErrorOnFailure( - cluster.WriteAttribute( + cluster.WriteAttribute( clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); return CHIP_NO_ERROR; } @@ -41123,11 +39318,11 @@ class Test_TC_TM_1_1Suite : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( + cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } @@ -41145,18 +39340,18 @@ class Test_TC_TM_1_1Suite : public TestCommand } }; -class Test_TC_TM_2_1Suite : public TestCommand +class Test_TC_RH_2_1Suite : public TestCommand { public: - Test_TC_TM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_TM_2_1", credsIssuerConfig), mTestIndex(0) + Test_TC_RH_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_RH_2_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_TM_2_1Suite() {} + ~Test_TC_RH_2_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -41165,12 +39360,12 @@ class Test_TC_TM_2_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -41188,12 +39383,20 @@ class Test_TC_TM_2_1Suite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeMeasuredValue_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads constraints of attribute: MeasuredValue\n"); + err = TestReadsConstraintsOfAttributeMeasuredValue_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the optional attribute: Tolerance\n"); - err = TestReadTheOptionalAttributeTolerance_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads constraints of attribute: MinMeasuredValue\n"); + err = TestReadsConstraintsOfAttributeMinMeasuredValue_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the optional attribute: Tolerance\n"); + err = TestReadsTheOptionalAttributeTolerance_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads constraints of attribute: Tolerance\n"); + err = TestReadsConstraintsOfAttributeTolerance_4(); break; } @@ -41206,7 +39409,7 @@ class Test_TC_TM_2_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; @@ -41222,27 +39425,47 @@ class Test_TC_TM_2_1Suite : public TestCommand static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_1(void * context, int16_t measuredValue) + static void OnSuccessCallback_1(void * context, uint16_t measuredValue) { - (static_cast(context))->OnSuccessResponse_1(measuredValue); + (static_cast(context))->OnSuccessResponse_1(measuredValue); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context, uint16_t tolerance) + static void OnSuccessCallback_2(void * context, uint16_t minMeasuredValue) { - (static_cast(context))->OnSuccessResponse_2(tolerance); + (static_cast(context))->OnSuccessResponse_2(minMeasuredValue); } - // - // Tests methods - // + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, uint16_t tolerance) + { + (static_cast(context))->OnSuccessResponse_3(tolerance); + } + + static void OnFailureCallback_4(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_4(error); + } + + static void OnSuccessCallback_4(void * context, uint16_t tolerance) + { + (static_cast(context))->OnSuccessResponse_4(tolerance); + } + + // + // Tests methods + // CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { @@ -41250,14 +39473,14 @@ class Test_TC_TM_2_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() + CHIP_ERROR TestReadsConstraintsOfAttributeMeasuredValue_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( + cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } @@ -41268,30 +39491,82 @@ class Test_TC_TM_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_1(int16_t measuredValue) + void OnSuccessResponse_1(uint16_t measuredValue) { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); + VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeTolerance_2() + CHIP_ERROR TestReadsConstraintsOfAttributeMinMeasuredValue_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint16_t minMeasuredValue) + { + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", minMeasuredValue, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", minMeasuredValue, 9999U)); + NextTest(); + } + + CHIP_ERROR TestReadsTheOptionalAttributeTolerance_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) { chip::app::StatusIB status(error); (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - void OnSuccessResponse_2(uint16_t tolerance) + void OnSuccessResponse_3(uint16_t tolerance) + { + VerifyOrReturn(CheckValue("tolerance", tolerance, 0U)); + + NextTest(); + } + + CHIP_ERROR TestReadsConstraintsOfAttributeTolerance_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_4(uint16_t tolerance) { VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); VerifyOrReturn(CheckConstraintMinValue("tolerance", tolerance, 0U)); @@ -41300,18 +39575,18 @@ class Test_TC_TM_2_1Suite : public TestCommand } }; -class Test_TC_TM_2_2Suite : public TestCommand +class Test_TC_RH_2_2Suite : public TestCommand { public: - Test_TC_TM_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_TM_2_2", credsIssuerConfig), mTestIndex(0) + Test_TC_RH_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_RH_2_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_TM_2_2Suite() {} + ~Test_TC_RH_2_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -41320,12 +39595,12 @@ class Test_TC_TM_2_2Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -41344,7 +39619,7 @@ class Test_TC_TM_2_2Suite : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Reads MeasuredValue attribute from DUT\n"); - if (ShouldSkip("A_TEMPERATURE")) + if (ShouldSkip("A_RELATIVEHUMIDITY")) { NextTest(); return; @@ -41353,7 +39628,7 @@ class Test_TC_TM_2_2Suite : public TestCommand break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute: MeasuredValue\n"); - if (ShouldSkip("A_TEMPERATURE")) + if (ShouldSkip("A_RELATIVEHUMIDITY")) { NextTest(); return; @@ -41387,22 +39662,22 @@ class Test_TC_TM_2_2Suite : public TestCommand static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_1(void * context, int16_t measuredValue) + static void OnSuccessCallback_1(void * context, uint16_t measuredValue) { - (static_cast(context))->OnSuccessResponse_1(measuredValue); + (static_cast(context))->OnSuccessResponse_1(measuredValue); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context, int16_t measuredValue) + static void OnSuccessCallback_2(void * context, uint16_t measuredValue) { - (static_cast(context))->OnSuccessResponse_2(measuredValue); + (static_cast(context))->OnSuccessResponse_2(measuredValue); } // @@ -41418,11 +39693,11 @@ class Test_TC_TM_2_2Suite : public TestCommand CHIP_ERROR TestReadsMeasuredValueAttributeFromDut_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( + cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } @@ -41433,7 +39708,7 @@ class Test_TC_TM_2_2Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_1(int16_t measuredValue) + void OnSuccessResponse_1(uint16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); NextTest(); @@ -41442,11 +39717,11 @@ class Test_TC_TM_2_2Suite : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( + cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } @@ -41457,25 +39732,25 @@ class Test_TC_TM_2_2Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_2(int16_t measuredValue) + void OnSuccessResponse_2(uint16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); NextTest(); } }; -class Test_TC_TSTAT_1_1Suite : public TestCommand +class Test_TC_SWTCH_2_1Suite : public TestCommand { public: - Test_TC_TSTAT_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_TSTAT_1_1", credsIssuerConfig), mTestIndex(0) + Test_TC_SWTCH_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_SWTCH_2_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_TSTAT_1_1Suite() {} + ~Test_TC_SWTCH_2_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -41484,12 +39759,12 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWTCH_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -41507,21 +39782,28 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read NumberOfPositions attribute\n"); + err = TestReadNumberOfPositionsAttribute_1(); break; case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read NumberOfPositions attribute\n"); + err = TestReadNumberOfPositionsAttribute_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional global attribute constraints: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read MultiPressMax attribute\n"); + err = TestReadMultiPressMaxAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read MultiPressMax attribute\n"); + err = TestReadMultiPressMaxAttribute_6(); break; } @@ -41534,7 +39816,7 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -41550,39 +39832,62 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_1(void * context, uint8_t numberOfPositions) { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + (static_cast(context))->OnSuccessResponse_1(numberOfPositions); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context, uint8_t numberOfPositions) + { + (static_cast(context))->OnSuccessResponse_2(numberOfPositions); + } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + static void OnSuccessCallback_3(void * context, uint8_t currentPosition) { - (static_cast(context))->OnSuccessResponse_3(attributeList); + (static_cast(context))->OnSuccessResponse_3(currentPosition); } static void OnFailureCallback_4(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_4(error); + (static_cast(context))->OnFailureResponse_4(error); } - static void OnSuccessCallback_4(void * context, uint32_t featureMap) + static void OnSuccessCallback_4(void * context, uint8_t currentPosition) { - (static_cast(context))->OnSuccessResponse_4(featureMap); + (static_cast(context))->OnSuccessResponse_4(currentPosition); + } + + static void OnFailureCallback_5(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_5(error); + } + + static void OnSuccessCallback_5(void * context, uint8_t multiPressMax) + { + (static_cast(context))->OnSuccessResponse_5(multiPressMax); + } + + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context, uint8_t multiPressMax) + { + (static_cast(context))->OnSuccessResponse_6(multiPressMax); } // @@ -41595,13 +39900,13 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadNumberOfPositionsAttribute_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + chip::Controller::SwitchClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } @@ -41612,42 +39917,44 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) + void OnSuccessResponse_1(uint8_t numberOfPositions) { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + VerifyOrReturn(CheckValue("numberOfPositions", numberOfPositions, 2)); + NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadNumberOfPositionsAttribute_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + chip::Controller::SwitchClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 5U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + ThrowFailureResponse(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } + void OnSuccessResponse_2(uint8_t numberOfPositions) + { + VerifyOrReturn(CheckConstraintType("numberOfPositions", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("numberOfPositions", numberOfPositions, 2)); + NextTest(); + } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadCurrentPositionAttribute_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + chip::Controller::SwitchClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } @@ -41658,19 +39965,20 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + void OnSuccessResponse_3(uint8_t currentPosition) { - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); + NextTest(); } - CHIP_ERROR TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_4() + CHIP_ERROR TestReadCurrentPositionAttribute_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + chip::Controller::SwitchClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } @@ -41681,25 +39989,74 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_4(uint32_t featureMap) + void OnSuccessResponse_4(uint8_t currentPosition) { - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); + VerifyOrReturn(CheckConstraintType("currentPosition", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("currentPosition", currentPosition, 0)); + NextTest(); + } + + CHIP_ERROR TestReadMultiPressMaxAttribute_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_5(uint8_t multiPressMax) + { + VerifyOrReturn(CheckValue("multiPressMax", multiPressMax, 2)); + + NextTest(); + } + + CHIP_ERROR TestReadMultiPressMaxAttribute_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_6(uint8_t multiPressMax) + { + VerifyOrReturn(CheckConstraintType("multiPressMax", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("multiPressMax", multiPressMax, 2)); NextTest(); } }; -class Test_TC_TSTAT_2_1Suite : public TestCommand +class Test_TC_SWTCH_2_2Suite : public TestCommand { public: - Test_TC_TSTAT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_TSTAT_2_1", credsIssuerConfig), mTestIndex(0) + Test_TC_SWTCH_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_SWTCH_2_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_TSTAT_2_1Suite() {} + ~Test_TC_SWTCH_2_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -41708,12 +40065,12 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWTCH_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -41731,290 +40088,152 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : Reads constraints of mandatory attributes from DUT: LocalTemperature\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : User interaction needed\n"); + err = TestUserInteractionNeeded_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : User interaction needed\n"); + err = TestUserInteractionNeeded_2(); break; case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_3(); break; case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : Writes the respective default value to mandatory attributes to DUT: " - "AbsMinHeatSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinHeatSetpointLimit_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : User interaction needed\n"); + err = TestUserInteractionNeeded_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read back mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutAbsMinHeatSetpointLimit_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : User interaction needed\n"); + err = TestUserInteractionNeeded_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : User interaction needed\n"); + err = TestUserInteractionNeeded_6(); break; case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_7(); break; case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Writes the respective default value to mandatory attributes to DUT: " - "AbsMaxHeatSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxHeatSetpointLimit_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : User interaction needed\n"); + err = TestUserInteractionNeeded_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read back mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : User interaction needed\n"); + err = TestUserInteractionNeeded_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reads mandatory attributes from DUT: AbsMinCoolSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutAbsMinCoolSetpointLimit_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : User interaction needed\n"); + err = TestUserInteractionNeeded_10(); break; case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : Reads constraints of mandatory attributes from DUT: AbsMinCoolSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinCoolSetpointLimit_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : User interaction needed\n"); + err = TestUserInteractionNeeded_11(); break; case 12: - ChipLogProgress(chipTool, - " ***** Test Step 12 : Writes the respective default value to mandatory attributes to DUT: " - "AbsMinCoolSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinCoolSetpointLimit_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : User interaction needed\n"); + err = TestUserInteractionNeeded_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read back mandatory attributes from DUT: AbsMinCoolSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutAbsMinCoolSetpointLimit_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : User interaction needed\n"); + err = TestUserInteractionNeeded_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Reads mandatory attributes from DUT: AbsMaxCoolSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : User interaction needed\n"); + err = TestUserInteractionNeeded_14(); break; case 15: - ChipLogProgress(chipTool, - " ***** Test Step 15 : Reads constraints of mandatory attributes from DUT: AbsMaxCoolSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 3000ms\n"); + err = TestWait3000ms_15(); break; case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : Writes the respective default value to mandatory attributes to DUT: " - "AbsMaxCoolSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxCoolSetpointLimit_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : User interaction needed\n"); + err = TestUserInteractionNeeded_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Read back mandatory attributes from DUT: AbsMaxCoolSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : User interaction needed\n"); + err = TestUserInteractionNeeded_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Reads mandatory attributes from DUT: OccupiedCoolingSetpoint\n"); - err = TestReadsMandatoryAttributesFromDutOccupiedCoolingSetpoint_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : User interaction needed\n"); + err = TestUserInteractionNeeded_18(); break; case 19: - ChipLogProgress(chipTool, - " ***** Test Step 19 : Reads constraints of mandatory attributes from DUT: OccupiedCoolingSetpoint\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedCoolingSetpoint_19(); + ChipLogProgress(chipTool, " ***** Test Step 19 : User interaction needed\n"); + err = TestUserInteractionNeeded_19(); break; case 20: - ChipLogProgress(chipTool, - " ***** Test Step 20 : Writes the respective default value to mandatory attributes to DUT: " - "OccupiedCoolingSetpoint\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedCoolingSetpoint_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : User interaction needed\n"); + err = TestUserInteractionNeeded_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Read back mandatory attributes from DUT: OccupiedCoolingSetpoint\n"); - err = TestReadBackMandatoryAttributesFromDutOccupiedCoolingSetpoint_21(); + ChipLogProgress(chipTool, " ***** Test Step 21 : User interaction needed\n"); + err = TestUserInteractionNeeded_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Reads mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); - err = TestReadsMandatoryAttributesFromDutOccupiedHeatingSetpoint_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 3000ms\n"); + err = TestWait3000ms_22(); break; case 23: - ChipLogProgress(chipTool, - " ***** Test Step 23 : Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_23(); + ChipLogProgress(chipTool, " ***** Test Step 23 : User interaction needed\n"); + err = TestUserInteractionNeeded_23(); break; case 24: - ChipLogProgress(chipTool, - " ***** Test Step 24 : Writes the respective default value to mandatory attributes to DUT: " - "OccupiedHeatingSetpoint\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedHeatingSetpoint_24(); + ChipLogProgress(chipTool, " ***** Test Step 24 : User interaction needed\n"); + err = TestUserInteractionNeeded_24(); break; case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Read back mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); - err = TestReadBackMandatoryAttributesFromDutOccupiedHeatingSetpoint_25(); + ChipLogProgress(chipTool, " ***** Test Step 25 : User interaction needed\n"); + err = TestUserInteractionNeeded_25(); break; case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Reads mandatory attributes from DUT: MinHeatSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutMinHeatSetpointLimit_26(); + ChipLogProgress(chipTool, " ***** Test Step 26 : User interaction needed\n"); + err = TestUserInteractionNeeded_26(); break; case 27: - ChipLogProgress(chipTool, - " ***** Test Step 27 : Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_27(); + ChipLogProgress(chipTool, " ***** Test Step 27 : User interaction needed\n"); + err = TestUserInteractionNeeded_27(); break; case 28: - ChipLogProgress( - chipTool, - " ***** Test Step 28 : Writes the respective default value to mandatory attributes to DUT: MinHeatSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinHeatSetpointLimit_28(); + ChipLogProgress(chipTool, " ***** Test Step 28 : User interaction needed\n"); + err = TestUserInteractionNeeded_28(); break; case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Read back mandatory attributes from DUT: MinHeatSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutMinHeatSetpointLimit_29(); + ChipLogProgress(chipTool, " ***** Test Step 29 : User interaction needed\n"); + err = TestUserInteractionNeeded_29(); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Reads mandatory attributes from DUT: MaxHeatSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutMaxHeatSetpointLimit_30(); + ChipLogProgress(chipTool, " ***** Test Step 30 : User interaction needed\n"); + err = TestUserInteractionNeeded_30(); break; case 31: - ChipLogProgress(chipTool, - " ***** Test Step 31 : Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_31(); + ChipLogProgress(chipTool, " ***** Test Step 31 : User interaction needed\n"); + err = TestUserInteractionNeeded_31(); break; case 32: - ChipLogProgress( - chipTool, - " ***** Test Step 32 : Writes the respective default value to mandatory attributes to DUT: MaxHeatSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxHeatSetpointLimit_32(); + ChipLogProgress(chipTool, " ***** Test Step 32 : User interaction needed\n"); + err = TestUserInteractionNeeded_32(); break; case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read back mandatory attributes from DUT: MaxHeatSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutMaxHeatSetpointLimit_33(); + ChipLogProgress(chipTool, " ***** Test Step 33 : User interaction needed\n"); + err = TestUserInteractionNeeded_33(); break; case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Reads mandatory attributes from DUT: MinCoolSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutMinCoolSetpointLimit_34(); + ChipLogProgress(chipTool, " ***** Test Step 34 : User interaction needed\n"); + err = TestUserInteractionNeeded_34(); break; case 35: - ChipLogProgress(chipTool, - " ***** Test Step 35 : Reads constraints of mandatory attributes from DUT: MinCoolSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMinCoolSetpointLimit_35(); + ChipLogProgress(chipTool, " ***** Test Step 35 : User interaction needed\n"); + err = TestUserInteractionNeeded_35(); break; case 36: - ChipLogProgress( - chipTool, - " ***** Test Step 36 : Writes the respective default value to mandatory attributes to DUT: MinCoolSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinCoolSetpointLimit_36(); + ChipLogProgress(chipTool, " ***** Test Step 36 : User interaction needed\n"); + err = TestUserInteractionNeeded_36(); break; case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Read back mandatory attributes from DUT: MinCoolSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutMinCoolSetpointLimit_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Reads mandatory attributes from DUT: MaxCoolSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutMaxCoolSetpointLimit_38(); - break; - case 39: - ChipLogProgress(chipTool, - " ***** Test Step 39 : Reads constraints of mandatory attributes from DUT: MaxCoolSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMaxCoolSetpointLimit_39(); - break; - case 40: - ChipLogProgress( - chipTool, - " ***** Test Step 40 : Writes the respective default value to mandatory attributes to DUT: MaxCoolSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxCoolSetpointLimit_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read back mandatory attributes from DUT: MaxCoolSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutMaxCoolSetpointLimit_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Reads mandatory attributes from DUT: ControlSequenceOfOperation\n"); - err = TestReadsMandatoryAttributesFromDutControlSequenceOfOperation_42(); - break; - case 43: - ChipLogProgress( - chipTool, " ***** Test Step 43 : Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_43(); - break; - case 44: - ChipLogProgress(chipTool, - " ***** Test Step 44 : Writes the respective default value to mandatory attributes to DUT: " - "ControlSequenceOfOperation\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutControlSequenceOfOperation_44(); - break; - case 45: - ChipLogProgress(chipTool, - " ***** Test Step 45 : Read back mandatory attributes from DUT: ControlSequenceOfOperation\n"); - err = TestReadBackMandatoryAttributesFromDutControlSequenceOfOperation_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Reads mandatory attributes from DUT: SystemMode\n"); - err = TestReadsMandatoryAttributesFromDutSystemMode_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Reads constraints of mandatory attributes from DUT: SystemMode\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_47(); - break; - case 48: - ChipLogProgress( - chipTool, " ***** Test Step 48 : Writes the respective default value to mandatory attributes to DUT: SystemMode\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutSystemMode_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Read back mandatory attributes from DUT: SystemMode\n"); - err = TestReadBackMandatoryAttributesFromDutSystemMode_49(); - break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Reads optional attributes from DUT: MinSetpointDeadBand\n"); - err = TestReadsOptionalAttributesFromDutMinSetpointDeadBand_50(); - break; - case 51: - ChipLogProgress(chipTool, - " ***** Test Step 51 : Reads constraints of optional attributes from DUT: MinSetpointDeadBand\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_51(); - break; - case 52: - ChipLogProgress( - chipTool, - " ***** Test Step 52 : Writes the respective default value to optional attributes to DUT: MinSetpointDeadBand\n"); - err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutMinSetpointDeadBand_52(); - break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Read back optional attributes from DUT: MinSetpointDeadBand\n"); - err = TestReadBackOptionalAttributesFromDutMinSetpointDeadBand_53(); - break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Reads constraints of optional attributes from DUT: StartOfWeek\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_54(); - break; - case 55: - ChipLogProgress( - chipTool, " ***** Test Step 55 : Writes the respective default value to optional attributes to DUT: StartOfWeek\n"); - err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutStartOfWeek_55(); - break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Read back optional attributes from DUT: StartOfWeek\n"); - err = TestReadBackOptionalAttributesFromDutStartOfWeek_56(); - break; - case 57: - ChipLogProgress(chipTool, - " ***** Test Step 57 : Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_57(); - break; - case 58: - ChipLogProgress(chipTool, - " ***** Test Step 58 : Writes the respective default value to optional attributes to DUT: " - "NumberOfWeeklyTransitions\n"); - err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfWeeklyTransitions_58(); - break; - case 59: - ChipLogProgress(chipTool, - " ***** Test Step 59 : Reads constraints of optional attributes from DUT: NumberOfDailyTransitions\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_59(); - break; - case 60: - ChipLogProgress(chipTool, - " ***** Test Step 60 : Writes the respective default value to optional attributes to DUT: " - "NumberOfDailyTransitions\n"); - err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfDailyTransitions_60(); + ChipLogProgress(chipTool, " ***** Test Step 37 : User interaction needed\n"); + err = TestUserInteractionNeeded_37(); break; } @@ -42027,7 +40246,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 61; + const uint16_t mTestCount = 38; chip::Optional mNodeId; chip::Optional mCluster; @@ -42041,560 +40260,924 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand NextTest(); } - static void OnFailureCallback_1(void * context, CHIP_ERROR error) + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_1(void * context, int16_t localTemperature) + static void OnSuccessCallback_3(void * context, uint8_t currentPosition) { - (static_cast(context))->OnSuccessResponse_1(localTemperature); + (static_cast(context))->OnSuccessResponse_3(currentPosition); } - static void OnFailureCallback_2(void * context, CHIP_ERROR error) + static void OnFailureCallback_7(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_7(error); } - static void OnSuccessCallback_2(void * context, int16_t absMinHeatSetpointLimit) + static void OnSuccessCallback_7(void * context, uint8_t currentPosition) { - (static_cast(context))->OnSuccessResponse_2(absMinHeatSetpointLimit); + (static_cast(context))->OnSuccessResponse_7(currentPosition); } - static void OnFailureCallback_3(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_3(error); - } + // + // Tests methods + // - static void OnSuccessCallback_3(void * context, int16_t absMinHeatSetpointLimit) + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { - (static_cast(context))->OnSuccessResponse_3(absMinHeatSetpointLimit); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - static void OnFailureCallback_4(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_1() { - (static_cast(context))->OnFailureResponse_4(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to SwitchLatched event"); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_2() { - (static_cast(context))->OnFailureResponse_5(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator sets switch to first position"); } - static void OnSuccessCallback_5(void * context, int16_t absMinHeatSetpointLimit) + CHIP_ERROR TestReadCurrentPositionAttribute_3() { - (static_cast(context))->OnSuccessResponse_5(absMinHeatSetpointLimit); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnFailureCallback_6(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_6(error); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_6(void * context, int16_t absMaxHeatSetpointLimit) + void OnFailureResponse_3(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_6(absMaxHeatSetpointLimit); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnFailureCallback_7(void * context, CHIP_ERROR error) + void OnSuccessResponse_3(uint8_t currentPosition) { - (static_cast(context))->OnFailureResponse_7(error); + VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); + + NextTest(); } - static void OnSuccessCallback_7(void * context, int16_t absMaxHeatSetpointLimit) + CHIP_ERROR TestUserInteractionNeeded_4() { - (static_cast(context))->OnSuccessResponse_7(absMaxHeatSetpointLimit); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator sets switch to second position"); } - static void OnFailureCallback_8(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_5() { - (static_cast(context))->OnFailureResponse_8(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress event"); } - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_6() { - (static_cast(context))->OnFailureResponse_9(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); } - static void OnSuccessCallback_9(void * context, int16_t absMaxHeatSetpointLimit) + CHIP_ERROR TestReadCurrentPositionAttribute_7() { - (static_cast(context))->OnSuccessResponse_9(absMaxHeatSetpointLimit); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7, true)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_10(void * context, CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_10(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_10(void * context, int16_t absMinCoolSetpointLimit) + void OnSuccessResponse_7(uint8_t currentPosition) { - (static_cast(context))->OnSuccessResponse_10(absMinCoolSetpointLimit); + VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); + + NextTest(); } - static void OnFailureCallback_11(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_8() { - (static_cast(context))->OnFailureResponse_11(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator sets switch to second position"); } - static void OnSuccessCallback_11(void * context, int16_t absMinCoolSetpointLimit) + CHIP_ERROR TestUserInteractionNeeded_9() { - (static_cast(context))->OnSuccessResponse_11(absMinCoolSetpointLimit); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch (release switch)"); } - static void OnFailureCallback_12(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_10() { - (static_cast(context))->OnFailureResponse_12(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress and ShortRelease events"); } - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } - - static void OnFailureCallback_13(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_11() { - (static_cast(context))->OnFailureResponse_13(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); } - static void OnSuccessCallback_13(void * context, int16_t absMinCoolSetpointLimit) + CHIP_ERROR TestUserInteractionNeeded_12() { - (static_cast(context))->OnSuccessResponse_13(absMinCoolSetpointLimit); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); } - static void OnFailureCallback_14(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_13() { - (static_cast(context))->OnFailureResponse_14(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); } - static void OnSuccessCallback_14(void * context, int16_t absMaxCoolSetpointLimit) + CHIP_ERROR TestUserInteractionNeeded_14() { - (static_cast(context))->OnSuccessResponse_14(absMaxCoolSetpointLimit); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch for 5 seconds"); } - static void OnFailureCallback_15(void * context, CHIP_ERROR error) + CHIP_ERROR TestWait3000ms_15() { - (static_cast(context))->OnFailureResponse_15(error); + SetIdentity(kIdentityAlpha); + return WaitForMs(3000); } - static void OnSuccessCallback_15(void * context, int16_t absMaxCoolSetpointLimit) + CHIP_ERROR TestUserInteractionNeeded_16() { - (static_cast(context))->OnSuccessResponse_15(absMaxCoolSetpointLimit); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); } - static void OnFailureCallback_16(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_17() { - (static_cast(context))->OnFailureResponse_16(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events"); } - static void OnSuccessCallback_16(void * context) { (static_cast(context))->OnSuccessResponse_16(); } - - static void OnFailureCallback_17(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_18() { - (static_cast(context))->OnFailureResponse_17(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); } - static void OnSuccessCallback_17(void * context, int16_t absMaxCoolSetpointLimit) + CHIP_ERROR TestUserInteractionNeeded_19() { - (static_cast(context))->OnSuccessResponse_17(absMaxCoolSetpointLimit); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); } - static void OnFailureCallback_18(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_20() { - (static_cast(context))->OnFailureResponse_18(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); } - static void OnSuccessCallback_18(void * context, int16_t occupiedCoolingSetpoint) + CHIP_ERROR TestUserInteractionNeeded_21() { - (static_cast(context))->OnSuccessResponse_18(occupiedCoolingSetpoint); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch for 5 seconds"); } - static void OnFailureCallback_19(void * context, CHIP_ERROR error) + CHIP_ERROR TestWait3000ms_22() { - (static_cast(context))->OnFailureResponse_19(error); + SetIdentity(kIdentityAlpha); + return WaitForMs(3000); } - static void OnSuccessCallback_19(void * context, int16_t occupiedCoolingSetpoint) + CHIP_ERROR TestUserInteractionNeeded_23() { - (static_cast(context))->OnSuccessResponse_19(occupiedCoolingSetpoint); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); } - static void OnFailureCallback_20(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_24() { - (static_cast(context))->OnFailureResponse_20(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events"); } - static void OnSuccessCallback_20(void * context) { (static_cast(context))->OnSuccessResponse_20(); } - - static void OnFailureCallback_21(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_25() { - (static_cast(context))->OnFailureResponse_21(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); } - static void OnSuccessCallback_21(void * context, int16_t occupiedCoolingSetpoint) + CHIP_ERROR TestUserInteractionNeeded_26() { - (static_cast(context))->OnSuccessResponse_21(occupiedCoolingSetpoint); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); } - static void OnFailureCallback_22(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_27() { - (static_cast(context))->OnFailureResponse_22(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); } - static void OnSuccessCallback_22(void * context, int16_t occupiedHeatingSetpoint) + CHIP_ERROR TestUserInteractionNeeded_28() { - (static_cast(context))->OnSuccessResponse_22(occupiedHeatingSetpoint); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); } - static void OnFailureCallback_23(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_29() { - (static_cast(context))->OnFailureResponse_23(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); } - static void OnSuccessCallback_23(void * context, int16_t occupiedHeatingSetpoint) + CHIP_ERROR TestUserInteractionNeeded_30() { - (static_cast(context))->OnSuccessResponse_23(occupiedHeatingSetpoint); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); } - static void OnFailureCallback_24(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_31() { - (static_cast(context))->OnFailureResponse_24(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); } - static void OnSuccessCallback_24(void * context) { (static_cast(context))->OnSuccessResponse_24(); } - - static void OnFailureCallback_25(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_32() { - (static_cast(context))->OnFailureResponse_25(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); } - static void OnSuccessCallback_25(void * context, int16_t occupiedHeatingSetpoint) + CHIP_ERROR TestUserInteractionNeeded_33() { - (static_cast(context))->OnSuccessResponse_25(occupiedHeatingSetpoint); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); } - static void OnFailureCallback_26(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_34() { - (static_cast(context))->OnFailureResponse_26(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); } - static void OnSuccessCallback_26(void * context, int16_t minHeatSetpointLimit) + CHIP_ERROR TestUserInteractionNeeded_35() { - (static_cast(context))->OnSuccessResponse_26(minHeatSetpointLimit); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); } - static void OnFailureCallback_27(void * context, CHIP_ERROR error) + CHIP_ERROR TestUserInteractionNeeded_36() { - (static_cast(context))->OnFailureResponse_27(error); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); } - static void OnSuccessCallback_27(void * context, int16_t minHeatSetpointLimit) + CHIP_ERROR TestUserInteractionNeeded_37() { - (static_cast(context))->OnSuccessResponse_27(minHeatSetpointLimit); + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); } +}; - static void OnFailureCallback_28(void * context, CHIP_ERROR error) +class Test_TC_TM_1_1Suite : public TestCommand +{ +public: + Test_TC_TM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TM_1_1", credsIssuerConfig), mTestIndex(0) { - (static_cast(context))->OnFailureResponse_28(error); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - static void OnSuccessCallback_28(void * context) { (static_cast(context))->OnSuccessResponse_28(); } + ~Test_TC_TM_1_1Suite() {} - static void OnFailureCallback_29(void * context, CHIP_ERROR error) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_29(error); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnSuccessCallback_29(void * context, int16_t minHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_29(minHeatSetpointLimit); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_1_1\n"); + } - static void OnFailureCallback_30(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_30(error); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_30(void * context, int16_t maxHeatSetpointLimit) +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override { - (static_cast(context))->OnSuccessResponse_30(maxHeatSetpointLimit); + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); } - static void OnFailureCallback_31(void * context, CHIP_ERROR error) + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_31(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_31(void * context, int16_t maxHeatSetpointLimit) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_31(maxHeatSetpointLimit); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } - static void OnFailureCallback_32(void * context, CHIP_ERROR error) + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_32(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_32(void * context) { (static_cast(context))->OnSuccessResponse_32(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - static void OnFailureCallback_33(void * context, CHIP_ERROR error) + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_33(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_33(void * context, int16_t maxHeatSetpointLimit) + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) { - (static_cast(context))->OnSuccessResponse_33(maxHeatSetpointLimit); + (static_cast(context))->OnSuccessResponse_3(attributeList); } - static void OnFailureCallback_34(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_34(error); - } + // + // Tests methods + // - static void OnSuccessCallback_34(void * context, int16_t minCoolSetpointLimit) + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { - (static_cast(context))->OnSuccessResponse_34(minCoolSetpointLimit); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - static void OnFailureCallback_35(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() { - (static_cast(context))->OnFailureResponse_35(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_35(void * context, int16_t minCoolSetpointLimit) + void OnFailureResponse_1(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_35(minCoolSetpointLimit); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnFailureCallback_36(void * context, CHIP_ERROR error) + void OnSuccessResponse_1(uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_36(error); + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); } - static void OnSuccessCallback_36(void * context) { (static_cast(context))->OnSuccessResponse_36(); } - - static void OnFailureCallback_37(void * context, CHIP_ERROR error) + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { - (static_cast(context))->OnFailureResponse_37(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint16_t clusterRevisionArgument; + clusterRevisionArgument = 4U; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_37(void * context, int16_t minCoolSetpointLimit) + void OnFailureResponse_2(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_37(minCoolSetpointLimit); + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); } - static void OnFailureCallback_38(void * context, CHIP_ERROR error) + void OnSuccessResponse_2() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { - (static_cast(context))->OnFailureResponse_38(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_38(void * context, int16_t maxCoolSetpointLimit) + void OnFailureResponse_3(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_38(maxCoolSetpointLimit); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnFailureCallback_39(void * context, CHIP_ERROR error) + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) { - (static_cast(context))->OnFailureResponse_39(error); + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); } +}; - static void OnSuccessCallback_39(void * context, int16_t maxCoolSetpointLimit) +class Test_TC_TM_2_1Suite : public TestCommand +{ +public: + Test_TC_TM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TM_2_1", credsIssuerConfig), mTestIndex(0) { - (static_cast(context))->OnSuccessResponse_39(maxCoolSetpointLimit); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - static void OnFailureCallback_40(void * context, CHIP_ERROR error) + ~Test_TC_TM_2_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_40(error); + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: MeasuredValue\n"); + err = TestReadTheMandatoryAttributeMeasuredValue_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read the optional attribute: Tolerance\n"); + err = TestReadTheOptionalAttributeTolerance_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_40(void * context) { (static_cast(context))->OnSuccessResponse_40(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; - static void OnFailureCallback_41(void * context, CHIP_ERROR error) + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override { - (static_cast(context))->OnFailureResponse_41(error); + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); } - static void OnSuccessCallback_41(void * context, int16_t maxCoolSetpointLimit) + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_41(maxCoolSetpointLimit); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnFailureCallback_42(void * context, CHIP_ERROR error) + static void OnSuccessCallback_1(void * context, int16_t measuredValue) { - (static_cast(context))->OnFailureResponse_42(error); + (static_cast(context))->OnSuccessResponse_1(measuredValue); } - static void OnSuccessCallback_42(void * context, - chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_42(controlSequenceOfOperation); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnFailureCallback_43(void * context, CHIP_ERROR error) + static void OnSuccessCallback_2(void * context, uint16_t tolerance) { - (static_cast(context))->OnFailureResponse_43(error); + (static_cast(context))->OnSuccessResponse_2(tolerance); } - static void OnSuccessCallback_43(void * context, - chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { - (static_cast(context))->OnSuccessResponse_43(controlSequenceOfOperation); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - static void OnFailureCallback_44(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() { - (static_cast(context))->OnFailureResponse_44(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_44(void * context) { (static_cast(context))->OnSuccessResponse_44(); } + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } - static void OnFailureCallback_45(void * context, CHIP_ERROR error) + void OnFailureResponse_1(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_45(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_45(void * context, - chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + void OnSuccessResponse_1(int16_t measuredValue) { - (static_cast(context))->OnSuccessResponse_45(controlSequenceOfOperation); + VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); + NextTest(); } - static void OnFailureCallback_46(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTheOptionalAttributeTolerance_2() { - (static_cast(context))->OnFailureResponse_46(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_46(void * context, uint8_t systemMode) + void OnFailureResponse_2(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_46(systemMode); + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); } - static void OnFailureCallback_47(void * context, CHIP_ERROR error) + void OnSuccessResponse_2(uint16_t tolerance) { - (static_cast(context))->OnFailureResponse_47(error); + VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("tolerance", tolerance, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("tolerance", tolerance, 2048U)); + NextTest(); } +}; - static void OnSuccessCallback_47(void * context, uint8_t systemMode) +class Test_TC_TM_2_2Suite : public TestCommand +{ +public: + Test_TC_TM_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TM_2_2", credsIssuerConfig), mTestIndex(0) { - (static_cast(context))->OnSuccessResponse_47(systemMode); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - static void OnFailureCallback_48(void * context, CHIP_ERROR error) + ~Test_TC_TM_2_2Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_48(error); + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads MeasuredValue attribute from DUT\n"); + if (ShouldSkip("A_TEMPERATURE")) + { + NextTest(); + return; + } + err = TestReadsMeasuredValueAttributeFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute: MeasuredValue\n"); + if (ShouldSkip("A_TEMPERATURE")) + { + NextTest(); + return; + } + err = TestReadTheMandatoryAttributeMeasuredValue_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_48(void * context) { (static_cast(context))->OnSuccessResponse_48(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; - static void OnFailureCallback_49(void * context, CHIP_ERROR error) + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override { - (static_cast(context))->OnFailureResponse_49(error); + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); } - static void OnSuccessCallback_49(void * context, uint8_t systemMode) + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_49(systemMode); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnFailureCallback_50(void * context, CHIP_ERROR error) + static void OnSuccessCallback_1(void * context, int16_t measuredValue) { - (static_cast(context))->OnFailureResponse_50(error); + (static_cast(context))->OnSuccessResponse_1(measuredValue); } - static void OnSuccessCallback_50(void * context, int8_t minSetpointDeadBand) + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_50(minSetpointDeadBand); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnFailureCallback_51(void * context, CHIP_ERROR error) + static void OnSuccessCallback_2(void * context, int16_t measuredValue) { - (static_cast(context))->OnFailureResponse_51(error); + (static_cast(context))->OnSuccessResponse_2(measuredValue); } - static void OnSuccessCallback_51(void * context, int8_t minSetpointDeadBand) + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { - (static_cast(context))->OnSuccessResponse_51(minSetpointDeadBand); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - static void OnFailureCallback_52(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadsMeasuredValueAttributeFromDut_1() { - (static_cast(context))->OnFailureResponse_52(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_52(void * context) { (static_cast(context))->OnSuccessResponse_52(); } + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - static void OnFailureCallback_53(void * context, CHIP_ERROR error) + void OnSuccessResponse_1(int16_t measuredValue) { - (static_cast(context))->OnFailureResponse_53(error); + VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); + NextTest(); } - static void OnSuccessCallback_53(void * context, int8_t minSetpointDeadBand) + CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_2() { - (static_cast(context))->OnSuccessResponse_53(minSetpointDeadBand); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_54(void * context, CHIP_ERROR error) + void OnFailureResponse_2(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_54(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_54(void * context, uint8_t startOfWeek) + void OnSuccessResponse_2(int16_t measuredValue) { - (static_cast(context))->OnSuccessResponse_54(startOfWeek); + VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); + NextTest(); } +}; - static void OnFailureCallback_55(void * context, CHIP_ERROR error) +class Test_TC_TSTAT_1_1Suite : public TestCommand +{ +public: + Test_TC_TSTAT_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TSTAT_1_1", credsIssuerConfig), mTestIndex(0) { - (static_cast(context))->OnFailureResponse_55(error); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - static void OnSuccessCallback_55(void * context) { (static_cast(context))->OnSuccessResponse_55(); } + ~Test_TC_TSTAT_1_1Suite() {} - static void OnFailureCallback_56(void * context, CHIP_ERROR error) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnFailureResponse_56(error); + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional global attribute constraints: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_4(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_56(void * context, uint8_t startOfWeek) +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override { - (static_cast(context))->OnSuccessResponse_56(startOfWeek); + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); } - static void OnFailureCallback_57(void * context, CHIP_ERROR error) + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_57(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_57(void * context, uint8_t numberOfWeeklyTransitions) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_57(numberOfWeeklyTransitions); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } - static void OnFailureCallback_58(void * context, CHIP_ERROR error) + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_58(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_58(void * context) { (static_cast(context))->OnSuccessResponse_58(); } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - static void OnFailureCallback_59(void * context, CHIP_ERROR error) + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_59(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_59(void * context, uint8_t numberOfDailyTransitions) + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) { - (static_cast(context))->OnSuccessResponse_59(numberOfDailyTransitions); + (static_cast(context))->OnSuccessResponse_3(attributeList); } - static void OnFailureCallback_60(void * context, CHIP_ERROR error) + static void OnFailureCallback_4(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_60(error); + (static_cast(context))->OnFailureResponse_4(error); } - static void OnSuccessCallback_60(void * context) { (static_cast(context))->OnSuccessResponse_60(); } + static void OnSuccessCallback_4(void * context, uint32_t featureMap) + { + (static_cast(context))->OnSuccessResponse_4(featureMap); + } // // Tests methods @@ -42606,13 +41189,13 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } @@ -42623,43 +41206,42 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_1(int16_t localTemperature) + void OnSuccessResponse_1(uint16_t clusterRevision) { - VerifyOrReturn(CheckConstraintType("localTemperature", "", "int16")); + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2, true)); + uint16_t clusterRevisionArgument; + clusterRevisionArgument = 5U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); return CHIP_NO_ERROR; } void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_2(int16_t absMinHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 700)); - + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_3() + void OnSuccessResponse_2() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } @@ -42670,1405 +41252,5830 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_3(int16_t absMinHeatSetpointLimit) + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) { - VerifyOrReturn(CheckConstraintType("absMinHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 700)); - VerifyOrReturn(CheckConstraintMaxValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 3000)); + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinHeatSetpointLimit_4() + CHIP_ERROR TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t absMinHeatSetpointLimitArgument; - absMinHeatSetpointLimitArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - absMinHeatSetpointLimitArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } void OnFailureResponse_4(CHIP_ERROR error) { chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + ThrowFailureResponse(); } - void OnSuccessResponse_4() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMinHeatSetpointLimit_5() + void OnSuccessResponse_4(uint32_t featureMap) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); + NextTest(); + } +}; - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5, true)); - return CHIP_NO_ERROR; +class Test_TC_TSTAT_2_1Suite : public TestCommand +{ +public: + Test_TC_TSTAT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TSTAT_2_1", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - void OnFailureResponse_5(CHIP_ERROR error) + ~Test_TC_TSTAT_2_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : Reads constraints of mandatory attributes from DUT: LocalTemperature\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); + err = TestReadsMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Writes the respective default value to mandatory attributes to DUT: " + "AbsMinHeatSetpointLimit\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinHeatSetpointLimit_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read back mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); + err = TestReadBackMandatoryAttributesFromDutAbsMinHeatSetpointLimit_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); + err = TestReadsMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Writes the respective default value to mandatory attributes to DUT: " + "AbsMaxHeatSetpointLimit\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxHeatSetpointLimit_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read back mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); + err = TestReadBackMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads mandatory attributes from DUT: AbsMinCoolSetpointLimit\n"); + err = TestReadsMandatoryAttributesFromDutAbsMinCoolSetpointLimit_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Reads constraints of mandatory attributes from DUT: AbsMinCoolSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinCoolSetpointLimit_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : Writes the respective default value to mandatory attributes to DUT: " + "AbsMinCoolSetpointLimit\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinCoolSetpointLimit_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Read back mandatory attributes from DUT: AbsMinCoolSetpointLimit\n"); + err = TestReadBackMandatoryAttributesFromDutAbsMinCoolSetpointLimit_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Reads mandatory attributes from DUT: AbsMaxCoolSetpointLimit\n"); + err = TestReadsMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_14(); + break; + case 15: + ChipLogProgress(chipTool, + " ***** Test Step 15 : Reads constraints of mandatory attributes from DUT: AbsMaxCoolSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Writes the respective default value to mandatory attributes to DUT: " + "AbsMaxCoolSetpointLimit\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxCoolSetpointLimit_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Read back mandatory attributes from DUT: AbsMaxCoolSetpointLimit\n"); + err = TestReadBackMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Reads mandatory attributes from DUT: OccupiedCoolingSetpoint\n"); + err = TestReadsMandatoryAttributesFromDutOccupiedCoolingSetpoint_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Reads constraints of mandatory attributes from DUT: OccupiedCoolingSetpoint\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedCoolingSetpoint_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Writes the respective default value to mandatory attributes to DUT: " + "OccupiedCoolingSetpoint\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedCoolingSetpoint_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Read back mandatory attributes from DUT: OccupiedCoolingSetpoint\n"); + err = TestReadBackMandatoryAttributesFromDutOccupiedCoolingSetpoint_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Reads mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); + err = TestReadsMandatoryAttributesFromDutOccupiedHeatingSetpoint_22(); + break; + case 23: + ChipLogProgress(chipTool, + " ***** Test Step 23 : Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Writes the respective default value to mandatory attributes to DUT: " + "OccupiedHeatingSetpoint\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedHeatingSetpoint_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read back mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); + err = TestReadBackMandatoryAttributesFromDutOccupiedHeatingSetpoint_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Reads mandatory attributes from DUT: MinHeatSetpointLimit\n"); + err = TestReadsMandatoryAttributesFromDutMinHeatSetpointLimit_26(); + break; + case 27: + ChipLogProgress(chipTool, + " ***** Test Step 27 : Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_27(); + break; + case 28: + ChipLogProgress( + chipTool, + " ***** Test Step 28 : Writes the respective default value to mandatory attributes to DUT: MinHeatSetpointLimit\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinHeatSetpointLimit_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Read back mandatory attributes from DUT: MinHeatSetpointLimit\n"); + err = TestReadBackMandatoryAttributesFromDutMinHeatSetpointLimit_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Reads mandatory attributes from DUT: MaxHeatSetpointLimit\n"); + err = TestReadsMandatoryAttributesFromDutMaxHeatSetpointLimit_30(); + break; + case 31: + ChipLogProgress(chipTool, + " ***** Test Step 31 : Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_31(); + break; + case 32: + ChipLogProgress( + chipTool, + " ***** Test Step 32 : Writes the respective default value to mandatory attributes to DUT: MaxHeatSetpointLimit\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxHeatSetpointLimit_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Read back mandatory attributes from DUT: MaxHeatSetpointLimit\n"); + err = TestReadBackMandatoryAttributesFromDutMaxHeatSetpointLimit_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Reads mandatory attributes from DUT: MinCoolSetpointLimit\n"); + err = TestReadsMandatoryAttributesFromDutMinCoolSetpointLimit_34(); + break; + case 35: + ChipLogProgress(chipTool, + " ***** Test Step 35 : Reads constraints of mandatory attributes from DUT: MinCoolSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutMinCoolSetpointLimit_35(); + break; + case 36: + ChipLogProgress( + chipTool, + " ***** Test Step 36 : Writes the respective default value to mandatory attributes to DUT: MinCoolSetpointLimit\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinCoolSetpointLimit_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Read back mandatory attributes from DUT: MinCoolSetpointLimit\n"); + err = TestReadBackMandatoryAttributesFromDutMinCoolSetpointLimit_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Reads mandatory attributes from DUT: MaxCoolSetpointLimit\n"); + err = TestReadsMandatoryAttributesFromDutMaxCoolSetpointLimit_38(); + break; + case 39: + ChipLogProgress(chipTool, + " ***** Test Step 39 : Reads constraints of mandatory attributes from DUT: MaxCoolSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutMaxCoolSetpointLimit_39(); + break; + case 40: + ChipLogProgress( + chipTool, + " ***** Test Step 40 : Writes the respective default value to mandatory attributes to DUT: MaxCoolSetpointLimit\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxCoolSetpointLimit_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Read back mandatory attributes from DUT: MaxCoolSetpointLimit\n"); + err = TestReadBackMandatoryAttributesFromDutMaxCoolSetpointLimit_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Reads mandatory attributes from DUT: ControlSequenceOfOperation\n"); + err = TestReadsMandatoryAttributesFromDutControlSequenceOfOperation_42(); + break; + case 43: + ChipLogProgress( + chipTool, " ***** Test Step 43 : Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_43(); + break; + case 44: + ChipLogProgress(chipTool, + " ***** Test Step 44 : Writes the respective default value to mandatory attributes to DUT: " + "ControlSequenceOfOperation\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutControlSequenceOfOperation_44(); + break; + case 45: + ChipLogProgress(chipTool, + " ***** Test Step 45 : Read back mandatory attributes from DUT: ControlSequenceOfOperation\n"); + err = TestReadBackMandatoryAttributesFromDutControlSequenceOfOperation_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Reads mandatory attributes from DUT: SystemMode\n"); + err = TestReadsMandatoryAttributesFromDutSystemMode_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Reads constraints of mandatory attributes from DUT: SystemMode\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_47(); + break; + case 48: + ChipLogProgress( + chipTool, " ***** Test Step 48 : Writes the respective default value to mandatory attributes to DUT: SystemMode\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutSystemMode_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Read back mandatory attributes from DUT: SystemMode\n"); + err = TestReadBackMandatoryAttributesFromDutSystemMode_49(); + break; + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Reads optional attributes from DUT: MinSetpointDeadBand\n"); + err = TestReadsOptionalAttributesFromDutMinSetpointDeadBand_50(); + break; + case 51: + ChipLogProgress(chipTool, + " ***** Test Step 51 : Reads constraints of optional attributes from DUT: MinSetpointDeadBand\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_51(); + break; + case 52: + ChipLogProgress( + chipTool, + " ***** Test Step 52 : Writes the respective default value to optional attributes to DUT: MinSetpointDeadBand\n"); + err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutMinSetpointDeadBand_52(); + break; + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Read back optional attributes from DUT: MinSetpointDeadBand\n"); + err = TestReadBackOptionalAttributesFromDutMinSetpointDeadBand_53(); + break; + case 54: + ChipLogProgress(chipTool, " ***** Test Step 54 : Reads constraints of optional attributes from DUT: StartOfWeek\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_54(); + break; + case 55: + ChipLogProgress( + chipTool, " ***** Test Step 55 : Writes the respective default value to optional attributes to DUT: StartOfWeek\n"); + err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutStartOfWeek_55(); + break; + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : Read back optional attributes from DUT: StartOfWeek\n"); + err = TestReadBackOptionalAttributesFromDutStartOfWeek_56(); + break; + case 57: + ChipLogProgress(chipTool, + " ***** Test Step 57 : Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_57(); + break; + case 58: + ChipLogProgress(chipTool, + " ***** Test Step 58 : Writes the respective default value to optional attributes to DUT: " + "NumberOfWeeklyTransitions\n"); + err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfWeeklyTransitions_58(); + break; + case 59: + ChipLogProgress(chipTool, + " ***** Test Step 59 : Reads constraints of optional attributes from DUT: NumberOfDailyTransitions\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_59(); + break; + case 60: + ChipLogProgress(chipTool, + " ***** Test Step 60 : Writes the respective default value to optional attributes to DUT: " + "NumberOfDailyTransitions\n"); + err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfDailyTransitions_60(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnSuccessResponse_5(int16_t absMinHeatSetpointLimit) +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 61; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override { - VerifyOrReturn(CheckValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 700)); + bool isExpectedDnssdResult = false; + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); NextTest(); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_6() + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_1(error); } - void OnFailureResponse_6(CHIP_ERROR error) + static void OnSuccessCallback_1(void * context, int16_t localTemperature) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_1(localTemperature); } - void OnSuccessResponse_6(int16_t absMaxHeatSetpointLimit) + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 3000)); - - NextTest(); + (static_cast(context))->OnFailureResponse_2(error); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_7() + static void OnSuccessCallback_2(void * context, int16_t absMinHeatSetpointLimit) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_2(absMinHeatSetpointLimit); } - void OnFailureResponse_7(CHIP_ERROR error) + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_3(error); } - void OnSuccessResponse_7(int16_t absMaxHeatSetpointLimit) + static void OnSuccessCallback_3(void * context, int16_t absMinHeatSetpointLimit) { - VerifyOrReturn(CheckConstraintType("absMaxHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 700)); - VerifyOrReturn(CheckConstraintMaxValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 3000)); - NextTest(); + (static_cast(context))->OnSuccessResponse_3(absMinHeatSetpointLimit); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxHeatSetpointLimit_8() + static void OnFailureCallback_4(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_4(error); + } - int16_t absMaxHeatSetpointLimitArgument; - absMaxHeatSetpointLimitArgument = 3000; + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - absMaxHeatSetpointLimitArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; + static void OnFailureCallback_5(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_5(error); } - void OnFailureResponse_8(CHIP_ERROR error) + static void OnSuccessCallback_5(void * context, int16_t absMinHeatSetpointLimit) { - chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + (static_cast(context))->OnSuccessResponse_5(absMinHeatSetpointLimit); } - void OnSuccessResponse_8() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_9() + static void OnFailureCallback_6(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_6(error); } - void OnFailureResponse_9(CHIP_ERROR error) + static void OnSuccessCallback_6(void * context, int16_t absMaxHeatSetpointLimit) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_6(absMaxHeatSetpointLimit); } - void OnSuccessResponse_9(int16_t absMaxHeatSetpointLimit) + static void OnFailureCallback_7(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 3000)); - - NextTest(); + (static_cast(context))->OnFailureResponse_7(error); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMinCoolSetpointLimit_10() + static void OnSuccessCallback_7(void * context, int16_t absMaxHeatSetpointLimit) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_7(absMaxHeatSetpointLimit); } - void OnFailureResponse_10(CHIP_ERROR error) + static void OnFailureCallback_8(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_8(error); } - void OnSuccessResponse_10(int16_t absMinCoolSetpointLimit) + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 1600)); + (static_cast(context))->OnFailureResponse_9(error); + } - NextTest(); + static void OnSuccessCallback_9(void * context, int16_t absMaxHeatSetpointLimit) + { + (static_cast(context))->OnSuccessResponse_9(absMaxHeatSetpointLimit); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinCoolSetpointLimit_11() + static void OnFailureCallback_10(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_10(error); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_10(void * context, int16_t absMinCoolSetpointLimit) + { + (static_cast(context))->OnSuccessResponse_10(absMinCoolSetpointLimit); } - void OnFailureResponse_11(CHIP_ERROR error) + static void OnFailureCallback_11(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_11(error); } - void OnSuccessResponse_11(int16_t absMinCoolSetpointLimit) + static void OnSuccessCallback_11(void * context, int16_t absMinCoolSetpointLimit) { - VerifyOrReturn(CheckConstraintType("absMinCoolSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 3200)); - NextTest(); + (static_cast(context))->OnSuccessResponse_11(absMinCoolSetpointLimit); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinCoolSetpointLimit_12() + static void OnFailureCallback_12(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_12(error); + } - int16_t absMinCoolSetpointLimitArgument; - absMinCoolSetpointLimitArgument = 1600; + static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - absMinCoolSetpointLimitArgument, this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; + static void OnFailureCallback_13(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_13(error); } - void OnFailureResponse_12(CHIP_ERROR error) + static void OnSuccessCallback_13(void * context, int16_t absMinCoolSetpointLimit) { - chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + (static_cast(context))->OnSuccessResponse_13(absMinCoolSetpointLimit); } - void OnSuccessResponse_12() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMinCoolSetpointLimit_13() + static void OnFailureCallback_14(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_14(error); } - void OnFailureResponse_13(CHIP_ERROR error) + static void OnSuccessCallback_14(void * context, int16_t absMaxCoolSetpointLimit) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_14(absMaxCoolSetpointLimit); } - void OnSuccessResponse_13(int16_t absMinCoolSetpointLimit) + static void OnFailureCallback_15(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 1600)); - - NextTest(); + (static_cast(context))->OnFailureResponse_15(error); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_14() + static void OnSuccessCallback_15(void * context, int16_t absMaxCoolSetpointLimit) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_15(absMaxCoolSetpointLimit); } - void OnFailureResponse_14(CHIP_ERROR error) + static void OnFailureCallback_16(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_16(error); } - void OnSuccessResponse_14(int16_t absMaxCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 3200)); + static void OnSuccessCallback_16(void * context) { (static_cast(context))->OnSuccessResponse_16(); } - NextTest(); + static void OnFailureCallback_17(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_17(error); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_15() + static void OnSuccessCallback_17(void * context, int16_t absMaxCoolSetpointLimit) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_15, OnFailureCallback_15, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_17(absMaxCoolSetpointLimit); } - void OnFailureResponse_15(CHIP_ERROR error) + static void OnFailureCallback_18(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_18(error); } - void OnSuccessResponse_15(int16_t absMaxCoolSetpointLimit) + static void OnSuccessCallback_18(void * context, int16_t occupiedCoolingSetpoint) { - VerifyOrReturn(CheckConstraintType("absMaxCoolSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 3200)); - NextTest(); + (static_cast(context))->OnSuccessResponse_18(occupiedCoolingSetpoint); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxCoolSetpointLimit_16() + static void OnFailureCallback_19(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t absMaxCoolSetpointLimitArgument; - absMaxCoolSetpointLimitArgument = 3200; + (static_cast(context))->OnFailureResponse_19(error); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - absMaxCoolSetpointLimitArgument, this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_19(void * context, int16_t occupiedCoolingSetpoint) + { + (static_cast(context))->OnSuccessResponse_19(occupiedCoolingSetpoint); } - void OnFailureResponse_16(CHIP_ERROR error) + static void OnFailureCallback_20(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + (static_cast(context))->OnFailureResponse_20(error); } - void OnSuccessResponse_16() { ThrowSuccessResponse(); } + static void OnSuccessCallback_20(void * context) { (static_cast(context))->OnSuccessResponse_20(); } - CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_17() + static void OnFailureCallback_21(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_17, OnFailureCallback_17, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_21(error); } - void OnFailureResponse_17(CHIP_ERROR error) + static void OnSuccessCallback_21(void * context, int16_t occupiedCoolingSetpoint) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_21(occupiedCoolingSetpoint); } - void OnSuccessResponse_17(int16_t absMaxCoolSetpointLimit) + static void OnFailureCallback_22(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 3200)); - - NextTest(); + (static_cast(context))->OnFailureResponse_22(error); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutOccupiedCoolingSetpoint_18() + static void OnSuccessCallback_22(void * context, int16_t occupiedHeatingSetpoint) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_22(occupiedHeatingSetpoint); } - void OnFailureResponse_18(CHIP_ERROR error) + static void OnFailureCallback_23(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_23(error); } - void OnSuccessResponse_18(int16_t occupiedCoolingSetpoint) + static void OnSuccessCallback_23(void * context, int16_t occupiedHeatingSetpoint) { - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); - - NextTest(); + (static_cast(context))->OnSuccessResponse_23(occupiedHeatingSetpoint); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedCoolingSetpoint_19() + static void OnFailureCallback_24(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_19, OnFailureCallback_19, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_24(error); } - void OnFailureResponse_19(CHIP_ERROR error) + static void OnSuccessCallback_24(void * context) { (static_cast(context))->OnSuccessResponse_24(); } + + static void OnFailureCallback_25(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_25(error); } - void OnSuccessResponse_19(int16_t occupiedCoolingSetpoint) + static void OnSuccessCallback_25(void * context, int16_t occupiedHeatingSetpoint) { - VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); - NextTest(); + (static_cast(context))->OnSuccessResponse_25(occupiedHeatingSetpoint); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedCoolingSetpoint_20() + static void OnFailureCallback_26(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_20, OnFailureCallback_20)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_26(error); } - void OnFailureResponse_20(CHIP_ERROR error) + static void OnSuccessCallback_26(void * context, int16_t minHeatSetpointLimit) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_26(minHeatSetpointLimit); } - void OnSuccessResponse_20() { NextTest(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutOccupiedCoolingSetpoint_21() + static void OnFailureCallback_27(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_21, OnFailureCallback_21, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_27(error); } - void OnFailureResponse_21(CHIP_ERROR error) + static void OnSuccessCallback_27(void * context, int16_t minHeatSetpointLimit) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_27(minHeatSetpointLimit); } - void OnSuccessResponse_21(int16_t occupiedCoolingSetpoint) + static void OnFailureCallback_28(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); - - NextTest(); + (static_cast(context))->OnFailureResponse_28(error); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutOccupiedHeatingSetpoint_22() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + static void OnSuccessCallback_28(void * context) { (static_cast(context))->OnSuccessResponse_28(); } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_22, OnFailureCallback_22, true)); - return CHIP_NO_ERROR; + static void OnFailureCallback_29(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_29(error); } - void OnFailureResponse_22(CHIP_ERROR error) + static void OnSuccessCallback_29(void * context, int16_t minHeatSetpointLimit) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_29(minHeatSetpointLimit); } - void OnSuccessResponse_22(int16_t occupiedHeatingSetpoint) + static void OnFailureCallback_30(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2000)); - - NextTest(); + (static_cast(context))->OnFailureResponse_30(error); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_23() + static void OnSuccessCallback_30(void * context, int16_t maxHeatSetpointLimit) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_30(maxHeatSetpointLimit); } - void OnFailureResponse_23(CHIP_ERROR error) + static void OnFailureCallback_31(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_31(error); } - void OnSuccessResponse_23(int16_t occupiedHeatingSetpoint) + static void OnSuccessCallback_31(void * context, int16_t maxHeatSetpointLimit) { - VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 700)); - VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2600)); - NextTest(); + (static_cast(context))->OnSuccessResponse_31(maxHeatSetpointLimit); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedHeatingSetpoint_24() + static void OnFailureCallback_32(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_32(error); + } - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2000; + static void OnSuccessCallback_32(void * context) { (static_cast(context))->OnSuccessResponse_32(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_24, OnFailureCallback_24)); - return CHIP_NO_ERROR; + static void OnFailureCallback_33(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_33(error); } - void OnFailureResponse_24(CHIP_ERROR error) + static void OnSuccessCallback_33(void * context, int16_t maxHeatSetpointLimit) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_33(maxHeatSetpointLimit); } - void OnSuccessResponse_24() { NextTest(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutOccupiedHeatingSetpoint_25() + static void OnFailureCallback_34(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_25, OnFailureCallback_25, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_34(error); } - void OnFailureResponse_25(CHIP_ERROR error) + static void OnSuccessCallback_34(void * context, int16_t minCoolSetpointLimit) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_34(minCoolSetpointLimit); } - void OnSuccessResponse_25(int16_t occupiedHeatingSetpoint) + static void OnFailureCallback_35(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2000)); - - NextTest(); + (static_cast(context))->OnFailureResponse_35(error); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutMinHeatSetpointLimit_26() + static void OnSuccessCallback_35(void * context, int16_t minCoolSetpointLimit) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_26, OnFailureCallback_26, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_35(minCoolSetpointLimit); } - void OnFailureResponse_26(CHIP_ERROR error) + static void OnFailureCallback_36(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_36(error); } - void OnSuccessResponse_26(int16_t minHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); + static void OnSuccessCallback_36(void * context) { (static_cast(context))->OnSuccessResponse_36(); } - NextTest(); + static void OnFailureCallback_37(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_37(error); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_27() + static void OnSuccessCallback_37(void * context, int16_t minCoolSetpointLimit) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_27, OnFailureCallback_27, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_37(minCoolSetpointLimit); } - void OnFailureResponse_27(CHIP_ERROR error) + static void OnFailureCallback_38(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_38(error); } - void OnSuccessResponse_27(int16_t minHeatSetpointLimit) + static void OnSuccessCallback_38(void * context, int16_t maxCoolSetpointLimit) { - VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); - VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", minHeatSetpointLimit, 3000)); - NextTest(); + (static_cast(context))->OnSuccessResponse_38(maxCoolSetpointLimit); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinHeatSetpointLimit_28() + static void OnFailureCallback_39(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 700; + (static_cast(context))->OnFailureResponse_39(error); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_28, OnFailureCallback_28)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_39(void * context, int16_t maxCoolSetpointLimit) + { + (static_cast(context))->OnSuccessResponse_39(maxCoolSetpointLimit); } - void OnFailureResponse_28(CHIP_ERROR error) + static void OnFailureCallback_40(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_40(error); } - void OnSuccessResponse_28() { NextTest(); } + static void OnSuccessCallback_40(void * context) { (static_cast(context))->OnSuccessResponse_40(); } - CHIP_ERROR TestReadBackMandatoryAttributesFromDutMinHeatSetpointLimit_29() + static void OnFailureCallback_41(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_29, OnFailureCallback_29, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_41(error); } - void OnFailureResponse_29(CHIP_ERROR error) + static void OnSuccessCallback_41(void * context, int16_t maxCoolSetpointLimit) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_41(maxCoolSetpointLimit); } - void OnSuccessResponse_29(int16_t minHeatSetpointLimit) + static void OnFailureCallback_42(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); - - NextTest(); + (static_cast(context))->OnFailureResponse_42(error); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutMaxHeatSetpointLimit_30() + static void OnSuccessCallback_42(void * context, + chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_30, OnFailureCallback_30, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_42(controlSequenceOfOperation); } - void OnFailureResponse_30(CHIP_ERROR error) + static void OnFailureCallback_43(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_43(error); } - void OnSuccessResponse_30(int16_t maxHeatSetpointLimit) + static void OnSuccessCallback_43(void * context, + chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) { - VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); - - NextTest(); + (static_cast(context))->OnSuccessResponse_43(controlSequenceOfOperation); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_31() + static void OnFailureCallback_44(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_31, OnFailureCallback_31, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_44(error); } - void OnFailureResponse_31(CHIP_ERROR error) + static void OnSuccessCallback_44(void * context) { (static_cast(context))->OnSuccessResponse_44(); } + + static void OnFailureCallback_45(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_45(error); } - void OnSuccessResponse_31(int16_t maxHeatSetpointLimit) + static void OnSuccessCallback_45(void * context, + chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) { - VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 700)); - VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); - NextTest(); + (static_cast(context))->OnSuccessResponse_45(controlSequenceOfOperation); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxHeatSetpointLimit_32() + static void OnFailureCallback_46(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_46(error); } - void OnFailureResponse_32(CHIP_ERROR error) + static void OnSuccessCallback_46(void * context, uint8_t systemMode) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_46(systemMode); } - void OnSuccessResponse_32() { NextTest(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutMaxHeatSetpointLimit_33() + static void OnFailureCallback_47(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_33, OnFailureCallback_33, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_47(error); } - void OnFailureResponse_33(CHIP_ERROR error) + static void OnSuccessCallback_47(void * context, uint8_t systemMode) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_47(systemMode); } - void OnSuccessResponse_33(int16_t maxHeatSetpointLimit) + static void OnFailureCallback_48(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); - - NextTest(); + (static_cast(context))->OnFailureResponse_48(error); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutMinCoolSetpointLimit_34() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + static void OnSuccessCallback_48(void * context) { (static_cast(context))->OnSuccessResponse_48(); } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_34, OnFailureCallback_34, true)); - return CHIP_NO_ERROR; + static void OnFailureCallback_49(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_49(error); } - void OnFailureResponse_34(CHIP_ERROR error) + static void OnSuccessCallback_49(void * context, uint8_t systemMode) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_49(systemMode); } - void OnSuccessResponse_34(int16_t minCoolSetpointLimit) + static void OnFailureCallback_50(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); - - NextTest(); + (static_cast(context))->OnFailureResponse_50(error); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinCoolSetpointLimit_35() + static void OnSuccessCallback_50(void * context, int8_t minSetpointDeadBand) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_35, OnFailureCallback_35, true)); - return CHIP_NO_ERROR; + (static_cast(context))->OnSuccessResponse_50(minSetpointDeadBand); } - void OnFailureResponse_35(CHIP_ERROR error) + static void OnFailureCallback_51(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_51(error); } - void OnSuccessResponse_35(int16_t minCoolSetpointLimit) + static void OnSuccessCallback_51(void * context, int8_t minSetpointDeadBand) { - VerifyOrReturn(CheckConstraintType("minCoolSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("minCoolSetpointLimit", minCoolSetpointLimit, 3200)); - NextTest(); + (static_cast(context))->OnSuccessResponse_51(minSetpointDeadBand); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinCoolSetpointLimit_36() + static void OnFailureCallback_52(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_52(error); + } - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 1600; + static void OnSuccessCallback_52(void * context) { (static_cast(context))->OnSuccessResponse_52(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_36, OnFailureCallback_36)); - return CHIP_NO_ERROR; + static void OnFailureCallback_53(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_53(error); } - void OnFailureResponse_36(CHIP_ERROR error) + static void OnSuccessCallback_53(void * context, int8_t minSetpointDeadBand) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_53(minSetpointDeadBand); } - void OnSuccessResponse_36() { NextTest(); } + static void OnFailureCallback_54(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_54(error); + } - CHIP_ERROR TestReadBackMandatoryAttributesFromDutMinCoolSetpointLimit_37() + static void OnSuccessCallback_54(void * context, uint8_t startOfWeek) + { + (static_cast(context))->OnSuccessResponse_54(startOfWeek); + } + + static void OnFailureCallback_55(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_55(error); + } + + static void OnSuccessCallback_55(void * context) { (static_cast(context))->OnSuccessResponse_55(); } + + static void OnFailureCallback_56(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_56(error); + } + + static void OnSuccessCallback_56(void * context, uint8_t startOfWeek) + { + (static_cast(context))->OnSuccessResponse_56(startOfWeek); + } + + static void OnFailureCallback_57(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_57(error); + } + + static void OnSuccessCallback_57(void * context, uint8_t numberOfWeeklyTransitions) + { + (static_cast(context))->OnSuccessResponse_57(numberOfWeeklyTransitions); + } + + static void OnFailureCallback_58(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_58(error); + } + + static void OnSuccessCallback_58(void * context) { (static_cast(context))->OnSuccessResponse_58(); } + + static void OnFailureCallback_59(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_59(error); + } + + static void OnSuccessCallback_59(void * context, uint8_t numberOfDailyTransitions) + { + (static_cast(context))->OnSuccessResponse_59(numberOfDailyTransitions); + } + + static void OnFailureCallback_60(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_60(error); + } + + static void OnSuccessCallback_60(void * context) { (static_cast(context))->OnSuccessResponse_60(); } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_37, OnFailureCallback_37, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_37(CHIP_ERROR error) + void OnFailureResponse_1(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_37(int16_t minCoolSetpointLimit) + void OnSuccessResponse_1(int16_t localTemperature) { - VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); - + VerifyOrReturn(CheckConstraintType("localTemperature", "", "int16")); NextTest(); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutMaxCoolSetpointLimit_38() + CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_38, OnFailureCallback_38, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_38(CHIP_ERROR error) + void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_38(int16_t maxCoolSetpointLimit) + void OnSuccessResponse_2(int16_t absMinHeatSetpointLimit) { - VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); + VerifyOrReturn(CheckValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 700)); NextTest(); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxCoolSetpointLimit_39() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_39, OnFailureCallback_39, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_39(CHIP_ERROR error) + void OnFailureResponse_3(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_39(int16_t maxCoolSetpointLimit) + void OnSuccessResponse_3(int16_t absMinHeatSetpointLimit) { - VerifyOrReturn(CheckConstraintType("maxCoolSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); + VerifyOrReturn(CheckConstraintType("absMinHeatSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 700)); + VerifyOrReturn(CheckConstraintMaxValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 3000)); NextTest(); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxCoolSetpointLimit_40() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinHeatSetpointLimit_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 3200; + int16_t absMinHeatSetpointLimitArgument; + absMinHeatSetpointLimitArgument = 700; - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_40, OnFailureCallback_40)); + ReturnErrorOnFailure(cluster.WriteAttribute( + absMinHeatSetpointLimitArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); return CHIP_NO_ERROR; } - void OnFailureResponse_40(CHIP_ERROR error) + void OnFailureResponse_4(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); } - void OnSuccessResponse_40() { NextTest(); } + void OnSuccessResponse_4() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackMandatoryAttributesFromDutMaxCoolSetpointLimit_41() + CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMinHeatSetpointLimit_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_41, OnFailureCallback_41, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_41(CHIP_ERROR error) + void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_41(int16_t maxCoolSetpointLimit) + void OnSuccessResponse_5(int16_t absMinHeatSetpointLimit) { - VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); + VerifyOrReturn(CheckValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 700)); NextTest(); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutControlSequenceOfOperation_42() + CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_42, OnFailureCallback_42, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_42(CHIP_ERROR error) + void OnFailureResponse_6(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_42(chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + void OnSuccessResponse_6(int16_t absMaxHeatSetpointLimit) { - VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 4)); + VerifyOrReturn(CheckValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 3000)); NextTest(); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_43() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_43, OnFailureCallback_43, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_43(CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_43(chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + void OnSuccessResponse_7(int16_t absMaxHeatSetpointLimit) { - VerifyOrReturn(CheckConstraintType("controlSequenceOfOperation", "", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("controlSequenceOfOperation", controlSequenceOfOperation, 0)); - VerifyOrReturn(CheckConstraintMaxValue("controlSequenceOfOperation", controlSequenceOfOperation, 5)); + VerifyOrReturn(CheckConstraintType("absMaxHeatSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 700)); + VerifyOrReturn(CheckConstraintMaxValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 3000)); NextTest(); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutControlSequenceOfOperation_44() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxHeatSetpointLimit_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperationArgument; - controlSequenceOfOperationArgument = static_cast(4); + int16_t absMaxHeatSetpointLimitArgument; + absMaxHeatSetpointLimitArgument = 3000; - ReturnErrorOnFailure( - cluster.WriteAttribute( - controlSequenceOfOperationArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); + ReturnErrorOnFailure(cluster.WriteAttribute( + absMaxHeatSetpointLimitArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); return CHIP_NO_ERROR; } - void OnFailureResponse_44(CHIP_ERROR error) + void OnFailureResponse_8(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); } - void OnSuccessResponse_44() { NextTest(); } + void OnSuccessResponse_8() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackMandatoryAttributesFromDutControlSequenceOfOperation_45() + CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_45, OnFailureCallback_45, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_9, OnFailureCallback_9, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_45(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_45(chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + void OnSuccessResponse_9(int16_t absMaxHeatSetpointLimit) { - VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 4)); + VerifyOrReturn(CheckValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 3000)); NextTest(); } - CHIP_ERROR TestReadsMandatoryAttributesFromDutSystemMode_46() + CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMinCoolSetpointLimit_10() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_46, OnFailureCallback_46, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_10, OnFailureCallback_10, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_46(CHIP_ERROR error) + void OnFailureResponse_10(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_46(uint8_t systemMode) + void OnSuccessResponse_10(int16_t absMinCoolSetpointLimit) { - VerifyOrReturn(CheckValue("systemMode", systemMode, 1)); + VerifyOrReturn(CheckValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 1600)); NextTest(); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_47() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinCoolSetpointLimit_11() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_47, OnFailureCallback_47, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_11, OnFailureCallback_11, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_47(CHIP_ERROR error) + void OnFailureResponse_11(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_47(uint8_t systemMode) + void OnSuccessResponse_11(int16_t absMinCoolSetpointLimit) { - VerifyOrReturn(CheckConstraintType("systemMode", "", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("systemMode", systemMode, 0)); - VerifyOrReturn(CheckConstraintMaxValue("systemMode", systemMode, 9)); + VerifyOrReturn(CheckConstraintType("absMinCoolSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 3200)); NextTest(); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutSystemMode_48() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinCoolSetpointLimit_12() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t systemModeArgument; - systemModeArgument = 1; + int16_t absMinCoolSetpointLimitArgument; + absMinCoolSetpointLimitArgument = 1600; - ReturnErrorOnFailure(cluster.WriteAttribute( - systemModeArgument, this, OnSuccessCallback_48, OnFailureCallback_48)); + ReturnErrorOnFailure(cluster.WriteAttribute( + absMinCoolSetpointLimitArgument, this, OnSuccessCallback_12, OnFailureCallback_12)); return CHIP_NO_ERROR; } - void OnFailureResponse_48(CHIP_ERROR error) + void OnFailureResponse_12(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); } - void OnSuccessResponse_48() { NextTest(); } + void OnSuccessResponse_12() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackMandatoryAttributesFromDutSystemMode_49() + CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMinCoolSetpointLimit_13() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_49, OnFailureCallback_49, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_13, OnFailureCallback_13, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_49(CHIP_ERROR error) + void OnFailureResponse_13(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_49(uint8_t systemMode) + void OnSuccessResponse_13(int16_t absMinCoolSetpointLimit) { - VerifyOrReturn(CheckValue("systemMode", systemMode, 1)); + VerifyOrReturn(CheckValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 1600)); NextTest(); } - CHIP_ERROR TestReadsOptionalAttributesFromDutMinSetpointDeadBand_50() + CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_14() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_50, OnFailureCallback_50, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_14, OnFailureCallback_14, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_50(CHIP_ERROR error) + void OnFailureResponse_14(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_50(int8_t minSetpointDeadBand) + void OnSuccessResponse_14(int16_t absMaxCoolSetpointLimit) { - VerifyOrReturn(CheckValue("minSetpointDeadBand", minSetpointDeadBand, 25)); + VerifyOrReturn(CheckValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 3200)); NextTest(); } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_51() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_15() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_51, OnFailureCallback_51, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_15, OnFailureCallback_15, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_51(CHIP_ERROR error) + void OnFailureResponse_15(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_51(int8_t minSetpointDeadBand) + void OnSuccessResponse_15(int16_t absMaxCoolSetpointLimit) { - VerifyOrReturn(CheckConstraintType("minSetpointDeadBand", "", "int8")); - VerifyOrReturn(CheckConstraintMinValue("minSetpointDeadBand", minSetpointDeadBand, 0)); - VerifyOrReturn(CheckConstraintMaxValue("minSetpointDeadBand", minSetpointDeadBand, 25)); + VerifyOrReturn(CheckConstraintType("absMaxCoolSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 3200)); NextTest(); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutMinSetpointDeadBand_52() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxCoolSetpointLimit_16() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int8_t minSetpointDeadBandArgument; - minSetpointDeadBandArgument = 25; + int16_t absMaxCoolSetpointLimitArgument; + absMaxCoolSetpointLimitArgument = 3200; - ReturnErrorOnFailure(cluster.WriteAttribute( - minSetpointDeadBandArgument, this, OnSuccessCallback_52, OnFailureCallback_52)); + ReturnErrorOnFailure(cluster.WriteAttribute( + absMaxCoolSetpointLimitArgument, this, OnSuccessCallback_16, OnFailureCallback_16)); return CHIP_NO_ERROR; } - void OnFailureResponse_52(CHIP_ERROR error) + void OnFailureResponse_16(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); } - void OnSuccessResponse_52() { NextTest(); } + void OnSuccessResponse_16() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadBackOptionalAttributesFromDutMinSetpointDeadBand_53() + CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_17() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_53, OnFailureCallback_53, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_17, OnFailureCallback_17, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_53(CHIP_ERROR error) + void OnFailureResponse_17(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_53(int8_t minSetpointDeadBand) + void OnSuccessResponse_17(int16_t absMaxCoolSetpointLimit) { - VerifyOrReturn(CheckValue("minSetpointDeadBand", minSetpointDeadBand, 25)); + VerifyOrReturn(CheckValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 3200)); NextTest(); } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_54() + CHIP_ERROR TestReadsMandatoryAttributesFromDutOccupiedCoolingSetpoint_18() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_54, OnFailureCallback_54, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_18, OnFailureCallback_18, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_54(CHIP_ERROR error) + void OnFailureResponse_18(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_54(uint8_t startOfWeek) + void OnSuccessResponse_18(int16_t occupiedCoolingSetpoint) { - VerifyOrReturn(CheckConstraintType("startOfWeek", "", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("startOfWeek", startOfWeek, 0)); - VerifyOrReturn(CheckConstraintMaxValue("startOfWeek", startOfWeek, 6)); + VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); + NextTest(); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutStartOfWeek_55() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedCoolingSetpoint_19() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t startOfWeekArgument; - startOfWeekArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - startOfWeekArgument, this, OnSuccessCallback_55, OnFailureCallback_55)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_19, OnFailureCallback_19, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_55(CHIP_ERROR error) + void OnFailureResponse_19(CHIP_ERROR error) { chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + ThrowFailureResponse(); } - void OnSuccessResponse_55() { ThrowSuccessResponse(); } + void OnSuccessResponse_19(int16_t occupiedCoolingSetpoint) + { + VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); + NextTest(); + } - CHIP_ERROR TestReadBackOptionalAttributesFromDutStartOfWeek_56() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedCoolingSetpoint_20() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_56, OnFailureCallback_56, true)); + int16_t occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = 2600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedCoolingSetpointArgument, this, OnSuccessCallback_20, OnFailureCallback_20)); return CHIP_NO_ERROR; } - void OnFailureResponse_56(CHIP_ERROR error) + void OnFailureResponse_20(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_56(uint8_t startOfWeek) - { - VerifyOrReturn(CheckValue("startOfWeek", startOfWeek, 0)); - - NextTest(); - } + void OnSuccessResponse_20() { NextTest(); } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_57() + CHIP_ERROR TestReadBackMandatoryAttributesFromDutOccupiedCoolingSetpoint_21() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_57, OnFailureCallback_57, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_21, OnFailureCallback_21, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_57(CHIP_ERROR error) + void OnFailureResponse_21(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_57(uint8_t numberOfWeeklyTransitions) + void OnSuccessResponse_21(int16_t occupiedCoolingSetpoint) { - VerifyOrReturn(CheckConstraintType("numberOfWeeklyTransitions", "", "uint8")); + VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); + NextTest(); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfWeeklyTransitions_58() + CHIP_ERROR TestReadsMandatoryAttributesFromDutOccupiedHeatingSetpoint_22() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t numberOfWeeklyTransitionsArgument; - numberOfWeeklyTransitionsArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - numberOfWeeklyTransitionsArgument, this, OnSuccessCallback_58, OnFailureCallback_58)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_22, OnFailureCallback_22, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_58(CHIP_ERROR error) + void OnFailureResponse_22(CHIP_ERROR error) { chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + ThrowFailureResponse(); } - void OnSuccessResponse_58() { ThrowSuccessResponse(); } + void OnSuccessResponse_22(int16_t occupiedHeatingSetpoint) + { + VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2000)); - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_59() + NextTest(); + } + + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_23() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_59, OnFailureCallback_59, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_23, OnFailureCallback_23, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_59(CHIP_ERROR error) + void OnFailureResponse_23(CHIP_ERROR error) { chip::app::StatusIB status(error); - (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + ThrowFailureResponse(); } - void OnSuccessResponse_59(uint8_t numberOfDailyTransitions) + void OnSuccessResponse_23(int16_t occupiedHeatingSetpoint) { - VerifyOrReturn(CheckConstraintType("numberOfDailyTransitions", "", "uint8")); + VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 700)); + VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2600)); NextTest(); } - CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfDailyTransitions_60() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedHeatingSetpoint_24() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ThermostatClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t numberOfDailyTransitionsArgument; - numberOfDailyTransitionsArgument = 0; + int16_t occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = 2000; - ReturnErrorOnFailure( - cluster.WriteAttribute( - numberOfDailyTransitionsArgument, this, OnSuccessCallback_60, OnFailureCallback_60)); + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedHeatingSetpointArgument, this, OnSuccessCallback_24, OnFailureCallback_24)); return CHIP_NO_ERROR; } - void OnFailureResponse_60(CHIP_ERROR error) + void OnFailureResponse_24(CHIP_ERROR error) { chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + ThrowFailureResponse(); } - void OnSuccessResponse_60() { ThrowSuccessResponse(); } -}; + void OnSuccessResponse_24() { NextTest(); } -class Test_TC_TSTAT_2_2Suite : public TestCommand -{ -public: - Test_TC_TSTAT_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_TSTAT_2_2", credsIssuerConfig), mTestIndex(0) + CHIP_ERROR TestReadBackMandatoryAttributesFromDutOccupiedHeatingSetpoint_25() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_25, OnFailureCallback_25, true)); + return CHIP_NO_ERROR; } - ~Test_TC_TSTAT_2_2Suite() {} + void OnFailureResponse_25(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnSuccessResponse_25(int16_t occupiedHeatingSetpoint) { - CHIP_ERROR err = CHIP_NO_ERROR; + VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2000)); - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_2\n"); - } + NextTest(); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_2_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + CHIP_ERROR TestReadsMandatoryAttributesFromDutMinHeatSetpointLimit_26() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_26, OnFailureCallback_26, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_26(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_26(int16_t minHeatSetpointLimit) + { + VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); + + NextTest(); + } + + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_27() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_27, OnFailureCallback_27, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_27(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_27(int16_t minHeatSetpointLimit) + { + VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); + VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", minHeatSetpointLimit, 3000)); + NextTest(); + } + + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinHeatSetpointLimit_28() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = 700; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minHeatSetpointLimitArgument, this, OnSuccessCallback_28, OnFailureCallback_28)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_28(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_28() { NextTest(); } + + CHIP_ERROR TestReadBackMandatoryAttributesFromDutMinHeatSetpointLimit_29() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_29, OnFailureCallback_29, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_29(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_29(int16_t minHeatSetpointLimit) + { + VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); + + NextTest(); + } + + CHIP_ERROR TestReadsMandatoryAttributesFromDutMaxHeatSetpointLimit_30() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_30, OnFailureCallback_30, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_30(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_30(int16_t maxHeatSetpointLimit) + { + VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); + + NextTest(); + } + + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_31() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_31, OnFailureCallback_31, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_31(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_31(int16_t maxHeatSetpointLimit) + { + VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 700)); + VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); + NextTest(); + } + + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxHeatSetpointLimit_32() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = 3000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxHeatSetpointLimitArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_32(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_32() { NextTest(); } + + CHIP_ERROR TestReadBackMandatoryAttributesFromDutMaxHeatSetpointLimit_33() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_33, OnFailureCallback_33, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_33(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_33(int16_t maxHeatSetpointLimit) + { + VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); + + NextTest(); + } + + CHIP_ERROR TestReadsMandatoryAttributesFromDutMinCoolSetpointLimit_34() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_34, OnFailureCallback_34, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_34(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_34(int16_t minCoolSetpointLimit) + { + VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); + + NextTest(); + } + + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinCoolSetpointLimit_35() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_35, OnFailureCallback_35, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_35(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_35(int16_t minCoolSetpointLimit) + { + VerifyOrReturn(CheckConstraintType("minCoolSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("minCoolSetpointLimit", minCoolSetpointLimit, 3200)); + NextTest(); + } + + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinCoolSetpointLimit_36() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = 1600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minCoolSetpointLimitArgument, this, OnSuccessCallback_36, OnFailureCallback_36)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_36(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_36() { NextTest(); } + + CHIP_ERROR TestReadBackMandatoryAttributesFromDutMinCoolSetpointLimit_37() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_37, OnFailureCallback_37, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_37(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_37(int16_t minCoolSetpointLimit) + { + VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); + + NextTest(); + } + + CHIP_ERROR TestReadsMandatoryAttributesFromDutMaxCoolSetpointLimit_38() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_38, OnFailureCallback_38, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_38(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_38(int16_t maxCoolSetpointLimit) + { + VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); + + NextTest(); + } + + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxCoolSetpointLimit_39() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_39, OnFailureCallback_39, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_39(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_39(int16_t maxCoolSetpointLimit) + { + VerifyOrReturn(CheckConstraintType("maxCoolSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); + NextTest(); + } + + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxCoolSetpointLimit_40() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = 3200; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxCoolSetpointLimitArgument, this, OnSuccessCallback_40, OnFailureCallback_40)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_40(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_40() { NextTest(); } + + CHIP_ERROR TestReadBackMandatoryAttributesFromDutMaxCoolSetpointLimit_41() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_41, OnFailureCallback_41, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_41(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_41(int16_t maxCoolSetpointLimit) + { + VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); + + NextTest(); + } + + CHIP_ERROR TestReadsMandatoryAttributesFromDutControlSequenceOfOperation_42() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_42, OnFailureCallback_42, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_42(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_42(chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + { + VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 4)); + + NextTest(); + } + + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_43() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_43, OnFailureCallback_43, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_43(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_43(chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + { + VerifyOrReturn(CheckConstraintType("controlSequenceOfOperation", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("controlSequenceOfOperation", controlSequenceOfOperation, 0)); + VerifyOrReturn(CheckConstraintMaxValue("controlSequenceOfOperation", controlSequenceOfOperation, 5)); + NextTest(); + } + + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutControlSequenceOfOperation_44() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperationArgument; + controlSequenceOfOperationArgument = static_cast(4); + + ReturnErrorOnFailure( + cluster.WriteAttribute( + controlSequenceOfOperationArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_44(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_44() { NextTest(); } + + CHIP_ERROR TestReadBackMandatoryAttributesFromDutControlSequenceOfOperation_45() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_45, OnFailureCallback_45, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_45(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_45(chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + { + VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 4)); + + NextTest(); + } + + CHIP_ERROR TestReadsMandatoryAttributesFromDutSystemMode_46() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_46, OnFailureCallback_46, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_46(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_46(uint8_t systemMode) + { + VerifyOrReturn(CheckValue("systemMode", systemMode, 1)); + + NextTest(); + } + + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_47() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_47, OnFailureCallback_47, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_47(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_47(uint8_t systemMode) + { + VerifyOrReturn(CheckConstraintType("systemMode", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("systemMode", systemMode, 0)); + VerifyOrReturn(CheckConstraintMaxValue("systemMode", systemMode, 9)); + NextTest(); + } + + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutSystemMode_48() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t systemModeArgument; + systemModeArgument = 1; + + ReturnErrorOnFailure(cluster.WriteAttribute( + systemModeArgument, this, OnSuccessCallback_48, OnFailureCallback_48)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_48(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_48() { NextTest(); } + + CHIP_ERROR TestReadBackMandatoryAttributesFromDutSystemMode_49() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_49, OnFailureCallback_49, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_49(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_49(uint8_t systemMode) + { + VerifyOrReturn(CheckValue("systemMode", systemMode, 1)); + + NextTest(); + } + + CHIP_ERROR TestReadsOptionalAttributesFromDutMinSetpointDeadBand_50() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_50, OnFailureCallback_50, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_50(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_50(int8_t minSetpointDeadBand) + { + VerifyOrReturn(CheckValue("minSetpointDeadBand", minSetpointDeadBand, 25)); + + NextTest(); + } + + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_51() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_51, OnFailureCallback_51, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_51(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_51(int8_t minSetpointDeadBand) + { + VerifyOrReturn(CheckConstraintType("minSetpointDeadBand", "", "int8")); + VerifyOrReturn(CheckConstraintMinValue("minSetpointDeadBand", minSetpointDeadBand, 0)); + VerifyOrReturn(CheckConstraintMaxValue("minSetpointDeadBand", minSetpointDeadBand, 25)); + NextTest(); + } + + CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutMinSetpointDeadBand_52() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int8_t minSetpointDeadBandArgument; + minSetpointDeadBandArgument = 25; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minSetpointDeadBandArgument, this, OnSuccessCallback_52, OnFailureCallback_52)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_52(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_52() { NextTest(); } + + CHIP_ERROR TestReadBackOptionalAttributesFromDutMinSetpointDeadBand_53() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_53, OnFailureCallback_53, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_53(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_53(int8_t minSetpointDeadBand) + { + VerifyOrReturn(CheckValue("minSetpointDeadBand", minSetpointDeadBand, 25)); + + NextTest(); + } + + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_54() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_54, OnFailureCallback_54, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_54(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_54(uint8_t startOfWeek) + { + VerifyOrReturn(CheckConstraintType("startOfWeek", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("startOfWeek", startOfWeek, 0)); + VerifyOrReturn(CheckConstraintMaxValue("startOfWeek", startOfWeek, 6)); + NextTest(); + } + + CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutStartOfWeek_55() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t startOfWeekArgument; + startOfWeekArgument = 0; + + ReturnErrorOnFailure(cluster.WriteAttribute( + startOfWeekArgument, this, OnSuccessCallback_55, OnFailureCallback_55)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_55(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + } + + void OnSuccessResponse_55() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadBackOptionalAttributesFromDutStartOfWeek_56() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_56, OnFailureCallback_56, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_56(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_56(uint8_t startOfWeek) + { + VerifyOrReturn(CheckValue("startOfWeek", startOfWeek, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_57() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_57, OnFailureCallback_57, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_57(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_57(uint8_t numberOfWeeklyTransitions) + { + VerifyOrReturn(CheckConstraintType("numberOfWeeklyTransitions", "", "uint8")); + NextTest(); + } + + CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfWeeklyTransitions_58() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t numberOfWeeklyTransitionsArgument; + numberOfWeeklyTransitionsArgument = 0; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + numberOfWeeklyTransitionsArgument, this, OnSuccessCallback_58, OnFailureCallback_58)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_58(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + } + + void OnSuccessResponse_58() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_59() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_59, OnFailureCallback_59, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_59(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_59(uint8_t numberOfDailyTransitions) + { + VerifyOrReturn(CheckConstraintType("numberOfDailyTransitions", "", "uint8")); + NextTest(); + } + + CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfDailyTransitions_60() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t numberOfDailyTransitionsArgument; + numberOfDailyTransitionsArgument = 0; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + numberOfDailyTransitionsArgument, this, OnSuccessCallback_60, OnFailureCallback_60)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_60(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + } + + void OnSuccessResponse_60() { ThrowSuccessResponse(); } +}; + +class Test_TC_TSTAT_2_2Suite : public TestCommand +{ +public: + Test_TC_TSTAT_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TSTAT_2_2", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_TSTAT_2_2Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the " + "value is within range\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1(); + break; + case 2: + ChipLogProgress( + chipTool, + " ***** Test Step 2 : Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2(); + break; + case 3: + ChipLogProgress( + chipTool, + " ***** Test Step 3 : Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the " + "value is within range\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6(); + break; + case 7: + ChipLogProgress( + chipTool, + " ***** Test Step 7 : Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7(); + break; + case 8: + ChipLogProgress( + chipTool, + " ***** Test Step 8 : Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the " + "value is within range\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11(); + break; + case 12: + ChipLogProgress( + chipTool, + " ***** Test Step 12 : Writes a value back that is different but valid for MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12(); + break; + case 13: + ChipLogProgress( + chipTool, + " ***** Test Step 13 : Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13(); + break; + case 14: + ChipLogProgress( + chipTool, " ***** Test Step 14 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14(); + break; + case 15: + ChipLogProgress( + chipTool, " ***** Test Step 15 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the " + "value is within range\n"); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16(); + break; + case 17: + ChipLogProgress( + chipTool, + " ***** Test Step 17 : Writes a value back that is different but valid for MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17(); + break; + case 18: + ChipLogProgress( + chipTool, + " ***** Test Step 18 : Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18(); + break; + case 19: + ChipLogProgress( + chipTool, " ***** Test Step 19 : Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the " + "value is within range\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21(); + break; + case 22: + ChipLogProgress( + chipTool, + " ***** Test Step 22 : Writes a value back that is different but valid for MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22(); + break; + case 23: + ChipLogProgress( + chipTool, + " ***** Test Step 23 : Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23(); + break; + case 24: + ChipLogProgress( + chipTool, " ***** Test Step 24 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24(); + break; + case 25: + ChipLogProgress(chipTool, + " ***** Test Step 25 : Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25(); + break; + case 26: + ChipLogProgress(chipTool, + " ***** Test Step 26 : Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the " + "value is within range\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26(); + break; + case 27: + ChipLogProgress( + chipTool, + " ***** Test Step 27 : Writes a value back that is different but valid for MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27(); + break; + case 28: + ChipLogProgress( + chipTool, + " ***** Test Step 28 : Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28(); + break; + case 29: + ChipLogProgress( + chipTool, " ***** Test Step 29 : Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29(); + break; + case 30: + ChipLogProgress(chipTool, + " ***** Test Step 30 : Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30(); + break; + case 31: + ChipLogProgress( + chipTool, + " ***** Test Step 31 : Writes (sets back) the limit of MinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31(); + break; + case 32: + ChipLogProgress( + chipTool, + " ***** Test Step 32 : Writes (sets back) the limit of MaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32(); + break; + case 33: + ChipLogProgress( + chipTool, + " ***** Test Step 33 : Writes (sets back) the limit of MinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33(); + break; + case 34: + ChipLogProgress( + chipTool, + " ***** Test Step 34 : Writes (sets back) the limit of MaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34(); + break; + case 35: + ChipLogProgress( + chipTool, + " ***** Test Step 35 : Writes (sets back) the limit of MinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35(); + break; + case 36: + ChipLogProgress( + chipTool, + " ***** Test Step 36 : Writes (sets back) the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36(); + break; + case 37: + ChipLogProgress( + chipTool, + " ***** Test Step 37 : Writes (sets back) the limit of MinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37(); + break; + case 38: + ChipLogProgress( + chipTool, + " ***** Test Step 38 : Writes (sets back) the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38(); + break; + case 39: + ChipLogProgress( + chipTool, + " ***** Test Step 39 : Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid\n"); + if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) + { + NextTest(); + return; + } + err = TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39(); + break; + case 40: + ChipLogProgress( + chipTool, " ***** Test Step 40 : Write Attribute command for ControlSequenceOfOperation with a new valid value\n"); + if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) + { + NextTest(); + return; + } + err = TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Read it back again to confirm the successful write\n"); + if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) + { + NextTest(); + return; + } + err = TestReadItBackAgainToConfirmTheSuccessfulWrite_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_49(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 50; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, int16_t occupiedCoolingSetpoint) + { + (static_cast(context))->OnSuccessResponse_1(occupiedCoolingSetpoint); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, int16_t occupiedCoolingSetpoint) + { + (static_cast(context))->OnSuccessResponse_3(occupiedCoolingSetpoint); + } + + static void OnFailureCallback_4(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_4(error); + } + + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + + static void OnFailureCallback_5(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_5(error); + } + + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context, int16_t occupiedHeatingSetpoint) + { + (static_cast(context))->OnSuccessResponse_6(occupiedHeatingSetpoint); + } + + static void OnFailureCallback_7(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_7(error); + } + + static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + + static void OnFailureCallback_8(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_8(error); + } + + static void OnSuccessCallback_8(void * context, int16_t occupiedHeatingSetpoint) + { + (static_cast(context))->OnSuccessResponse_8(occupiedHeatingSetpoint); + } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } + + static void OnFailureCallback_10(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_10(error); + } + + static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + + static void OnFailureCallback_11(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_11(error); + } + + static void OnSuccessCallback_11(void * context, int16_t minHeatSetpointLimit) + { + (static_cast(context))->OnSuccessResponse_11(minHeatSetpointLimit); + } + + static void OnFailureCallback_12(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_12(error); + } + + static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } + + static void OnFailureCallback_13(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_13(error); + } + + static void OnSuccessCallback_13(void * context, int16_t minHeatSetpointLimit) + { + (static_cast(context))->OnSuccessResponse_13(minHeatSetpointLimit); + } + + static void OnFailureCallback_14(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_14(error); + } + + static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } + + static void OnFailureCallback_15(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_15(error); + } + + static void OnSuccessCallback_15(void * context) { (static_cast(context))->OnSuccessResponse_15(); } + + static void OnFailureCallback_16(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_16(error); + } + + static void OnSuccessCallback_16(void * context, int16_t maxHeatSetpointLimit) + { + (static_cast(context))->OnSuccessResponse_16(maxHeatSetpointLimit); + } + + static void OnFailureCallback_17(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_17(error); + } + + static void OnSuccessCallback_17(void * context) { (static_cast(context))->OnSuccessResponse_17(); } + + static void OnFailureCallback_18(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_18(error); + } + + static void OnSuccessCallback_18(void * context, int16_t maxHeatSetpointLimit) + { + (static_cast(context))->OnSuccessResponse_18(maxHeatSetpointLimit); + } + + static void OnFailureCallback_19(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_19(error); + } + + static void OnSuccessCallback_19(void * context) { (static_cast(context))->OnSuccessResponse_19(); } + + static void OnFailureCallback_20(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_20(error); + } + + static void OnSuccessCallback_20(void * context) { (static_cast(context))->OnSuccessResponse_20(); } + + static void OnFailureCallback_21(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_21(error); + } + + static void OnSuccessCallback_21(void * context, int16_t minCoolSetpointLimit) + { + (static_cast(context))->OnSuccessResponse_21(minCoolSetpointLimit); + } + + static void OnFailureCallback_22(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_22(error); + } + + static void OnSuccessCallback_22(void * context) { (static_cast(context))->OnSuccessResponse_22(); } + + static void OnFailureCallback_23(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_23(error); + } + + static void OnSuccessCallback_23(void * context, int16_t minCoolSetpointLimit) + { + (static_cast(context))->OnSuccessResponse_23(minCoolSetpointLimit); + } + + static void OnFailureCallback_24(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_24(error); + } + + static void OnSuccessCallback_24(void * context) { (static_cast(context))->OnSuccessResponse_24(); } + + static void OnFailureCallback_25(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_25(error); + } + + static void OnSuccessCallback_25(void * context) { (static_cast(context))->OnSuccessResponse_25(); } + + static void OnFailureCallback_26(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_26(error); + } + + static void OnSuccessCallback_26(void * context, int16_t maxCoolSetpointLimit) + { + (static_cast(context))->OnSuccessResponse_26(maxCoolSetpointLimit); + } + + static void OnFailureCallback_27(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_27(error); + } + + static void OnSuccessCallback_27(void * context) { (static_cast(context))->OnSuccessResponse_27(); } + + static void OnFailureCallback_28(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_28(error); + } + + static void OnSuccessCallback_28(void * context, int16_t maxCoolSetpointLimit) + { + (static_cast(context))->OnSuccessResponse_28(maxCoolSetpointLimit); + } + + static void OnFailureCallback_29(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_29(error); + } + + static void OnSuccessCallback_29(void * context) { (static_cast(context))->OnSuccessResponse_29(); } + + static void OnFailureCallback_30(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_30(error); + } + + static void OnSuccessCallback_30(void * context) { (static_cast(context))->OnSuccessResponse_30(); } + + static void OnFailureCallback_31(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_31(error); + } + + static void OnSuccessCallback_31(void * context) { (static_cast(context))->OnSuccessResponse_31(); } + + static void OnFailureCallback_32(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_32(error); + } + + static void OnSuccessCallback_32(void * context) { (static_cast(context))->OnSuccessResponse_32(); } + + static void OnFailureCallback_33(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_33(error); + } + + static void OnSuccessCallback_33(void * context) { (static_cast(context))->OnSuccessResponse_33(); } + + static void OnFailureCallback_34(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_34(error); + } + + static void OnSuccessCallback_34(void * context) { (static_cast(context))->OnSuccessResponse_34(); } + + static void OnFailureCallback_35(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_35(error); + } + + static void OnSuccessCallback_35(void * context) { (static_cast(context))->OnSuccessResponse_35(); } + + static void OnFailureCallback_36(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_36(error); + } + + static void OnSuccessCallback_36(void * context) { (static_cast(context))->OnSuccessResponse_36(); } + + static void OnFailureCallback_37(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_37(error); + } + + static void OnSuccessCallback_37(void * context) { (static_cast(context))->OnSuccessResponse_37(); } + + static void OnFailureCallback_38(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_38(error); + } + + static void OnSuccessCallback_38(void * context) { (static_cast(context))->OnSuccessResponse_38(); } + + static void OnFailureCallback_39(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_39(error); + } + + static void OnSuccessCallback_39(void * context, + chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + { + (static_cast(context))->OnSuccessResponse_39(controlSequenceOfOperation); + } + + static void OnFailureCallback_40(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_40(error); + } + + static void OnSuccessCallback_40(void * context) { (static_cast(context))->OnSuccessResponse_40(); } + + static void OnFailureCallback_41(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_41(error); + } + + static void OnSuccessCallback_41(void * context, + chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + { + (static_cast(context))->OnSuccessResponse_41(controlSequenceOfOperation); + } + + static void OnFailureCallback_42(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_42(error); + } + + static void OnSuccessCallback_42(void * context) { (static_cast(context))->OnSuccessResponse_42(); } + + static void OnFailureCallback_43(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_43(error); + } + + static void OnSuccessCallback_43(void * context) { (static_cast(context))->OnSuccessResponse_43(); } + + static void OnFailureCallback_44(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_44(error); + } + + static void OnSuccessCallback_44(void * context) { (static_cast(context))->OnSuccessResponse_44(); } + + static void OnFailureCallback_45(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_45(error); + } + + static void OnSuccessCallback_45(void * context) { (static_cast(context))->OnSuccessResponse_45(); } + + static void OnFailureCallback_46(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_46(error); + } + + static void OnSuccessCallback_46(void * context) { (static_cast(context))->OnSuccessResponse_46(); } + + static void OnFailureCallback_47(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_47(error); + } + + static void OnSuccessCallback_47(void * context) { (static_cast(context))->OnSuccessResponse_47(); } + + static void OnFailureCallback_48(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_48(error); + } + + static void OnSuccessCallback_48(void * context) { (static_cast(context))->OnSuccessResponse_48(); } + + static void OnFailureCallback_49(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_49(error); + } + + static void OnSuccessCallback_49(void * context) { (static_cast(context))->OnSuccessResponse_49(); } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(int16_t occupiedCoolingSetpoint) + { + VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); + VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); + NextTest(); + } + + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = 2000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedCoolingSetpointArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(int16_t occupiedCoolingSetpoint) + { + VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2000)); + + NextTest(); + } + + CHIP_ERROR TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = 1600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedCoolingSetpointArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = 2600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedCoolingSetpointArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_5() { NextTest(); } + + CHIP_ERROR TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_6(int16_t occupiedHeatingSetpoint) + { + VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2000)); + VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 700)); + VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 3000)); + NextTest(); + } + + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = 2100; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedHeatingSetpointArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_7() { NextTest(); } + + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_8, OnFailureCallback_8, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_8(int16_t occupiedHeatingSetpoint) + { + VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2100)); + + NextTest(); + } + + CHIP_ERROR TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = 700; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedHeatingSetpointArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_9(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_9() { NextTest(); } + + CHIP_ERROR TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = 3000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedHeatingSetpointArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_10(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_10() { NextTest(); } + + CHIP_ERROR TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_11, OnFailureCallback_11, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_11(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_11(int16_t minHeatSetpointLimit) + { + VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); + VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); + VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", minHeatSetpointLimit, 3000)); + NextTest(); + } + + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = 2000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minHeatSetpointLimitArgument, this, OnSuccessCallback_12, OnFailureCallback_12)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_12(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_12() { NextTest(); } + + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_13, OnFailureCallback_13, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_13(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_13(int16_t minHeatSetpointLimit) + { + VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 2000)); + + NextTest(); + } + + CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = 700; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minHeatSetpointLimitArgument, this, OnSuccessCallback_14, OnFailureCallback_14)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_14(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_14() { NextTest(); } + + CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = 3000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minHeatSetpointLimitArgument, this, OnSuccessCallback_15, OnFailureCallback_15)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_15(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_15() { NextTest(); } + + CHIP_ERROR TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_16, OnFailureCallback_16, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_16(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_16(int16_t maxHeatSetpointLimit) + { + VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); + VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 700)); + VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); + NextTest(); + } + + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = 2000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxHeatSetpointLimitArgument, this, OnSuccessCallback_17, OnFailureCallback_17)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_17(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_17() { NextTest(); } + + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_18, OnFailureCallback_18, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_18(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_18(int16_t maxHeatSetpointLimit) + { + VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 2000)); + + NextTest(); + } + + CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = 700; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxHeatSetpointLimitArgument, this, OnSuccessCallback_19, OnFailureCallback_19)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_19(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_19() { NextTest(); } + + CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = 3000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxHeatSetpointLimitArgument, this, OnSuccessCallback_20, OnFailureCallback_20)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_20(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_20() { NextTest(); } + + CHIP_ERROR TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_21, OnFailureCallback_21, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_21(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_21(int16_t minCoolSetpointLimit) + { + VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); + VerifyOrReturn(CheckConstraintType("minCoolSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("minCoolSetpointLimit", minCoolSetpointLimit, 3200)); + NextTest(); + } + + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = 2000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minCoolSetpointLimitArgument, this, OnSuccessCallback_22, OnFailureCallback_22)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_22(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_22() { NextTest(); } + + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_23, OnFailureCallback_23, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_23(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_23(int16_t minCoolSetpointLimit) + { + VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 2000)); + + NextTest(); + } + + CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = 1600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minCoolSetpointLimitArgument, this, OnSuccessCallback_24, OnFailureCallback_24)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_24(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_24() { NextTest(); } + + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = 3200; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minCoolSetpointLimitArgument, this, OnSuccessCallback_25, OnFailureCallback_25)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_25(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_25() { NextTest(); } + + CHIP_ERROR TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_26, OnFailureCallback_26, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_26(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_26(int16_t maxCoolSetpointLimit) + { + VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); + VerifyOrReturn(CheckConstraintType("maxCoolSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 1600)); + VerifyOrReturn(CheckConstraintMaxValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); + NextTest(); + } + + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = 2000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxCoolSetpointLimitArgument, this, OnSuccessCallback_27, OnFailureCallback_27)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_27(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_27() { NextTest(); } + + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_28, OnFailureCallback_28, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_28(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_28(int16_t maxCoolSetpointLimit) + { + VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 2000)); + + NextTest(); + } + + CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = 1600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxCoolSetpointLimitArgument, this, OnSuccessCallback_29, OnFailureCallback_29)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_29(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_29() { NextTest(); } + + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = 3200; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxCoolSetpointLimitArgument, this, OnSuccessCallback_30, OnFailureCallback_30)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_30(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_30() { NextTest(); } + + CHIP_ERROR TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = 700; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minHeatSetpointLimitArgument, this, OnSuccessCallback_31, OnFailureCallback_31)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_31(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_31() { NextTest(); } + + CHIP_ERROR TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = 3000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minHeatSetpointLimitArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_32(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_32() { NextTest(); } + + CHIP_ERROR TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = 700; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxHeatSetpointLimitArgument, this, OnSuccessCallback_33, OnFailureCallback_33)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_33(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_33() { NextTest(); } + + CHIP_ERROR TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = 3000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxHeatSetpointLimitArgument, this, OnSuccessCallback_34, OnFailureCallback_34)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_34(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_34() { NextTest(); } + + CHIP_ERROR TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = 1600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minCoolSetpointLimitArgument, this, OnSuccessCallback_35, OnFailureCallback_35)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_35(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_35() { NextTest(); } + + CHIP_ERROR TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = 3200; + + ReturnErrorOnFailure(cluster.WriteAttribute( + minCoolSetpointLimitArgument, this, OnSuccessCallback_36, OnFailureCallback_36)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_36(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_36() { NextTest(); } + + CHIP_ERROR TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = 1600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxCoolSetpointLimitArgument, this, OnSuccessCallback_37, OnFailureCallback_37)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_37(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_37() { NextTest(); } + + CHIP_ERROR TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = 3200; + + ReturnErrorOnFailure(cluster.WriteAttribute( + maxCoolSetpointLimitArgument, this, OnSuccessCallback_38, OnFailureCallback_38)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_38(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_38() { NextTest(); } + + CHIP_ERROR TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_39, OnFailureCallback_39, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_39(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_39(chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + { + VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 4)); + VerifyOrReturn(CheckConstraintType("controlSequenceOfOperation", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("controlSequenceOfOperation", controlSequenceOfOperation, 0)); + VerifyOrReturn(CheckConstraintMaxValue("controlSequenceOfOperation", controlSequenceOfOperation, 5)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperationArgument; + controlSequenceOfOperationArgument = static_cast(2); + + ReturnErrorOnFailure( + cluster.WriteAttribute( + controlSequenceOfOperationArgument, this, OnSuccessCallback_40, OnFailureCallback_40)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_40(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_40() { NextTest(); } + + CHIP_ERROR TestReadItBackAgainToConfirmTheSuccessfulWrite_41() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_41, OnFailureCallback_41, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_41(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_41(chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + { + VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 2)); + + NextTest(); + } + + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_42() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = 2000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedHeatingSetpointArgument, this, OnSuccessCallback_42, OnFailureCallback_42)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_42(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_42() { NextTest(); } + + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_43() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = 2000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedHeatingSetpointArgument, this, OnSuccessCallback_43, OnFailureCallback_43)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_43(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_43() { NextTest(); } + + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_44() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = 2600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedCoolingSetpointArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_44(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_44() { NextTest(); } + + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_45() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = 2600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedCoolingSetpointArgument, this, OnSuccessCallback_45, OnFailureCallback_45)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_45(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_45() { NextTest(); } + + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_46() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = 2600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedCoolingSetpointArgument, this, OnSuccessCallback_46, OnFailureCallback_46)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_46(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_46() { NextTest(); } + + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_47() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = 2000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedHeatingSetpointArgument, this, OnSuccessCallback_47, OnFailureCallback_47)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_47(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_47() { NextTest(); } + + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_48() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = 2600; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedCoolingSetpointArgument, this, OnSuccessCallback_48, OnFailureCallback_48)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_48(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_48() { NextTest(); } + + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_49() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + int16_t occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = 2000; + + ReturnErrorOnFailure(cluster.WriteAttribute( + occupiedHeatingSetpointArgument, this, OnSuccessCallback_49, OnFailureCallback_49)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_49(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_49() { NextTest(); } +}; + +class Test_TC_TSUIC_1_1Suite : public TestCommand +{ +public: + Test_TC_TSUIC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TSUIC_1_1", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_TSUIC_1_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint16_t clusterRevisionArgument; + clusterRevisionArgument = 2U; + + ReturnErrorOnFailure( + cluster + .WriteAttribute( + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + } + + void OnSuccessResponse_2() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + +class Test_TC_TSUIC_2_1Suite : public TestCommand +{ +public: + Test_TC_TSUIC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TSUIC_2_1", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_TSUIC_2_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : write to the mandatory attribute: TemperatureDisplayMode\n"); + err = TestWriteToTheMandatoryAttributeTemperatureDisplayMode_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : write to the mandatory attribute: KeypadLockout\n"); + err = TestWriteToTheMandatoryAttributeKeypadLockout_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : write to the mandatory attribute: ScheduleProgrammingVisibility\n"); + err = TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_15(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 16; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_1(temperatureDisplayMode); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_2(temperatureDisplayMode); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_4(error); + } + + static void OnSuccessCallback_4(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_4(temperatureDisplayMode); + } + + static void OnFailureCallback_5(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_5(error); + } + + static void OnSuccessCallback_5(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_5(temperatureDisplayMode); + } + + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_6(keypadLockout); + } + + static void OnFailureCallback_7(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_7(error); + } + + static void OnSuccessCallback_7(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_7(keypadLockout); + } + + static void OnFailureCallback_8(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_8(error); + } + + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void OnSuccessCallback_9(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_9(keypadLockout); + } + + static void OnFailureCallback_10(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_10(error); + } + + static void OnSuccessCallback_10(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_10(keypadLockout); + } + + static void OnFailureCallback_11(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_11(error); + } + + static void OnSuccessCallback_11(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_11(scheduleProgrammingVisibility); + } + + static void OnFailureCallback_12(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_12(error); + } + + static void OnSuccessCallback_12(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_12(scheduleProgrammingVisibility); + } + + static void OnFailureCallback_13(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_13(error); + } + + static void OnSuccessCallback_13(void * context) { (static_cast(context))->OnSuccessResponse_13(); } + + static void OnFailureCallback_14(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_14(error); + } + + static void OnSuccessCallback_14(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_14(scheduleProgrammingVisibility); + } + + static void OnFailureCallback_15(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_15(error); + } + + static void OnSuccessCallback_15(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_15(scheduleProgrammingVisibility); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestWriteToTheMandatoryAttributeTemperatureDisplayMode_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t temperatureDisplayModeArgument; + temperatureDisplayModeArgument = 0; + + ReturnErrorOnFailure( + cluster.WriteAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( + temperatureDisplayModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_4(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( + this, OnSuccessCallback_5, OnFailureCallback_5, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_5(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_6(uint8_t keypadLockout) + { + VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_7() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_7(uint8_t keypadLockout) + { + VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestWriteToTheMandatoryAttributeKeypadLockout_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t keypadLockoutArgument; + keypadLockoutArgument = 0; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + keypadLockoutArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_8() { NextTest(); } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_9() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_9, OnFailureCallback_9, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_9(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_9(uint8_t keypadLockout) + { + VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_10() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_10, OnFailureCallback_10, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_10(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_10(uint8_t keypadLockout) + { + VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_11() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( + this, OnSuccessCallback_11, OnFailureCallback_11, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_11(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_11(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_12() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( + this, OnSuccessCallback_12, OnFailureCallback_12, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_12(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_12(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_13() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t scheduleProgrammingVisibilityArgument; + scheduleProgrammingVisibilityArgument = 0; + + ReturnErrorOnFailure( + cluster.WriteAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( + scheduleProgrammingVisibilityArgument, this, OnSuccessCallback_13, OnFailureCallback_13)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_13(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_13() { NextTest(); } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_14() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( + this, OnSuccessCallback_14, OnFailureCallback_14, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_14(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_14(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_15() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( + this, OnSuccessCallback_15, OnFailureCallback_15, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_15(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_15(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); + NextTest(); + } +}; + +class Test_TC_TSUIC_2_2Suite : public TestCommand +{ +public: + Test_TC_TSUIC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TSUIC_2_2", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_TSUIC_2_2Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Writes a value of 0 to TemperatureDisplayMode attribute of DUT\n"); + if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) + { + NextTest(); + return; + } + err = TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Writes a value of 1 to TemperatureDisplayMode attribute of DUT\n"); + if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) + { + NextTest(); + return; + } + err = TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Writes a value of 0 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Writes a value of 1 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Writes a value of 2 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Writes a value of 3 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Writes a value of 4 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Writes a value of 5 to KeypadLockout attribute of DUT\n"); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Writes a value of 0 to ScheduleProgrammingVisibility attribute of DUT\n"); + if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) + { + NextTest(); + return; + } + err = TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : Writes a value of 1 to ScheduleProgrammingVisibility attribute of DUT\n"); + if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) + { + NextTest(); + return; + } + err = TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_10(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_4(error); + } + + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + + static void OnFailureCallback_5(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_5(error); + } + + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + + static void OnFailureCallback_7(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_7(error); + } + + static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + + static void OnFailureCallback_8(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_8(error); + } + + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } + + static void OnFailureCallback_10(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_10(error); + } + + static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t temperatureDisplayModeArgument; + temperatureDisplayModeArgument = 0; + + ReturnErrorOnFailure( + cluster.WriteAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( + temperatureDisplayModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t temperatureDisplayModeArgument; + temperatureDisplayModeArgument = 1; + + ReturnErrorOnFailure( + cluster.WriteAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( + temperatureDisplayModeArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t keypadLockoutArgument; + keypadLockoutArgument = 0; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + keypadLockoutArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t keypadLockoutArgument; + keypadLockoutArgument = 1; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + keypadLockoutArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t keypadLockoutArgument; + keypadLockoutArgument = 2; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + keypadLockoutArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_5() { NextTest(); } + + CHIP_ERROR TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t keypadLockoutArgument; + keypadLockoutArgument = 3; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + keypadLockoutArgument, this, OnSuccessCallback_6, OnFailureCallback_6)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_6() { NextTest(); } + + CHIP_ERROR TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_7() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t keypadLockoutArgument; + keypadLockoutArgument = 4; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + keypadLockoutArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_7() { NextTest(); } + + CHIP_ERROR TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t keypadLockoutArgument; + keypadLockoutArgument = 5; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + keypadLockoutArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_8() { NextTest(); } + + CHIP_ERROR TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_9() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t scheduleProgrammingVisibilityArgument; + scheduleProgrammingVisibilityArgument = 0; + + ReturnErrorOnFailure( + cluster.WriteAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( + scheduleProgrammingVisibilityArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_9(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_9() { NextTest(); } + + CHIP_ERROR TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_10() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t scheduleProgrammingVisibilityArgument; + scheduleProgrammingVisibilityArgument = 1; + + ReturnErrorOnFailure( + cluster.WriteAttribute< + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( + scheduleProgrammingVisibilityArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_10(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_10() { NextTest(); } +}; + +class Test_TC_DIAG_TH_NW_1_1Suite : public TestCommand +{ +public: + Test_TC_DIAG_TH_NW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_TH_NW_1_1", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_DIAG_TH_NW_1_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_TH_NW_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_TH_NW_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } Wait(); @@ -44083,3520 +47090,4071 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the " - "value is within range\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) - { - NextTest(); - return; - } - err = TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Sends ResetCounts command\n"); + err = TestSendsResetCountsCommand_1(); break; case 2: - ChipLogProgress( - chipTool, - " ***** Test Step 2 : Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) - { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the Overruncount attribute\n"); + err = TestReadTheOverruncountAttribute_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint64_t overrunCount) + { + (static_cast(context))->OnSuccessResponse_2(overrunCount); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestSendsResetCountsCommand_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::ThreadNetworkDiagnostics::Commands::ResetCounts::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_1(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_1(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR TestReadTheOverruncountAttribute_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint64_t overrunCount) + { + VerifyOrReturn(CheckValue("overrunCount", overrunCount, 0ULL)); + + NextTest(); + } +}; + +class Test_TC_DIAG_TH_NW_1_2Suite : public TestCommand +{ +public: + Test_TC_DIAG_TH_NW_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_TH_NW_1_2", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_DIAG_TH_NW_1_2Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_TH_NW_1_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_TH_NW_1_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Validate constraints of attribute: Channel\n"); + err = TestValidateConstraintsOfAttributeChannel_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Validate constraints of attribute: NetworkName\n"); + err = TestValidateConstraintsOfAttributeNetworkName_2(); break; case 3: - ChipLogProgress( - chipTool, - " ***** Test Step 3 : Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) - { - NextTest(); - return; - } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Validate constraints of attribute: PanId\n"); + err = TestValidateConstraintsOfAttributePanId_3(); break; case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Validate constraints of attribute: ExtendedPanId\n"); + err = TestValidateConstraintsOfAttributeExtendedPanId_4(); break; case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Validate constraints of attribute: OverrunCount\n"); + err = TestValidateConstraintsOfAttributeOverrunCount_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the " - "value is within range\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) - { - NextTest(); - return; - } - err = TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : read PartitionId attribute value\n"); + err = TestReadPartitionIdAttributeValue_6(); break; case 7: - ChipLogProgress( - chipTool, - " ***** Test Step 7 : Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) - { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Validate constraints of attribute: PartitionId\n"); + err = TestValidateConstraintsOfAttributePartitionId_7(); break; case 8: - ChipLogProgress( - chipTool, - " ***** Test Step 8 : Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) - { - NextTest(); - return; - } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : read Weighting attribute value\n"); + err = TestReadWeightingAttributeValue_8(); break; case 9: - ChipLogProgress(chipTool, - " ***** Test Step 9 : Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Validate constraints of attribute: weighting\n"); + err = TestValidateConstraintsOfAttributeWeighting_9(); break; case 10: - ChipLogProgress( - chipTool, " ***** Test Step 10 : Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : read DataVersion attribute value\n"); + err = TestReadDataVersionAttributeValue_10(); break; case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the " - "value is within range\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Validate constraints of attribute: DataVersion\n"); + err = TestValidateConstraintsOfAttributeDataVersion_11(); break; case 12: - ChipLogProgress( - chipTool, - " ***** Test Step 12 : Writes a value back that is different but valid for MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : read StableDataVersion attribute value\n"); + err = TestReadStableDataVersionAttributeValue_12(); break; case 13: - ChipLogProgress( - chipTool, - " ***** Test Step 13 : Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Validate constraints of attribute: StableDataVersion\n"); + err = TestValidateConstraintsOfAttributeStableDataVersion_13(); break; case 14: - ChipLogProgress( - chipTool, " ***** Test Step 14 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : read LeaderRouterId attribute value\n"); + err = TestReadLeaderRouterIdAttributeValue_14(); break; case 15: - ChipLogProgress( - chipTool, " ***** Test Step 15 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Validate constraints of attribute: LeaderRouterId\n"); + err = TestValidateConstraintsOfAttributeLeaderRouterId_15(); break; case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the " - "value is within range\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : read DetachedRoleCount attribute value\n"); + err = TestReadDetachedRoleCountAttributeValue_16(); break; case 17: - ChipLogProgress( - chipTool, - " ***** Test Step 17 : Writes a value back that is different but valid for MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Validate constraints of attribute: DetachedRoleCount\n"); + err = TestValidateConstraintsOfAttributeDetachedRoleCount_17(); break; case 18: - ChipLogProgress( - chipTool, - " ***** Test Step 18 : Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : read ChildRoleCount attribute value\n"); + err = TestReadChildRoleCountAttributeValue_18(); break; case 19: - ChipLogProgress( - chipTool, " ***** Test Step 19 : Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19(); + ChipLogProgress(chipTool, " ***** Test Step 19 : Validate constraints of attribute: ChildRoleCount\n"); + err = TestValidateConstraintsOfAttributeChildRoleCount_19(); break; case 20: - ChipLogProgress( - chipTool, " ***** Test Step 20 : Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : read RouterRoleCount attribute value\n"); + err = TestReadRouterRoleCountAttributeValue_20(); break; case 21: - ChipLogProgress(chipTool, - " ***** Test Step 21 : Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the " - "value is within range\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21(); + ChipLogProgress(chipTool, " ***** Test Step 21 : Validate constraints of attribute: RouterRoleCount\n"); + err = TestValidateConstraintsOfAttributeRouterRoleCount_21(); break; case 22: - ChipLogProgress( - chipTool, - " ***** Test Step 22 : Writes a value back that is different but valid for MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : read LeaderRoleCount attribute value\n"); + err = TestReadLeaderRoleCountAttributeValue_22(); break; case 23: - ChipLogProgress( - chipTool, - " ***** Test Step 23 : Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23(); - break; - case 24: - ChipLogProgress( - chipTool, " ***** Test Step 24 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24(); - break; - case 25: - ChipLogProgress(chipTool, - " ***** Test Step 25 : Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25(); - break; - case 26: - ChipLogProgress(chipTool, - " ***** Test Step 26 : Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the " - "value is within range\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26(); + ChipLogProgress(chipTool, " ***** Test Step 23 : Validate constraints of attribute: LeaderRoleCount\n"); + err = TestValidateConstraintsOfAttributeLeaderRoleCount_23(); break; - case 27: - ChipLogProgress( - chipTool, - " ***** Test Step 27 : Writes a value back that is different but valid for MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27(); + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : read AttachAttemptCount attribute value\n"); + err = TestReadAttachAttemptCountAttributeValue_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Validate constraints of attribute: AttachAttemptCount\n"); + err = TestValidateConstraintsOfAttributeAttachAttemptCount_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : read PartitionIdChangeCount attribute value\n"); + err = TestReadPartitionIdChangeCountAttributeValue_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Validate constraints of attribute: PartitionIdChangeCount\n"); + err = TestValidateConstraintsOfAttributePartitionIdChangeCount_27(); break; case 28: - ChipLogProgress( - chipTool, - " ***** Test Step 28 : Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28(); + ChipLogProgress(chipTool, " ***** Test Step 28 : read BetterPartitionAttachAttemptCount attribute value\n"); + err = TestReadBetterPartitionAttachAttemptCountAttributeValue_28(); break; case 29: - ChipLogProgress( - chipTool, " ***** Test Step 29 : Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29(); + ChipLogProgress(chipTool, + " ***** Test Step 29 : Validate constraints of attribute: BetterPartitionAttachAttemptCount\n"); + err = TestValidateConstraintsOfAttributeBetterPartitionAttachAttemptCount_29(); break; case 30: - ChipLogProgress(chipTool, - " ***** Test Step 30 : Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30(); + ChipLogProgress(chipTool, " ***** Test Step 30 : read ParentChangeCount attribute value\n"); + err = TestReadParentChangeCountAttributeValue_30(); break; case 31: - ChipLogProgress( - chipTool, - " ***** Test Step 31 : Writes (sets back) the limit of MinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31(); + ChipLogProgress(chipTool, " ***** Test Step 31 : Validate constraints of attribute: ParentChangeCount\n"); + err = TestValidateConstraintsOfAttributeParentChangeCount_31(); break; case 32: - ChipLogProgress( - chipTool, - " ***** Test Step 32 : Writes (sets back) the limit of MaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32(); + ChipLogProgress(chipTool, " ***** Test Step 32 : read TxTotalCount attribute value\n"); + err = TestReadTxTotalCountAttributeValue_32(); break; case 33: - ChipLogProgress( - chipTool, - " ***** Test Step 33 : Writes (sets back) the limit of MinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33(); + ChipLogProgress(chipTool, " ***** Test Step 33 : Validate constraints of attribute: TxTotalCount\n"); + err = TestValidateConstraintsOfAttributeTxTotalCount_33(); break; case 34: - ChipLogProgress( - chipTool, - " ***** Test Step 34 : Writes (sets back) the limit of MaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34(); + ChipLogProgress(chipTool, " ***** Test Step 34 : read TxUnicastCount attribute value\n"); + err = TestReadTxUnicastCountAttributeValue_34(); break; case 35: - ChipLogProgress( - chipTool, - " ***** Test Step 35 : Writes (sets back) the limit of MinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35(); + ChipLogProgress(chipTool, " ***** Test Step 35 : Validate constraints of attribute: TxUnicastCount\n"); + err = TestValidateConstraintsOfAttributeTxUnicastCount_35(); break; case 36: - ChipLogProgress( - chipTool, - " ***** Test Step 36 : Writes (sets back) the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36(); + ChipLogProgress(chipTool, " ***** Test Step 36 : read TxBroadcastCount attribute value\n"); + err = TestReadTxBroadcastCountAttributeValue_36(); break; case 37: - ChipLogProgress( - chipTool, - " ***** Test Step 37 : Writes (sets back) the limit of MinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37(); + ChipLogProgress(chipTool, " ***** Test Step 37 : Validate constraints of attribute: TxBroadcastCount\n"); + err = TestValidateConstraintsOfAttributeTxBroadcastCount_37(); break; case 38: - ChipLogProgress( - chipTool, - " ***** Test Step 38 : Writes (sets back) the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) - { - NextTest(); - return; - } - err = TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38(); + ChipLogProgress(chipTool, " ***** Test Step 38 : read TxNoAckRequestedCount attribute value\n"); + err = TestReadTxNoAckRequestedCountAttributeValue_38(); break; case 39: - ChipLogProgress( - chipTool, - " ***** Test Step 39 : Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid\n"); - if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) - { - NextTest(); - return; - } - err = TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39(); + ChipLogProgress(chipTool, " ***** Test Step 39 : Validate constraints of attribute: TxNoAckRequestedCount\n"); + err = TestValidateConstraintsOfAttributeTxNoAckRequestedCount_39(); break; case 40: - ChipLogProgress( - chipTool, " ***** Test Step 40 : Write Attribute command for ControlSequenceOfOperation with a new valid value\n"); - if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) - { - NextTest(); - return; - } - err = TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40(); + ChipLogProgress(chipTool, " ***** Test Step 40 : read TxDataCount attribute value\n"); + err = TestReadTxDataCountAttributeValue_40(); break; case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read it back again to confirm the successful write\n"); - if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) - { - NextTest(); - return; - } - err = TestReadItBackAgainToConfirmTheSuccessfulWrite_41(); + ChipLogProgress(chipTool, " ***** Test Step 41 : Validate constraints of attribute: TxDataCount\n"); + err = TestValidateConstraintsOfAttributeTxDataCount_41(); break; case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) - { - NextTest(); - return; - } - err = TestSetsOccupiedHeatingSetpointToDefaultValue_42(); + ChipLogProgress(chipTool, " ***** Test Step 42 : read TxDataPollCount attribute value\n"); + err = TestReadTxDataPollCountAttributeValue_42(); break; case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) - { - NextTest(); - return; - } - err = TestSetsOccupiedHeatingSetpointToDefaultValue_43(); + ChipLogProgress(chipTool, " ***** Test Step 43 : Validate constraints of attribute: TxDataPollCount\n"); + err = TestValidateConstraintsOfAttributeTxDataPollCount_43(); break; case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) - { - NextTest(); - return; - } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_44(); + ChipLogProgress(chipTool, " ***** Test Step 44 : read TxBeaconCount attribute value\n"); + err = TestReadTxBeaconCountAttributeValue_44(); break; case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) - { - NextTest(); - return; - } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_45(); + ChipLogProgress(chipTool, " ***** Test Step 45 : Validate constraints of attribute: TxBeaconCount\n"); + err = TestValidateConstraintsOfAttributeTxBeaconCount_45(); break; case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) - { - NextTest(); - return; - } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_46(); + ChipLogProgress(chipTool, " ***** Test Step 46 : read TxBeaconRequestCount attribute value\n"); + err = TestReadTxBeaconRequestCountAttributeValue_46(); break; case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) - { - NextTest(); - return; - } - err = TestSetsOccupiedHeatingSetpointToDefaultValue_47(); + ChipLogProgress(chipTool, " ***** Test Step 47 : Validate constraints of attribute: TxBeaconRequestCount\n"); + err = TestValidateConstraintsOfAttributeTxBeaconRequestCount_47(); break; case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) - { - NextTest(); - return; - } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_48(); + ChipLogProgress(chipTool, " ***** Test Step 48 : read TxOtherCount attribute value\n"); + err = TestReadTxOtherCountAttributeValue_48(); break; case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Sets OccupiedHeatingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) - { - NextTest(); - return; - } - err = TestSetsOccupiedHeatingSetpointToDefaultValue_49(); + ChipLogProgress(chipTool, " ***** Test Step 49 : Validate constraints of attribute: TxOtherCount\n"); + err = TestValidateConstraintsOfAttributeTxOtherCount_49(); + break; + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : read TxRetryCount attribute value\n"); + err = TestReadTxRetryCountAttributeValue_50(); + break; + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : Validate constraints of attribute: TxRetryCount\n"); + err = TestValidateConstraintsOfAttributeTxRetryCount_51(); + break; + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : read TxDirectMaxRetryExpiryCount attribute value\n"); + err = TestReadTxDirectMaxRetryExpiryCountAttributeValue_52(); + break; + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Validate constraints of attribute: TxDirectMaxRetryExpiryCount\n"); + err = TestValidateConstraintsOfAttributeTxDirectMaxRetryExpiryCount_53(); + break; + case 54: + ChipLogProgress(chipTool, " ***** Test Step 54 : read TxIndirectMaxRetryExpiryCount attribute value\n"); + err = TestReadTxIndirectMaxRetryExpiryCountAttributeValue_54(); + break; + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Validate constraints of attribute: TxIndirectMaxRetryExpiryCount\n"); + err = TestValidateConstraintsOfAttributeTxIndirectMaxRetryExpiryCount_55(); + break; + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : read TxErrCcaCount attribute value\n"); + err = TestReadTxErrCcaCountAttributeValue_56(); + break; + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : Validate constraints of attribute: TxErrCcaCount\n"); + err = TestValidateConstraintsOfAttributeTxErrCcaCount_57(); + break; + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : read TxErrAbortCount attribute value\n"); + err = TestReadTxErrAbortCountAttributeValue_58(); + break; + case 59: + ChipLogProgress(chipTool, " ***** Test Step 59 : Validate constraints of attribute: TxErrAbortCount\n"); + err = TestValidateConstraintsOfAttributeTxErrAbortCount_59(); + break; + case 60: + ChipLogProgress(chipTool, " ***** Test Step 60 : read TxErrBusyChannelCount attribute value\n"); + err = TestReadTxErrBusyChannelCountAttributeValue_60(); + break; + case 61: + ChipLogProgress(chipTool, " ***** Test Step 61 : Validate constraints of attribute: TxErrBusyChannelCount\n"); + err = TestValidateConstraintsOfAttributeTxErrBusyChannelCount_61(); + break; + case 62: + ChipLogProgress(chipTool, " ***** Test Step 62 : read RxTotalCount attribute value\n"); + err = TestReadRxTotalCountAttributeValue_62(); + break; + case 63: + ChipLogProgress(chipTool, " ***** Test Step 63 : Validate constraints of attribute: RxTotalCount\n"); + err = TestValidateConstraintsOfAttributeRxTotalCount_63(); + break; + case 64: + ChipLogProgress(chipTool, " ***** Test Step 64 : read RxUnicastCount attribute value\n"); + err = TestReadRxUnicastCountAttributeValue_64(); + break; + case 65: + ChipLogProgress(chipTool, " ***** Test Step 65 : Validate constraints of attribute: RxUnicastCount\n"); + err = TestValidateConstraintsOfAttributeRxUnicastCount_65(); + break; + case 66: + ChipLogProgress(chipTool, " ***** Test Step 66 : read RxBroadcastCount attribute value\n"); + err = TestReadRxBroadcastCountAttributeValue_66(); + break; + case 67: + ChipLogProgress(chipTool, " ***** Test Step 67 : Validate constraints of attribute: RxBroadcastCount\n"); + err = TestValidateConstraintsOfAttributeRxBroadcastCount_67(); + break; + case 68: + ChipLogProgress(chipTool, " ***** Test Step 68 : read RxDataCount attribute value\n"); + err = TestReadRxDataCountAttributeValue_68(); + break; + case 69: + ChipLogProgress(chipTool, " ***** Test Step 69 : Validate constraints of attribute: RxDataCount\n"); + err = TestValidateConstraintsOfAttributeRxDataCount_69(); + break; + case 70: + ChipLogProgress(chipTool, " ***** Test Step 70 : read RxDataPollCount attribute value\n"); + err = TestReadRxDataPollCountAttributeValue_70(); + break; + case 71: + ChipLogProgress(chipTool, " ***** Test Step 71 : Validate constraints of attribute: RxDataPollCount\n"); + err = TestValidateConstraintsOfAttributeRxDataPollCount_71(); + break; + case 72: + ChipLogProgress(chipTool, " ***** Test Step 72 : read RxBeaconCount attribute value\n"); + err = TestReadRxBeaconCountAttributeValue_72(); + break; + case 73: + ChipLogProgress(chipTool, " ***** Test Step 73 : Validate constraints of attribute: RxBeaconCount\n"); + err = TestValidateConstraintsOfAttributeRxBeaconCount_73(); + break; + case 74: + ChipLogProgress(chipTool, " ***** Test Step 74 : read RxBeaconRequestCount attribute value\n"); + err = TestReadRxBeaconRequestCountAttributeValue_74(); + break; + case 75: + ChipLogProgress(chipTool, " ***** Test Step 75 : Validate constraints of attribute: RxBeaconRequestCount\n"); + err = TestValidateConstraintsOfAttributeRxBeaconRequestCount_75(); + break; + case 76: + ChipLogProgress(chipTool, " ***** Test Step 76 : read RxOtherCount attribute value\n"); + err = TestReadRxOtherCountAttributeValue_76(); + break; + case 77: + ChipLogProgress(chipTool, " ***** Test Step 77 : Validate constraints of attribute: RxOtherCount\n"); + err = TestValidateConstraintsOfAttributeRxOtherCount_77(); + break; + case 78: + ChipLogProgress(chipTool, " ***** Test Step 78 : read RxAddressFilteredCount attribute value\n"); + err = TestReadRxAddressFilteredCountAttributeValue_78(); + break; + case 79: + ChipLogProgress(chipTool, " ***** Test Step 79 : Validate constraints of attribute: RxAddressFilteredCount\n"); + err = TestValidateConstraintsOfAttributeRxAddressFilteredCount_79(); + break; + case 80: + ChipLogProgress(chipTool, " ***** Test Step 80 : read RxDestAddrFilteredCount attribute value\n"); + err = TestReadRxDestAddrFilteredCountAttributeValue_80(); + break; + case 81: + ChipLogProgress(chipTool, " ***** Test Step 81 : Validate constraints of attribute: RxDestAddrFilteredCount\n"); + err = TestValidateConstraintsOfAttributeRxDestAddrFilteredCount_81(); + break; + case 82: + ChipLogProgress(chipTool, " ***** Test Step 82 : read RxDuplicatedCount attribute value\n"); + err = TestReadRxDuplicatedCountAttributeValue_82(); + break; + case 83: + ChipLogProgress(chipTool, " ***** Test Step 83 : Validate constraints of attribute: RxDuplicatedCount\n"); + err = TestValidateConstraintsOfAttributeRxDuplicatedCount_83(); + break; + case 84: + ChipLogProgress(chipTool, " ***** Test Step 84 : read RxErrNoFrameCount attribute value\n"); + err = TestReadRxErrNoFrameCountAttributeValue_84(); + break; + case 85: + ChipLogProgress(chipTool, " ***** Test Step 85 : Validate constraints of attribute: RxErrNoFrameCount\n"); + err = TestValidateConstraintsOfAttributeRxErrNoFrameCount_85(); + break; + case 86: + ChipLogProgress(chipTool, " ***** Test Step 86 : read RxErrUnknownNeighborCount attribute value\n"); + err = TestReadRxErrUnknownNeighborCountAttributeValue_86(); + break; + case 87: + ChipLogProgress(chipTool, " ***** Test Step 87 : Validate constraints of attribute: RxErrUnknownNeighborCount\n"); + err = TestValidateConstraintsOfAttributeRxErrUnknownNeighborCount_87(); + break; + case 88: + ChipLogProgress(chipTool, " ***** Test Step 88 : read RxErrInvalidScrAddrCount attribute value\n"); + err = TestReadRxErrInvalidScrAddrCountAttributeValue_88(); + break; + case 89: + ChipLogProgress(chipTool, " ***** Test Step 89 : Validate constraints of attribute: RxErrInvalidSrcAddrCount\n"); + err = TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_89(); + break; + case 90: + ChipLogProgress(chipTool, " ***** Test Step 90 : read RxErrSecCount attribute value\n"); + err = TestReadRxErrSecCountAttributeValue_90(); + break; + case 91: + ChipLogProgress(chipTool, " ***** Test Step 91 : Validate constraints of attribute: RxErrInvalidSrcAddrCount\n"); + err = TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_91(); + break; + case 92: + ChipLogProgress(chipTool, " ***** Test Step 92 : read RxErrFcsCount attribute value\n"); + err = TestReadRxErrFcsCountAttributeValue_92(); + break; + case 93: + ChipLogProgress(chipTool, " ***** Test Step 93 : Validate constraints of attribute: RxErrFcsCount\n"); + err = TestValidateConstraintsOfAttributeRxErrFcsCount_93(); + break; + case 94: + ChipLogProgress(chipTool, " ***** Test Step 94 : read RxErrOtherCount attribute value\n"); + err = TestReadRxErrOtherCountAttributeValue_94(); + break; + case 95: + ChipLogProgress(chipTool, " ***** Test Step 95 : Validate constraints of attribute: RxErrOtherCount\n"); + err = TestValidateConstraintsOfAttributeRxErrOtherCount_95(); + break; + case 96: + ChipLogProgress(chipTool, " ***** Test Step 96 : read ActiveTimestamp attribute value\n"); + err = TestReadActiveTimestampAttributeValue_96(); + break; + case 97: + ChipLogProgress(chipTool, " ***** Test Step 97 : Validate constraints of attribute: ActiveTimestamp\n"); + err = TestValidateConstraintsOfAttributeActiveTimestamp_97(); + break; + case 98: + ChipLogProgress(chipTool, " ***** Test Step 98 : read PendingTimestamp attribute value\n"); + err = TestReadPendingTimestampAttributeValue_98(); + break; + case 99: + ChipLogProgress(chipTool, " ***** Test Step 99 : Validate constraints of attribute: PendingTimestamp\n"); + err = TestValidateConstraintsOfAttributePendingTimestamp_99(); + break; + case 100: + ChipLogProgress(chipTool, " ***** Test Step 100 : read Delay attribute value\n"); + err = TestReadDelayAttributeValue_100(); + break; + case 101: + ChipLogProgress(chipTool, " ***** Test Step 101 : Validate constraints of attribute: delay\n"); + err = TestValidateConstraintsOfAttributeDelay_101(); break; } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 102; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t channel) + { + (static_cast(context))->OnSuccessResponse_1(channel); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, chip::CharSpan networkName) + { + (static_cast(context))->OnSuccessResponse_2(networkName); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, uint16_t panId) + { + (static_cast(context))->OnSuccessResponse_3(panId); + } + + static void OnFailureCallback_4(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_4(error); + } + + static void OnSuccessCallback_4(void * context, uint64_t extendedPanId) + { + (static_cast(context))->OnSuccessResponse_4(extendedPanId); + } + + static void OnFailureCallback_5(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_5(error); + } + + static void OnSuccessCallback_5(void * context, uint64_t overrunCount) + { + (static_cast(context))->OnSuccessResponse_5(overrunCount); + } + + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context, uint32_t partitionId) + { + (static_cast(context))->OnSuccessResponse_6(partitionId); + } + + static void OnFailureCallback_7(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_7(error); + } + + static void OnSuccessCallback_7(void * context, uint32_t partitionId) + { + (static_cast(context))->OnSuccessResponse_7(partitionId); + } + + static void OnFailureCallback_8(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_8(error); + } + + static void OnSuccessCallback_8(void * context, uint8_t weighting) + { + (static_cast(context))->OnSuccessResponse_8(weighting); + } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void OnSuccessCallback_9(void * context, uint8_t weighting) + { + (static_cast(context))->OnSuccessResponse_9(weighting); + } + + static void OnFailureCallback_10(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_10(error); + } + + static void OnSuccessCallback_10(void * context, uint8_t dataVersion) + { + (static_cast(context))->OnSuccessResponse_10(dataVersion); + } + + static void OnFailureCallback_11(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_11(error); + } + + static void OnSuccessCallback_11(void * context, uint8_t dataVersion) + { + (static_cast(context))->OnSuccessResponse_11(dataVersion); + } + + static void OnFailureCallback_12(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_12(error); + } + + static void OnSuccessCallback_12(void * context, uint8_t stableDataVersion) + { + (static_cast(context))->OnSuccessResponse_12(stableDataVersion); + } + + static void OnFailureCallback_13(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_13(error); + } + + static void OnSuccessCallback_13(void * context, uint8_t stableDataVersion) + { + (static_cast(context))->OnSuccessResponse_13(stableDataVersion); + } + + static void OnFailureCallback_14(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_14(error); + } + + static void OnSuccessCallback_14(void * context, uint8_t leaderRouterId) + { + (static_cast(context))->OnSuccessResponse_14(leaderRouterId); + } + + static void OnFailureCallback_15(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_15(error); + } + + static void OnSuccessCallback_15(void * context, uint8_t leaderRouterId) + { + (static_cast(context))->OnSuccessResponse_15(leaderRouterId); + } + + static void OnFailureCallback_16(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_16(error); + } + + static void OnSuccessCallback_16(void * context, uint16_t detachedRoleCount) + { + (static_cast(context))->OnSuccessResponse_16(detachedRoleCount); + } + + static void OnFailureCallback_17(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_17(error); + } + + static void OnSuccessCallback_17(void * context, uint16_t detachedRoleCount) + { + (static_cast(context))->OnSuccessResponse_17(detachedRoleCount); + } + + static void OnFailureCallback_18(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_18(error); + } + + static void OnSuccessCallback_18(void * context, uint16_t childRoleCount) + { + (static_cast(context))->OnSuccessResponse_18(childRoleCount); + } + + static void OnFailureCallback_19(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_19(error); + } + + static void OnSuccessCallback_19(void * context, uint16_t childRoleCount) + { + (static_cast(context))->OnSuccessResponse_19(childRoleCount); + } + + static void OnFailureCallback_20(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_20(error); + } + + static void OnSuccessCallback_20(void * context, uint16_t routerRoleCount) + { + (static_cast(context))->OnSuccessResponse_20(routerRoleCount); + } + + static void OnFailureCallback_21(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_21(error); + } + + static void OnSuccessCallback_21(void * context, uint16_t routerRoleCount) + { + (static_cast(context))->OnSuccessResponse_21(routerRoleCount); + } + + static void OnFailureCallback_22(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_22(error); + } + + static void OnSuccessCallback_22(void * context, uint16_t leaderRoleCount) + { + (static_cast(context))->OnSuccessResponse_22(leaderRoleCount); + } + + static void OnFailureCallback_23(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_23(error); + } + + static void OnSuccessCallback_23(void * context, uint16_t leaderRoleCount) + { + (static_cast(context))->OnSuccessResponse_23(leaderRoleCount); + } + + static void OnFailureCallback_24(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_24(error); + } + + static void OnSuccessCallback_24(void * context, uint16_t attachAttemptCount) + { + (static_cast(context))->OnSuccessResponse_24(attachAttemptCount); + } + + static void OnFailureCallback_25(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_25(error); + } + + static void OnSuccessCallback_25(void * context, uint16_t attachAttemptCount) + { + (static_cast(context))->OnSuccessResponse_25(attachAttemptCount); + } + + static void OnFailureCallback_26(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_26(error); + } + + static void OnSuccessCallback_26(void * context, uint16_t partitionIdChangeCount) + { + (static_cast(context))->OnSuccessResponse_26(partitionIdChangeCount); + } + + static void OnFailureCallback_27(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_27(error); + } + + static void OnSuccessCallback_27(void * context, uint16_t partitionIdChangeCount) + { + (static_cast(context))->OnSuccessResponse_27(partitionIdChangeCount); + } + + static void OnFailureCallback_28(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_28(error); + } + + static void OnSuccessCallback_28(void * context, uint16_t betterPartitionAttachAttemptCount) + { + (static_cast(context))->OnSuccessResponse_28(betterPartitionAttachAttemptCount); + } + + static void OnFailureCallback_29(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_29(error); + } + + static void OnSuccessCallback_29(void * context, uint16_t betterPartitionAttachAttemptCount) + { + (static_cast(context))->OnSuccessResponse_29(betterPartitionAttachAttemptCount); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 50; + static void OnFailureCallback_30(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_30(error); + } - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; + static void OnSuccessCallback_30(void * context, uint16_t parentChangeCount) + { + (static_cast(context))->OnSuccessResponse_30(parentChangeCount); + } - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + static void OnFailureCallback_31(void * context, CHIP_ERROR error) { - bool isExpectedDnssdResult = false; + (static_cast(context))->OnFailureResponse_31(error); + } - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + static void OnSuccessCallback_31(void * context, uint16_t parentChangeCount) + { + (static_cast(context))->OnSuccessResponse_31(parentChangeCount); } - static void OnFailureCallback_1(void * context, CHIP_ERROR error) + static void OnFailureCallback_32(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_32(error); } - static void OnSuccessCallback_1(void * context, int16_t occupiedCoolingSetpoint) + static void OnSuccessCallback_32(void * context, uint32_t txTotalCount) { - (static_cast(context))->OnSuccessResponse_1(occupiedCoolingSetpoint); + (static_cast(context))->OnSuccessResponse_32(txTotalCount); } - static void OnFailureCallback_2(void * context, CHIP_ERROR error) + static void OnFailureCallback_33(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_33(error); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_33(void * context, uint32_t txTotalCount) + { + (static_cast(context))->OnSuccessResponse_33(txTotalCount); + } - static void OnFailureCallback_3(void * context, CHIP_ERROR error) + static void OnFailureCallback_34(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_34(error); } - static void OnSuccessCallback_3(void * context, int16_t occupiedCoolingSetpoint) + static void OnSuccessCallback_34(void * context, uint32_t txUnicastCount) { - (static_cast(context))->OnSuccessResponse_3(occupiedCoolingSetpoint); + (static_cast(context))->OnSuccessResponse_34(txUnicastCount); } - static void OnFailureCallback_4(void * context, CHIP_ERROR error) + static void OnFailureCallback_35(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_4(error); + (static_cast(context))->OnFailureResponse_35(error); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + static void OnSuccessCallback_35(void * context, uint32_t txUnicastCount) + { + (static_cast(context))->OnSuccessResponse_35(txUnicastCount); + } - static void OnFailureCallback_5(void * context, CHIP_ERROR error) + static void OnFailureCallback_36(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_5(error); + (static_cast(context))->OnFailureResponse_36(error); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + static void OnSuccessCallback_36(void * context, uint32_t txBroadcastCount) + { + (static_cast(context))->OnSuccessResponse_36(txBroadcastCount); + } - static void OnFailureCallback_6(void * context, CHIP_ERROR error) + static void OnFailureCallback_37(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_6(error); + (static_cast(context))->OnFailureResponse_37(error); } - static void OnSuccessCallback_6(void * context, int16_t occupiedHeatingSetpoint) + static void OnSuccessCallback_37(void * context, uint32_t txBroadcastCount) { - (static_cast(context))->OnSuccessResponse_6(occupiedHeatingSetpoint); + (static_cast(context))->OnSuccessResponse_37(txBroadcastCount); } - static void OnFailureCallback_7(void * context, CHIP_ERROR error) + static void OnFailureCallback_38(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_7(error); + (static_cast(context))->OnFailureResponse_38(error); } - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + static void OnSuccessCallback_38(void * context, uint32_t txNoAckRequestedCount) + { + (static_cast(context))->OnSuccessResponse_38(txNoAckRequestedCount); + } - static void OnFailureCallback_8(void * context, CHIP_ERROR error) + static void OnFailureCallback_39(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_8(error); + (static_cast(context))->OnFailureResponse_39(error); } - static void OnSuccessCallback_8(void * context, int16_t occupiedHeatingSetpoint) + static void OnSuccessCallback_39(void * context, uint32_t txNoAckRequestedCount) { - (static_cast(context))->OnSuccessResponse_8(occupiedHeatingSetpoint); + (static_cast(context))->OnSuccessResponse_39(txNoAckRequestedCount); } - static void OnFailureCallback_9(void * context, CHIP_ERROR error) + static void OnFailureCallback_40(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_9(error); + (static_cast(context))->OnFailureResponse_40(error); } - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } + static void OnSuccessCallback_40(void * context, uint32_t txDataCount) + { + (static_cast(context))->OnSuccessResponse_40(txDataCount); + } - static void OnFailureCallback_10(void * context, CHIP_ERROR error) + static void OnFailureCallback_41(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_10(error); + (static_cast(context))->OnFailureResponse_41(error); } - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + static void OnSuccessCallback_41(void * context, uint32_t txDataCount) + { + (static_cast(context))->OnSuccessResponse_41(txDataCount); + } - static void OnFailureCallback_11(void * context, CHIP_ERROR error) + static void OnFailureCallback_42(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_11(error); + (static_cast(context))->OnFailureResponse_42(error); } - static void OnSuccessCallback_11(void * context, int16_t minHeatSetpointLimit) + static void OnSuccessCallback_42(void * context, uint32_t txDataPollCount) { - (static_cast(context))->OnSuccessResponse_11(minHeatSetpointLimit); + (static_cast(context))->OnSuccessResponse_42(txDataPollCount); } - static void OnFailureCallback_12(void * context, CHIP_ERROR error) + static void OnFailureCallback_43(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_12(error); + (static_cast(context))->OnFailureResponse_43(error); } - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } + static void OnSuccessCallback_43(void * context, uint32_t txDataPollCount) + { + (static_cast(context))->OnSuccessResponse_43(txDataPollCount); + } - static void OnFailureCallback_13(void * context, CHIP_ERROR error) + static void OnFailureCallback_44(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_13(error); + (static_cast(context))->OnFailureResponse_44(error); } - static void OnSuccessCallback_13(void * context, int16_t minHeatSetpointLimit) + static void OnSuccessCallback_44(void * context, uint32_t txBeaconCount) { - (static_cast(context))->OnSuccessResponse_13(minHeatSetpointLimit); + (static_cast(context))->OnSuccessResponse_44(txBeaconCount); } - static void OnFailureCallback_14(void * context, CHIP_ERROR error) + static void OnFailureCallback_45(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_14(error); + (static_cast(context))->OnFailureResponse_45(error); } - static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } + static void OnSuccessCallback_45(void * context, uint32_t txBeaconCount) + { + (static_cast(context))->OnSuccessResponse_45(txBeaconCount); + } - static void OnFailureCallback_15(void * context, CHIP_ERROR error) + static void OnFailureCallback_46(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_15(error); + (static_cast(context))->OnFailureResponse_46(error); } - static void OnSuccessCallback_15(void * context) { (static_cast(context))->OnSuccessResponse_15(); } + static void OnSuccessCallback_46(void * context, uint32_t txBeaconRequestCount) + { + (static_cast(context))->OnSuccessResponse_46(txBeaconRequestCount); + } - static void OnFailureCallback_16(void * context, CHIP_ERROR error) + static void OnFailureCallback_47(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_16(error); + (static_cast(context))->OnFailureResponse_47(error); } - static void OnSuccessCallback_16(void * context, int16_t maxHeatSetpointLimit) + static void OnSuccessCallback_47(void * context, uint32_t txBeaconRequestCount) { - (static_cast(context))->OnSuccessResponse_16(maxHeatSetpointLimit); + (static_cast(context))->OnSuccessResponse_47(txBeaconRequestCount); } - static void OnFailureCallback_17(void * context, CHIP_ERROR error) + static void OnFailureCallback_48(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_17(error); + (static_cast(context))->OnFailureResponse_48(error); } - static void OnSuccessCallback_17(void * context) { (static_cast(context))->OnSuccessResponse_17(); } + static void OnSuccessCallback_48(void * context, uint32_t txOtherCount) + { + (static_cast(context))->OnSuccessResponse_48(txOtherCount); + } - static void OnFailureCallback_18(void * context, CHIP_ERROR error) + static void OnFailureCallback_49(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_18(error); + (static_cast(context))->OnFailureResponse_49(error); } - static void OnSuccessCallback_18(void * context, int16_t maxHeatSetpointLimit) + static void OnSuccessCallback_49(void * context, uint32_t txOtherCount) { - (static_cast(context))->OnSuccessResponse_18(maxHeatSetpointLimit); + (static_cast(context))->OnSuccessResponse_49(txOtherCount); } - static void OnFailureCallback_19(void * context, CHIP_ERROR error) + static void OnFailureCallback_50(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_19(error); + (static_cast(context))->OnFailureResponse_50(error); } - static void OnSuccessCallback_19(void * context) { (static_cast(context))->OnSuccessResponse_19(); } + static void OnSuccessCallback_50(void * context, uint32_t txRetryCount) + { + (static_cast(context))->OnSuccessResponse_50(txRetryCount); + } - static void OnFailureCallback_20(void * context, CHIP_ERROR error) + static void OnFailureCallback_51(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_20(error); + (static_cast(context))->OnFailureResponse_51(error); } - static void OnSuccessCallback_20(void * context) { (static_cast(context))->OnSuccessResponse_20(); } + static void OnSuccessCallback_51(void * context, uint32_t txRetryCount) + { + (static_cast(context))->OnSuccessResponse_51(txRetryCount); + } - static void OnFailureCallback_21(void * context, CHIP_ERROR error) + static void OnFailureCallback_52(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_21(error); + (static_cast(context))->OnFailureResponse_52(error); } - static void OnSuccessCallback_21(void * context, int16_t minCoolSetpointLimit) + static void OnSuccessCallback_52(void * context, uint32_t txDirectMaxRetryExpiryCount) { - (static_cast(context))->OnSuccessResponse_21(minCoolSetpointLimit); + (static_cast(context))->OnSuccessResponse_52(txDirectMaxRetryExpiryCount); } - static void OnFailureCallback_22(void * context, CHIP_ERROR error) + static void OnFailureCallback_53(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_22(error); + (static_cast(context))->OnFailureResponse_53(error); } - static void OnSuccessCallback_22(void * context) { (static_cast(context))->OnSuccessResponse_22(); } + static void OnSuccessCallback_53(void * context, uint32_t txDirectMaxRetryExpiryCount) + { + (static_cast(context))->OnSuccessResponse_53(txDirectMaxRetryExpiryCount); + } - static void OnFailureCallback_23(void * context, CHIP_ERROR error) + static void OnFailureCallback_54(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_23(error); + (static_cast(context))->OnFailureResponse_54(error); } - static void OnSuccessCallback_23(void * context, int16_t minCoolSetpointLimit) + static void OnSuccessCallback_54(void * context, uint32_t txIndirectMaxRetryExpiryCount) { - (static_cast(context))->OnSuccessResponse_23(minCoolSetpointLimit); + (static_cast(context))->OnSuccessResponse_54(txIndirectMaxRetryExpiryCount); } - static void OnFailureCallback_24(void * context, CHIP_ERROR error) + static void OnFailureCallback_55(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_24(error); + (static_cast(context))->OnFailureResponse_55(error); } - static void OnSuccessCallback_24(void * context) { (static_cast(context))->OnSuccessResponse_24(); } + static void OnSuccessCallback_55(void * context, uint32_t txIndirectMaxRetryExpiryCount) + { + (static_cast(context))->OnSuccessResponse_55(txIndirectMaxRetryExpiryCount); + } - static void OnFailureCallback_25(void * context, CHIP_ERROR error) + static void OnFailureCallback_56(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_25(error); + (static_cast(context))->OnFailureResponse_56(error); } - static void OnSuccessCallback_25(void * context) { (static_cast(context))->OnSuccessResponse_25(); } + static void OnSuccessCallback_56(void * context, uint32_t txErrCcaCount) + { + (static_cast(context))->OnSuccessResponse_56(txErrCcaCount); + } - static void OnFailureCallback_26(void * context, CHIP_ERROR error) + static void OnFailureCallback_57(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_26(error); + (static_cast(context))->OnFailureResponse_57(error); } - static void OnSuccessCallback_26(void * context, int16_t maxCoolSetpointLimit) + static void OnSuccessCallback_57(void * context, uint32_t txErrCcaCount) { - (static_cast(context))->OnSuccessResponse_26(maxCoolSetpointLimit); + (static_cast(context))->OnSuccessResponse_57(txErrCcaCount); } - static void OnFailureCallback_27(void * context, CHIP_ERROR error) + static void OnFailureCallback_58(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_27(error); + (static_cast(context))->OnFailureResponse_58(error); } - static void OnSuccessCallback_27(void * context) { (static_cast(context))->OnSuccessResponse_27(); } + static void OnSuccessCallback_58(void * context, uint32_t txErrAbortCount) + { + (static_cast(context))->OnSuccessResponse_58(txErrAbortCount); + } - static void OnFailureCallback_28(void * context, CHIP_ERROR error) + static void OnFailureCallback_59(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_28(error); + (static_cast(context))->OnFailureResponse_59(error); } - static void OnSuccessCallback_28(void * context, int16_t maxCoolSetpointLimit) + static void OnSuccessCallback_59(void * context, uint32_t txErrAbortCount) { - (static_cast(context))->OnSuccessResponse_28(maxCoolSetpointLimit); + (static_cast(context))->OnSuccessResponse_59(txErrAbortCount); } - static void OnFailureCallback_29(void * context, CHIP_ERROR error) + static void OnFailureCallback_60(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_29(error); + (static_cast(context))->OnFailureResponse_60(error); } - static void OnSuccessCallback_29(void * context) { (static_cast(context))->OnSuccessResponse_29(); } + static void OnSuccessCallback_60(void * context, uint32_t txErrBusyChannelCount) + { + (static_cast(context))->OnSuccessResponse_60(txErrBusyChannelCount); + } - static void OnFailureCallback_30(void * context, CHIP_ERROR error) + static void OnFailureCallback_61(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_30(error); + (static_cast(context))->OnFailureResponse_61(error); } - static void OnSuccessCallback_30(void * context) { (static_cast(context))->OnSuccessResponse_30(); } + static void OnSuccessCallback_61(void * context, uint32_t txErrBusyChannelCount) + { + (static_cast(context))->OnSuccessResponse_61(txErrBusyChannelCount); + } - static void OnFailureCallback_31(void * context, CHIP_ERROR error) + static void OnFailureCallback_62(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_31(error); + (static_cast(context))->OnFailureResponse_62(error); } - static void OnSuccessCallback_31(void * context) { (static_cast(context))->OnSuccessResponse_31(); } + static void OnSuccessCallback_62(void * context, uint32_t rxTotalCount) + { + (static_cast(context))->OnSuccessResponse_62(rxTotalCount); + } - static void OnFailureCallback_32(void * context, CHIP_ERROR error) + static void OnFailureCallback_63(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_32(error); + (static_cast(context))->OnFailureResponse_63(error); } - static void OnSuccessCallback_32(void * context) { (static_cast(context))->OnSuccessResponse_32(); } + static void OnSuccessCallback_63(void * context, uint32_t rxTotalCount) + { + (static_cast(context))->OnSuccessResponse_63(rxTotalCount); + } - static void OnFailureCallback_33(void * context, CHIP_ERROR error) + static void OnFailureCallback_64(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_33(error); + (static_cast(context))->OnFailureResponse_64(error); } - static void OnSuccessCallback_33(void * context) { (static_cast(context))->OnSuccessResponse_33(); } + static void OnSuccessCallback_64(void * context, uint32_t rxUnicastCount) + { + (static_cast(context))->OnSuccessResponse_64(rxUnicastCount); + } - static void OnFailureCallback_34(void * context, CHIP_ERROR error) + static void OnFailureCallback_65(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_34(error); + (static_cast(context))->OnFailureResponse_65(error); } - static void OnSuccessCallback_34(void * context) { (static_cast(context))->OnSuccessResponse_34(); } + static void OnSuccessCallback_65(void * context, uint32_t rxUnicastCount) + { + (static_cast(context))->OnSuccessResponse_65(rxUnicastCount); + } - static void OnFailureCallback_35(void * context, CHIP_ERROR error) + static void OnFailureCallback_66(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_35(error); + (static_cast(context))->OnFailureResponse_66(error); } - static void OnSuccessCallback_35(void * context) { (static_cast(context))->OnSuccessResponse_35(); } + static void OnSuccessCallback_66(void * context, uint32_t rxBroadcastCount) + { + (static_cast(context))->OnSuccessResponse_66(rxBroadcastCount); + } - static void OnFailureCallback_36(void * context, CHIP_ERROR error) + static void OnFailureCallback_67(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_36(error); + (static_cast(context))->OnFailureResponse_67(error); } - static void OnSuccessCallback_36(void * context) { (static_cast(context))->OnSuccessResponse_36(); } + static void OnSuccessCallback_67(void * context, uint32_t rxBroadcastCount) + { + (static_cast(context))->OnSuccessResponse_67(rxBroadcastCount); + } - static void OnFailureCallback_37(void * context, CHIP_ERROR error) + static void OnFailureCallback_68(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_37(error); + (static_cast(context))->OnFailureResponse_68(error); } - static void OnSuccessCallback_37(void * context) { (static_cast(context))->OnSuccessResponse_37(); } + static void OnSuccessCallback_68(void * context, uint32_t rxDataCount) + { + (static_cast(context))->OnSuccessResponse_68(rxDataCount); + } - static void OnFailureCallback_38(void * context, CHIP_ERROR error) + static void OnFailureCallback_69(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_38(error); + (static_cast(context))->OnFailureResponse_69(error); } - static void OnSuccessCallback_38(void * context) { (static_cast(context))->OnSuccessResponse_38(); } + static void OnSuccessCallback_69(void * context, uint32_t rxDataCount) + { + (static_cast(context))->OnSuccessResponse_69(rxDataCount); + } - static void OnFailureCallback_39(void * context, CHIP_ERROR error) + static void OnFailureCallback_70(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_39(error); + (static_cast(context))->OnFailureResponse_70(error); } - static void OnSuccessCallback_39(void * context, - chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + static void OnSuccessCallback_70(void * context, uint32_t rxDataPollCount) { - (static_cast(context))->OnSuccessResponse_39(controlSequenceOfOperation); + (static_cast(context))->OnSuccessResponse_70(rxDataPollCount); } - static void OnFailureCallback_40(void * context, CHIP_ERROR error) + static void OnFailureCallback_71(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_40(error); + (static_cast(context))->OnFailureResponse_71(error); } - static void OnSuccessCallback_40(void * context) { (static_cast(context))->OnSuccessResponse_40(); } + static void OnSuccessCallback_71(void * context, uint32_t rxDataPollCount) + { + (static_cast(context))->OnSuccessResponse_71(rxDataPollCount); + } - static void OnFailureCallback_41(void * context, CHIP_ERROR error) + static void OnFailureCallback_72(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_41(error); + (static_cast(context))->OnFailureResponse_72(error); } - static void OnSuccessCallback_41(void * context, - chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + static void OnSuccessCallback_72(void * context, uint32_t rxBeaconCount) { - (static_cast(context))->OnSuccessResponse_41(controlSequenceOfOperation); + (static_cast(context))->OnSuccessResponse_72(rxBeaconCount); } - static void OnFailureCallback_42(void * context, CHIP_ERROR error) + static void OnFailureCallback_73(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_42(error); + (static_cast(context))->OnFailureResponse_73(error); } - static void OnSuccessCallback_42(void * context) { (static_cast(context))->OnSuccessResponse_42(); } + static void OnSuccessCallback_73(void * context, uint32_t rxBeaconCount) + { + (static_cast(context))->OnSuccessResponse_73(rxBeaconCount); + } - static void OnFailureCallback_43(void * context, CHIP_ERROR error) + static void OnFailureCallback_74(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_43(error); + (static_cast(context))->OnFailureResponse_74(error); } - static void OnSuccessCallback_43(void * context) { (static_cast(context))->OnSuccessResponse_43(); } + static void OnSuccessCallback_74(void * context, uint32_t rxBeaconRequestCount) + { + (static_cast(context))->OnSuccessResponse_74(rxBeaconRequestCount); + } - static void OnFailureCallback_44(void * context, CHIP_ERROR error) + static void OnFailureCallback_75(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_44(error); + (static_cast(context))->OnFailureResponse_75(error); } - static void OnSuccessCallback_44(void * context) { (static_cast(context))->OnSuccessResponse_44(); } + static void OnSuccessCallback_75(void * context, uint32_t rxBeaconRequestCount) + { + (static_cast(context))->OnSuccessResponse_75(rxBeaconRequestCount); + } - static void OnFailureCallback_45(void * context, CHIP_ERROR error) + static void OnFailureCallback_76(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_45(error); + (static_cast(context))->OnFailureResponse_76(error); } - static void OnSuccessCallback_45(void * context) { (static_cast(context))->OnSuccessResponse_45(); } + static void OnSuccessCallback_76(void * context, uint32_t rxOtherCount) + { + (static_cast(context))->OnSuccessResponse_76(rxOtherCount); + } - static void OnFailureCallback_46(void * context, CHIP_ERROR error) + static void OnFailureCallback_77(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_46(error); + (static_cast(context))->OnFailureResponse_77(error); } - static void OnSuccessCallback_46(void * context) { (static_cast(context))->OnSuccessResponse_46(); } + static void OnSuccessCallback_77(void * context, uint32_t rxOtherCount) + { + (static_cast(context))->OnSuccessResponse_77(rxOtherCount); + } - static void OnFailureCallback_47(void * context, CHIP_ERROR error) + static void OnFailureCallback_78(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_47(error); + (static_cast(context))->OnFailureResponse_78(error); } - static void OnSuccessCallback_47(void * context) { (static_cast(context))->OnSuccessResponse_47(); } + static void OnSuccessCallback_78(void * context, uint32_t rxAddressFilteredCount) + { + (static_cast(context))->OnSuccessResponse_78(rxAddressFilteredCount); + } - static void OnFailureCallback_48(void * context, CHIP_ERROR error) + static void OnFailureCallback_79(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_48(error); + (static_cast(context))->OnFailureResponse_79(error); } - static void OnSuccessCallback_48(void * context) { (static_cast(context))->OnSuccessResponse_48(); } + static void OnSuccessCallback_79(void * context, uint32_t rxAddressFilteredCount) + { + (static_cast(context))->OnSuccessResponse_79(rxAddressFilteredCount); + } - static void OnFailureCallback_49(void * context, CHIP_ERROR error) + static void OnFailureCallback_80(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_49(error); + (static_cast(context))->OnFailureResponse_80(error); } - static void OnSuccessCallback_49(void * context) { (static_cast(context))->OnSuccessResponse_49(); } + static void OnSuccessCallback_80(void * context, uint32_t rxDestAddrFilteredCount) + { + (static_cast(context))->OnSuccessResponse_80(rxDestAddrFilteredCount); + } - // - // Tests methods - // + static void OnFailureCallback_81(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_81(error); + } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + static void OnSuccessCallback_81(void * context, uint32_t rxDestAddrFilteredCount) { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + (static_cast(context))->OnSuccessResponse_81(rxDestAddrFilteredCount); } - CHIP_ERROR TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1() + static void OnFailureCallback_82(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_82(error); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_82(void * context, uint32_t rxDuplicatedCount) + { + (static_cast(context))->OnSuccessResponse_82(rxDuplicatedCount); } - void OnFailureResponse_1(CHIP_ERROR error) + static void OnFailureCallback_83(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_83(error); } - void OnSuccessResponse_1(int16_t occupiedCoolingSetpoint) + static void OnSuccessCallback_83(void * context, uint32_t rxDuplicatedCount) { - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); - VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); - NextTest(); + (static_cast(context))->OnSuccessResponse_83(rxDuplicatedCount); } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2() + static void OnFailureCallback_84(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_84(error); + } - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2000; + static void OnSuccessCallback_84(void * context, uint32_t rxErrNoFrameCount) + { + (static_cast(context))->OnSuccessResponse_84(rxErrNoFrameCount); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; + static void OnFailureCallback_85(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_85(error); } - void OnFailureResponse_2(CHIP_ERROR error) + static void OnSuccessCallback_85(void * context, uint32_t rxErrNoFrameCount) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_85(rxErrNoFrameCount); } - void OnSuccessResponse_2() { NextTest(); } + static void OnFailureCallback_86(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_86(error); + } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3() + static void OnSuccessCallback_86(void * context, uint32_t rxErrUnknownNeighborCount) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_86(rxErrUnknownNeighborCount); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3, true)); - return CHIP_NO_ERROR; + static void OnFailureCallback_87(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_87(error); } - void OnFailureResponse_3(CHIP_ERROR error) + static void OnSuccessCallback_87(void * context, uint32_t rxErrUnknownNeighborCount) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_87(rxErrUnknownNeighborCount); } - void OnSuccessResponse_3(int16_t occupiedCoolingSetpoint) + static void OnFailureCallback_88(void * context, CHIP_ERROR error) { - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2000)); + (static_cast(context))->OnFailureResponse_88(error); + } - NextTest(); + static void OnSuccessCallback_88(void * context, uint32_t rxErrInvalidSrcAddrCount) + { + (static_cast(context))->OnSuccessResponse_88(rxErrInvalidSrcAddrCount); } - CHIP_ERROR TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4() + static void OnFailureCallback_89(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_89(error); + } - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 1600; + static void OnSuccessCallback_89(void * context, uint32_t rxErrInvalidSrcAddrCount) + { + (static_cast(context))->OnSuccessResponse_89(rxErrInvalidSrcAddrCount); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; + static void OnFailureCallback_90(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_90(error); } - void OnFailureResponse_4(CHIP_ERROR error) + static void OnSuccessCallback_90(void * context, uint32_t rxErrSecCount) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnSuccessResponse_90(rxErrSecCount); } - void OnSuccessResponse_4() { NextTest(); } + static void OnFailureCallback_91(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_91(error); + } - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5() + static void OnSuccessCallback_91(void * context, uint32_t rxErrSecCount) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_91(rxErrSecCount); + } - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; + static void OnFailureCallback_92(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_92(error); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_92(void * context, uint32_t rxErrFcsCount) + { + (static_cast(context))->OnSuccessResponse_92(rxErrFcsCount); } - void OnFailureResponse_5(CHIP_ERROR error) + static void OnFailureCallback_93(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_93(error); } - void OnSuccessResponse_5() { NextTest(); } + static void OnSuccessCallback_93(void * context, uint32_t rxErrFcsCount) + { + (static_cast(context))->OnSuccessResponse_93(rxErrFcsCount); + } - CHIP_ERROR TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6() + static void OnFailureCallback_94(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_94(error); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6, true)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_94(void * context, uint32_t rxErrOtherCount) + { + (static_cast(context))->OnSuccessResponse_94(rxErrOtherCount); } - void OnFailureResponse_6(CHIP_ERROR error) + static void OnFailureCallback_95(void * context, CHIP_ERROR error) { - chip::app::StatusIB status(error); - ThrowFailureResponse(); + (static_cast(context))->OnFailureResponse_95(error); } - void OnSuccessResponse_6(int16_t occupiedHeatingSetpoint) + static void OnSuccessCallback_95(void * context, uint32_t rxErrOtherCount) { - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2000)); - VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 700)); - VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 3000)); - NextTest(); + (static_cast(context))->OnSuccessResponse_95(rxErrOtherCount); } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7() + static void OnFailureCallback_96(void * context, CHIP_ERROR error) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_96(error); + } - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2100; + static void OnSuccessCallback_96(void * context, uint64_t activeTimestamp) + { + (static_cast(context))->OnSuccessResponse_96(activeTimestamp); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); + static void OnFailureCallback_97(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_97(error); + } + + static void OnSuccessCallback_97(void * context, uint64_t activeTimestamp) + { + (static_cast(context))->OnSuccessResponse_97(activeTimestamp); + } + + static void OnFailureCallback_98(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_98(error); + } + + static void OnSuccessCallback_98(void * context, uint64_t pendingTimestamp) + { + (static_cast(context))->OnSuccessResponse_98(pendingTimestamp); + } + + static void OnFailureCallback_99(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_99(error); + } + + static void OnSuccessCallback_99(void * context, uint64_t pendingTimestamp) + { + (static_cast(context))->OnSuccessResponse_99(pendingTimestamp); + } + + static void OnFailureCallback_100(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_100(error); + } + + static void OnSuccessCallback_100(void * context, uint32_t delay) + { + (static_cast(context))->OnSuccessResponse_100(delay); + } + + static void OnFailureCallback_101(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_101(error); + } + + static void OnSuccessCallback_101(void * context, uint32_t delay) + { + (static_cast(context))->OnSuccessResponse_101(delay); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeChannel_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(CHIP_ERROR error) + void OnFailureResponse_1(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8() + void OnSuccessResponse_1(uint16_t channel) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + VerifyOrReturn(CheckConstraintType("channel", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeNetworkName_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_8(int16_t occupiedHeatingSetpoint) + void OnSuccessResponse_2(chip::CharSpan networkName) { - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2100)); - + VerifyOrReturn(CheckConstraintType("networkName", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("networkName", networkName.size(), 16)); NextTest(); } - CHIP_ERROR TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9() + CHIP_ERROR TestValidateConstraintsOfAttributePanId_3() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_9(CHIP_ERROR error) + void OnFailureResponse_3(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_9() { NextTest(); } + void OnSuccessResponse_3(uint16_t panId) + { + VerifyOrReturn(CheckConstraintType("panId", "", "uint16")); + NextTest(); + } - CHIP_ERROR TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10() + CHIP_ERROR TestValidateConstraintsOfAttributeExtendedPanId_4() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_10(CHIP_ERROR error) + void OnFailureResponse_4(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_10() { NextTest(); } + void OnSuccessResponse_4(uint64_t extendedPanId) + { + VerifyOrReturn(CheckConstraintType("extendedPanId", "", "uint64")); + NextTest(); + } - CHIP_ERROR TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11() + CHIP_ERROR TestValidateConstraintsOfAttributeOverrunCount_5() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_11(CHIP_ERROR error) + void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_11(int16_t minHeatSetpointLimit) + void OnSuccessResponse_5(uint64_t overrunCount) { - VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); - VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); - VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", minHeatSetpointLimit, 3000)); + VerifyOrReturn(CheckConstraintType("overrunCount", "", "uint64")); NextTest(); } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12() + CHIP_ERROR TestReadPartitionIdAttributeValue_6() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_12, OnFailureCallback_12)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_12(CHIP_ERROR error) + void OnFailureResponse_6(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_12() { NextTest(); } + void OnSuccessResponse_6(uint32_t partitionId) + { + VerifyOrReturn(CheckValue("partitionId", partitionId, 0UL)); - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributePartitionId_7() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_13(CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_13(int16_t minHeatSetpointLimit) + void OnSuccessResponse_7(uint32_t partitionId) { - VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 2000)); - + VerifyOrReturn(CheckConstraintType("partitionId", "", "uint32")); NextTest(); } - CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14() + CHIP_ERROR TestReadWeightingAttributeValue_8() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_14, OnFailureCallback_14)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_8, OnFailureCallback_8, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_14(CHIP_ERROR error) + void OnFailureResponse_8(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_14() { NextTest(); } + void OnSuccessResponse_8(uint8_t weighting) + { + VerifyOrReturn(CheckValue("weighting", weighting, 0)); - CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeWeighting_9() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_15, OnFailureCallback_15)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_9, OnFailureCallback_9, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_15(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_15() { NextTest(); } + void OnSuccessResponse_9(uint8_t weighting) + { + VerifyOrReturn(CheckConstraintType("weighting", "", "uint8")); + NextTest(); + } - CHIP_ERROR TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16() + CHIP_ERROR TestReadDataVersionAttributeValue_10() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_10, OnFailureCallback_10, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_16(CHIP_ERROR error) + void OnFailureResponse_10(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_16(int16_t maxHeatSetpointLimit) + void OnSuccessResponse_10(uint8_t dataVersion) { - VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); - VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 700)); - VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); + VerifyOrReturn(CheckValue("dataVersion", dataVersion, 0)); + NextTest(); } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17() + CHIP_ERROR TestValidateConstraintsOfAttributeDataVersion_11() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_17, OnFailureCallback_17)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_11, OnFailureCallback_11, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_17(CHIP_ERROR error) + void OnFailureResponse_11(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_17() { NextTest(); } + void OnSuccessResponse_11(uint8_t dataVersion) + { + VerifyOrReturn(CheckConstraintType("dataVersion", "", "uint8")); + NextTest(); + } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18() + CHIP_ERROR TestReadStableDataVersionAttributeValue_12() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_12, OnFailureCallback_12, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_18(CHIP_ERROR error) + void OnFailureResponse_12(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_18(int16_t maxHeatSetpointLimit) + void OnSuccessResponse_12(uint8_t stableDataVersion) { - VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 2000)); + VerifyOrReturn(CheckValue("stableDataVersion", stableDataVersion, 0)); NextTest(); } - CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19() + CHIP_ERROR TestValidateConstraintsOfAttributeStableDataVersion_13() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_19, OnFailureCallback_19)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_13, OnFailureCallback_13, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_19(CHIP_ERROR error) + void OnFailureResponse_13(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_19() { NextTest(); } + void OnSuccessResponse_13(uint8_t stableDataVersion) + { + VerifyOrReturn(CheckConstraintType("stableDataVersion", "", "uint8")); + NextTest(); + } - CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20() + CHIP_ERROR TestReadLeaderRouterIdAttributeValue_14() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_20, OnFailureCallback_20)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_14, OnFailureCallback_14, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_20(CHIP_ERROR error) + void OnFailureResponse_14(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_20() { NextTest(); } + void OnSuccessResponse_14(uint8_t leaderRouterId) + { + VerifyOrReturn(CheckValue("leaderRouterId", leaderRouterId, 0)); - CHIP_ERROR TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeLeaderRouterId_15() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_21, OnFailureCallback_21, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_15, OnFailureCallback_15, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_21(CHIP_ERROR error) + void OnFailureResponse_15(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_21(int16_t minCoolSetpointLimit) + void OnSuccessResponse_15(uint8_t leaderRouterId) { - VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); - VerifyOrReturn(CheckConstraintType("minCoolSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("minCoolSetpointLimit", minCoolSetpointLimit, 3200)); + VerifyOrReturn(CheckConstraintType("leaderRouterId", "", "uint8")); NextTest(); } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22() + CHIP_ERROR TestReadDetachedRoleCountAttributeValue_16() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_22, OnFailureCallback_22)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_16, OnFailureCallback_16, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_22(CHIP_ERROR error) + void OnFailureResponse_16(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_22() { NextTest(); } + void OnSuccessResponse_16(uint16_t detachedRoleCount) + { + VerifyOrReturn(CheckValue("detachedRoleCount", detachedRoleCount, 0U)); - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeDetachedRoleCount_17() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_17, OnFailureCallback_17, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_23(CHIP_ERROR error) + void OnFailureResponse_17(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_23(int16_t minCoolSetpointLimit) + void OnSuccessResponse_17(uint16_t detachedRoleCount) { - VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 2000)); - + VerifyOrReturn(CheckConstraintType("detachedRoleCount", "", "uint16")); NextTest(); } - CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24() + CHIP_ERROR TestReadChildRoleCountAttributeValue_18() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 1600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_24, OnFailureCallback_24)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_18, OnFailureCallback_18, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_24(CHIP_ERROR error) + void OnFailureResponse_18(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_24() { NextTest(); } + void OnSuccessResponse_18(uint16_t childRoleCount) + { + VerifyOrReturn(CheckValue("childRoleCount", childRoleCount, 0U)); - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeChildRoleCount_19() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 3200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_25, OnFailureCallback_25)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_19, OnFailureCallback_19, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_25(CHIP_ERROR error) + void OnFailureResponse_19(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_25() { NextTest(); } + void OnSuccessResponse_19(uint16_t childRoleCount) + { + VerifyOrReturn(CheckConstraintType("childRoleCount", "", "uint16")); + NextTest(); + } - CHIP_ERROR TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26() + CHIP_ERROR TestReadRouterRoleCountAttributeValue_20() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_26, OnFailureCallback_26, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_20, OnFailureCallback_20, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_26(CHIP_ERROR error) + void OnFailureResponse_20(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_26(int16_t maxCoolSetpointLimit) + void OnSuccessResponse_20(uint16_t routerRoleCount) { - VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); - VerifyOrReturn(CheckConstraintType("maxCoolSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); + VerifyOrReturn(CheckValue("routerRoleCount", routerRoleCount, 0U)); + NextTest(); } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27() + CHIP_ERROR TestValidateConstraintsOfAttributeRouterRoleCount_21() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_27, OnFailureCallback_27)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_21, OnFailureCallback_21, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_27(CHIP_ERROR error) + void OnFailureResponse_21(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_27() { NextTest(); } + void OnSuccessResponse_21(uint16_t routerRoleCount) + { + VerifyOrReturn(CheckConstraintType("routerRoleCount", "", "uint16")); + NextTest(); + } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28() + CHIP_ERROR TestReadLeaderRoleCountAttributeValue_22() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_28, OnFailureCallback_28, true)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_22, OnFailureCallback_22, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_28(CHIP_ERROR error) + void OnFailureResponse_22(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_28(int16_t maxCoolSetpointLimit) + void OnSuccessResponse_22(uint16_t leaderRoleCount) { - VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 2000)); + VerifyOrReturn(CheckValue("leaderRoleCount", leaderRoleCount, 0U)); NextTest(); } - CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29() + CHIP_ERROR TestValidateConstraintsOfAttributeLeaderRoleCount_23() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 1600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_29, OnFailureCallback_29)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_23, OnFailureCallback_23, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_29(CHIP_ERROR error) + void OnFailureResponse_23(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_29() { NextTest(); } + void OnSuccessResponse_23(uint16_t leaderRoleCount) + { + VerifyOrReturn(CheckConstraintType("leaderRoleCount", "", "uint16")); + NextTest(); + } - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30() + CHIP_ERROR TestReadAttachAttemptCountAttributeValue_24() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 3200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_30, OnFailureCallback_30)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_24, OnFailureCallback_24, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_30(CHIP_ERROR error) + void OnFailureResponse_24(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_30() { NextTest(); } + void OnSuccessResponse_24(uint16_t attachAttemptCount) + { + VerifyOrReturn(CheckValue("attachAttemptCount", attachAttemptCount, 0U)); - CHIP_ERROR TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeAttachAttemptCount_25() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_31, OnFailureCallback_31)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_25, OnFailureCallback_25, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_31(CHIP_ERROR error) + void OnFailureResponse_25(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_31() { NextTest(); } + void OnSuccessResponse_25(uint16_t attachAttemptCount) + { + VerifyOrReturn(CheckConstraintType("attachAttemptCount", "", "uint16")); + NextTest(); + } - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32() + CHIP_ERROR TestReadPartitionIdChangeCountAttributeValue_26() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_26, OnFailureCallback_26, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_32(CHIP_ERROR error) + void OnFailureResponse_26(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_32() { NextTest(); } + void OnSuccessResponse_26(uint16_t partitionIdChangeCount) + { + VerifyOrReturn(CheckValue("partitionIdChangeCount", partitionIdChangeCount, 0U)); - CHIP_ERROR TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributePartitionIdChangeCount_27() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_33, OnFailureCallback_33)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_27, OnFailureCallback_27, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_33(CHIP_ERROR error) + void OnFailureResponse_27(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_33() { NextTest(); } + void OnSuccessResponse_27(uint16_t partitionIdChangeCount) + { + VerifyOrReturn(CheckConstraintType("partitionIdChangeCount", "", "uint16")); + NextTest(); + } - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34() + CHIP_ERROR TestReadBetterPartitionAttachAttemptCountAttributeValue_28() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_34, OnFailureCallback_34)); + ReturnErrorOnFailure( + cluster.ReadAttribute< + chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::TypeInfo>( + this, OnSuccessCallback_28, OnFailureCallback_28, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_34(CHIP_ERROR error) + void OnFailureResponse_28(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_34() { NextTest(); } + void OnSuccessResponse_28(uint16_t betterPartitionAttachAttemptCount) + { + VerifyOrReturn(CheckValue("betterPartitionAttachAttemptCount", betterPartitionAttachAttemptCount, 0U)); - CHIP_ERROR TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeBetterPartitionAttachAttemptCount_29() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 1600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_35, OnFailureCallback_35)); + ReturnErrorOnFailure( + cluster.ReadAttribute< + chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::TypeInfo>( + this, OnSuccessCallback_29, OnFailureCallback_29, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_35(CHIP_ERROR error) + void OnFailureResponse_29(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_35() { NextTest(); } + void OnSuccessResponse_29(uint16_t betterPartitionAttachAttemptCount) + { + VerifyOrReturn(CheckConstraintType("betterPartitionAttachAttemptCount", "", "uint16")); + NextTest(); + } - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36() + CHIP_ERROR TestReadParentChangeCountAttributeValue_30() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 3200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_36, OnFailureCallback_36)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_30, OnFailureCallback_30, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_36(CHIP_ERROR error) + void OnFailureResponse_30(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_36() { NextTest(); } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37() + void OnSuccessResponse_30(uint16_t parentChangeCount) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + VerifyOrReturn(CheckValue("parentChangeCount", parentChangeCount, 0U)); - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 1600; + NextTest(); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_37, OnFailureCallback_37)); + CHIP_ERROR TestValidateConstraintsOfAttributeParentChangeCount_31() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_31, OnFailureCallback_31, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_37(CHIP_ERROR error) + void OnFailureResponse_31(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_37() { NextTest(); } + void OnSuccessResponse_31(uint16_t parentChangeCount) + { + VerifyOrReturn(CheckConstraintType("parentChangeCount", "", "uint16")); + NextTest(); + } - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38() + CHIP_ERROR TestReadTxTotalCountAttributeValue_32() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 3200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_38, OnFailureCallback_38)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_32, OnFailureCallback_32, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_38(CHIP_ERROR error) + void OnFailureResponse_32(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_38() { NextTest(); } + void OnSuccessResponse_32(uint32_t txTotalCount) + { + VerifyOrReturn(CheckValue("txTotalCount", txTotalCount, 0UL)); - CHIP_ERROR TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeTxTotalCount_33() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_39, OnFailureCallback_39, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_33, OnFailureCallback_33, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_39(CHIP_ERROR error) + void OnFailureResponse_33(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_39(chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + void OnSuccessResponse_33(uint32_t txTotalCount) { - VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 4)); - VerifyOrReturn(CheckConstraintType("controlSequenceOfOperation", "", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("controlSequenceOfOperation", controlSequenceOfOperation, 0)); - VerifyOrReturn(CheckConstraintMaxValue("controlSequenceOfOperation", controlSequenceOfOperation, 5)); + VerifyOrReturn(CheckConstraintType("txTotalCount", "", "uint32")); NextTest(); } - CHIP_ERROR TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40() + CHIP_ERROR TestReadTxUnicastCountAttributeValue_34() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperationArgument; - controlSequenceOfOperationArgument = static_cast(2); - ReturnErrorOnFailure( - cluster.WriteAttribute( - controlSequenceOfOperationArgument, this, OnSuccessCallback_40, OnFailureCallback_40)); + cluster.ReadAttribute( + this, OnSuccessCallback_34, OnFailureCallback_34, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_40(CHIP_ERROR error) + void OnFailureResponse_34(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_40() { NextTest(); } + void OnSuccessResponse_34(uint32_t txUnicastCount) + { + VerifyOrReturn(CheckValue("txUnicastCount", txUnicastCount, 0UL)); - CHIP_ERROR TestReadItBackAgainToConfirmTheSuccessfulWrite_41() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeTxUnicastCount_35() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_41, OnFailureCallback_41, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_35, OnFailureCallback_35, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_41(CHIP_ERROR error) + void OnFailureResponse_35(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_41(chip::app::Clusters::Thermostat::ThermostatControlSequence controlSequenceOfOperation) + void OnSuccessResponse_35(uint32_t txUnicastCount) { - VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 2)); - + VerifyOrReturn(CheckConstraintType("txUnicastCount", "", "uint32")); NextTest(); } - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_42() + CHIP_ERROR TestReadTxBroadcastCountAttributeValue_36() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_42, OnFailureCallback_42)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_36, OnFailureCallback_36, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_42(CHIP_ERROR error) + void OnFailureResponse_36(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_42() { NextTest(); } + void OnSuccessResponse_36(uint32_t txBroadcastCount) + { + VerifyOrReturn(CheckValue("txBroadcastCount", txBroadcastCount, 0UL)); - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_43() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeTxBroadcastCount_37() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_43, OnFailureCallback_43)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_37, OnFailureCallback_37, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_43(CHIP_ERROR error) + void OnFailureResponse_37(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_43() { NextTest(); } + void OnSuccessResponse_37(uint32_t txBroadcastCount) + { + VerifyOrReturn(CheckConstraintType("txBroadcastCount", "", "uint32")); + NextTest(); + } - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_44() + CHIP_ERROR TestReadTxNoAckRequestedCountAttributeValue_38() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_38, OnFailureCallback_38, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_44(CHIP_ERROR error) + void OnFailureResponse_38(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_44() { NextTest(); } + void OnSuccessResponse_38(uint32_t txNoAckRequestedCount) + { + VerifyOrReturn(CheckValue("txNoAckRequestedCount", txNoAckRequestedCount, 0UL)); - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_45() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeTxNoAckRequestedCount_39() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_45, OnFailureCallback_45)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_39, OnFailureCallback_39, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_45(CHIP_ERROR error) + void OnFailureResponse_39(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_45() { NextTest(); } + void OnSuccessResponse_39(uint32_t txNoAckRequestedCount) + { + VerifyOrReturn(CheckConstraintType("txNoAckRequestedCount", "", "uint32")); + NextTest(); + } - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_46() + CHIP_ERROR TestReadTxDataCountAttributeValue_40() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_46, OnFailureCallback_46)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_40, OnFailureCallback_40, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_46(CHIP_ERROR error) + void OnFailureResponse_40(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_46() { NextTest(); } + void OnSuccessResponse_40(uint32_t txDataCount) + { + VerifyOrReturn(CheckValue("txDataCount", txDataCount, 0UL)); - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_47() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeTxDataCount_41() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_47, OnFailureCallback_47)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_41, OnFailureCallback_41, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_47(CHIP_ERROR error) + void OnFailureResponse_41(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_47() { NextTest(); } + void OnSuccessResponse_41(uint32_t txDataCount) + { + VerifyOrReturn(CheckConstraintType("txDataCount", "", "uint32")); + NextTest(); + } - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_48() + CHIP_ERROR TestReadTxDataPollCountAttributeValue_42() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_48, OnFailureCallback_48)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_42, OnFailureCallback_42, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_48(CHIP_ERROR error) + void OnFailureResponse_42(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_48() { NextTest(); } + void OnSuccessResponse_42(uint32_t txDataPollCount) + { + VerifyOrReturn(CheckValue("txDataPollCount", txDataPollCount, 0UL)); - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_49() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeTxDataPollCount_43() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_49, OnFailureCallback_49)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_43, OnFailureCallback_43, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_49(CHIP_ERROR error) + void OnFailureResponse_43(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_49() { NextTest(); } -}; - -class Test_TC_TSUIC_1_1Suite : public TestCommand -{ -public: - Test_TC_TSUIC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_TSUIC_1_1", credsIssuerConfig), mTestIndex(0) + void OnSuccessResponse_43(uint32_t txDataPollCount) { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + VerifyOrReturn(CheckConstraintType("txDataPollCount", "", "uint32")); + NextTest(); } - ~Test_TC_TSUIC_1_1Suite() {} - - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadTxBeaconCountAttributeValue_44() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); - break; - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_44, OnFailureCallback_44, true)); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; + void OnFailureResponse_44(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnSuccessResponse_44(uint32_t txBeaconCount) { - bool isExpectedDnssdResult = false; + VerifyOrReturn(CheckValue("txBeaconCount", txBeaconCount, 0UL)); - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); NextTest(); } - static void OnFailureCallback_1(void * context, CHIP_ERROR error) + CHIP_ERROR TestValidateConstraintsOfAttributeTxBeaconCount_45() { - (static_cast(context))->OnFailureResponse_1(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_45, OnFailureCallback_45, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + void OnFailureResponse_45(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnFailureCallback_2(void * context, CHIP_ERROR error) + void OnSuccessResponse_45(uint32_t txBeaconCount) { - (static_cast(context))->OnFailureResponse_2(error); + VerifyOrReturn(CheckConstraintType("txBeaconCount", "", "uint32")); + NextTest(); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTxBeaconRequestCountAttributeValue_46() { - (static_cast(context))->OnFailureResponse_3(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_46, OnFailureCallback_46, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + void OnFailureResponse_46(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_3(attributeList); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + void OnSuccessResponse_46(uint32_t txBeaconRequestCount) { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + VerifyOrReturn(CheckValue("txBeaconRequestCount", txBeaconRequestCount, 0UL)); + + NextTest(); } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestValidateConstraintsOfAttributeTxBeaconRequestCount_47() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_47, OnFailureCallback_47, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_1(CHIP_ERROR error) + void OnFailureResponse_47(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_1(uint16_t clusterRevision) + void OnSuccessResponse_47(uint32_t txBeaconRequestCount) { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + VerifyOrReturn(CheckConstraintType("txBeaconRequestCount", "", "uint32")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadTxOtherCountAttributeValue_48() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 2U; - ReturnErrorOnFailure( - cluster - .WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + cluster.ReadAttribute( + this, OnSuccessCallback_48, OnFailureCallback_48, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_2(CHIP_ERROR error) + void OnFailureResponse_48(CHIP_ERROR error) { chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); + ThrowFailureResponse(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } + void OnSuccessResponse_48(uint32_t txOtherCount) + { + VerifyOrReturn(CheckValue("txOtherCount", txOtherCount, 0UL)); - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeTxOtherCount_49() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_49, OnFailureCallback_49, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_49(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + void OnSuccessResponse_49(uint32_t txOtherCount) { - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintType("txOtherCount", "", "uint32")); NextTest(); } -}; -class Test_TC_TSUIC_2_1Suite : public TestCommand -{ -public: - Test_TC_TSUIC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_TSUIC_2_1", credsIssuerConfig), mTestIndex(0) + CHIP_ERROR TestReadTxRetryCountAttributeValue_50() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ~Test_TC_TSUIC_2_1Suite() {} + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_50, OnFailureCallback_50, true)); + return CHIP_NO_ERROR; + } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnFailureResponse_50(CHIP_ERROR error) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : write to the mandatory attribute: TemperatureDisplayMode\n"); - err = TestWriteToTheMandatoryAttributeTemperatureDisplayMode_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : write to the mandatory attribute: KeypadLockout\n"); - err = TestWriteToTheMandatoryAttributeKeypadLockout_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : write to the mandatory attribute: ScheduleProgrammingVisibility\n"); - err = TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_15(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + chip::app::StatusIB status(error); + ThrowFailureResponse(); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnSuccessResponse_50(uint32_t txRetryCount) { - bool isExpectedDnssdResult = false; + VerifyOrReturn(CheckValue("txRetryCount", txRetryCount, 0UL)); - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); NextTest(); } - static void OnFailureCallback_1(void * context, CHIP_ERROR error) + CHIP_ERROR TestValidateConstraintsOfAttributeTxRetryCount_51() { - (static_cast(context))->OnFailureResponse_1(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_1(void * context, uint8_t temperatureDisplayMode) - { - (static_cast(context))->OnSuccessResponse_1(temperatureDisplayMode); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_51, OnFailureCallback_51, true)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_2(void * context, CHIP_ERROR error) + void OnFailureResponse_51(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_2(void * context, uint8_t temperatureDisplayMode) + void OnSuccessResponse_51(uint32_t txRetryCount) { - (static_cast(context))->OnSuccessResponse_2(temperatureDisplayMode); + VerifyOrReturn(CheckConstraintType("txRetryCount", "", "uint32")); + NextTest(); } - static void OnFailureCallback_3(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTxDirectMaxRetryExpiryCountAttributeValue_52() { - (static_cast(context))->OnFailureResponse_3(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_52, OnFailureCallback_52, true)); + return CHIP_NO_ERROR; + } - static void OnFailureCallback_4(void * context, CHIP_ERROR error) + void OnFailureResponse_52(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_4(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_4(void * context, uint8_t temperatureDisplayMode) + void OnSuccessResponse_52(uint32_t txDirectMaxRetryExpiryCount) { - (static_cast(context))->OnSuccessResponse_4(temperatureDisplayMode); + VerifyOrReturn(CheckValue("txDirectMaxRetryExpiryCount", txDirectMaxRetryExpiryCount, 0UL)); + + NextTest(); } - static void OnFailureCallback_5(void * context, CHIP_ERROR error) + CHIP_ERROR TestValidateConstraintsOfAttributeTxDirectMaxRetryExpiryCount_53() { - (static_cast(context))->OnFailureResponse_5(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_53, OnFailureCallback_53, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_5(void * context, uint8_t temperatureDisplayMode) + void OnFailureResponse_53(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_5(temperatureDisplayMode); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnFailureCallback_6(void * context, CHIP_ERROR error) + void OnSuccessResponse_53(uint32_t txDirectMaxRetryExpiryCount) { - (static_cast(context))->OnFailureResponse_6(error); + VerifyOrReturn(CheckConstraintType("txDirectMaxRetryExpiryCount", "", "uint32")); + NextTest(); } - static void OnSuccessCallback_6(void * context, uint8_t keypadLockout) + CHIP_ERROR TestReadTxIndirectMaxRetryExpiryCountAttributeValue_54() { - (static_cast(context))->OnSuccessResponse_6(keypadLockout); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster + .ReadAttribute( + this, OnSuccessCallback_54, OnFailureCallback_54, true)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_7(void * context, CHIP_ERROR error) + void OnFailureResponse_54(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_7(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_7(void * context, uint8_t keypadLockout) + void OnSuccessResponse_54(uint32_t txIndirectMaxRetryExpiryCount) { - (static_cast(context))->OnSuccessResponse_7(keypadLockout); + VerifyOrReturn(CheckValue("txIndirectMaxRetryExpiryCount", txIndirectMaxRetryExpiryCount, 0UL)); + + NextTest(); } - static void OnFailureCallback_8(void * context, CHIP_ERROR error) + CHIP_ERROR TestValidateConstraintsOfAttributeTxIndirectMaxRetryExpiryCount_55() { - (static_cast(context))->OnFailureResponse_8(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + ReturnErrorOnFailure( + cluster + .ReadAttribute( + this, OnSuccessCallback_55, OnFailureCallback_55, true)); + return CHIP_NO_ERROR; + } - static void OnFailureCallback_9(void * context, CHIP_ERROR error) + void OnFailureResponse_55(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_9(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_9(void * context, uint8_t keypadLockout) + void OnSuccessResponse_55(uint32_t txIndirectMaxRetryExpiryCount) { - (static_cast(context))->OnSuccessResponse_9(keypadLockout); + VerifyOrReturn(CheckConstraintType("txIndirectMaxRetryExpiryCount", "", "uint32")); + NextTest(); } - static void OnFailureCallback_10(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTxErrCcaCountAttributeValue_56() { - (static_cast(context))->OnFailureResponse_10(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_56, OnFailureCallback_56, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_10(void * context, uint8_t keypadLockout) + void OnFailureResponse_56(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_10(keypadLockout); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnFailureCallback_11(void * context, CHIP_ERROR error) + void OnSuccessResponse_56(uint32_t txErrCcaCount) { - (static_cast(context))->OnFailureResponse_11(error); + VerifyOrReturn(CheckValue("txErrCcaCount", txErrCcaCount, 0UL)); + + NextTest(); } - static void OnSuccessCallback_11(void * context, uint8_t scheduleProgrammingVisibility) + CHIP_ERROR TestValidateConstraintsOfAttributeTxErrCcaCount_57() { - (static_cast(context))->OnSuccessResponse_11(scheduleProgrammingVisibility); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_57, OnFailureCallback_57, true)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_12(void * context, CHIP_ERROR error) + void OnFailureResponse_57(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_12(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_12(void * context, uint8_t scheduleProgrammingVisibility) + void OnSuccessResponse_57(uint32_t txErrCcaCount) { - (static_cast(context))->OnSuccessResponse_12(scheduleProgrammingVisibility); + VerifyOrReturn(CheckConstraintType("txErrCcaCount", "", "uint32")); + NextTest(); } - static void OnFailureCallback_13(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadTxErrAbortCountAttributeValue_58() { - (static_cast(context))->OnFailureResponse_13(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_13(void * context) { (static_cast(context))->OnSuccessResponse_13(); } + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_58, OnFailureCallback_58, true)); + return CHIP_NO_ERROR; + } - static void OnFailureCallback_14(void * context, CHIP_ERROR error) + void OnFailureResponse_58(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_14(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_14(void * context, uint8_t scheduleProgrammingVisibility) + void OnSuccessResponse_58(uint32_t txErrAbortCount) { - (static_cast(context))->OnSuccessResponse_14(scheduleProgrammingVisibility); + VerifyOrReturn(CheckValue("txErrAbortCount", txErrAbortCount, 0UL)); + + NextTest(); } - static void OnFailureCallback_15(void * context, CHIP_ERROR error) + CHIP_ERROR TestValidateConstraintsOfAttributeTxErrAbortCount_59() { - (static_cast(context))->OnFailureResponse_15(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_59, OnFailureCallback_59, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_15(void * context, uint8_t scheduleProgrammingVisibility) + void OnFailureResponse_59(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_15(scheduleProgrammingVisibility); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + void OnSuccessResponse_59(uint32_t txErrAbortCount) { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + VerifyOrReturn(CheckConstraintType("txErrAbortCount", "", "uint32")); + NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_1() + CHIP_ERROR TestReadTxErrBusyChannelCountAttributeValue_60() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - this, OnSuccessCallback_1, OnFailureCallback_1, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_60, OnFailureCallback_60, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_1(CHIP_ERROR error) + void OnFailureResponse_60(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_1(uint8_t temperatureDisplayMode) + void OnSuccessResponse_60(uint32_t txErrBusyChannelCount) { - VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); + VerifyOrReturn(CheckValue("txErrBusyChannelCount", txErrBusyChannelCount, 0UL)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_2() + CHIP_ERROR TestValidateConstraintsOfAttributeTxErrBusyChannelCount_61() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - this, OnSuccessCallback_2, OnFailureCallback_2, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_61, OnFailureCallback_61, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_2(CHIP_ERROR error) + void OnFailureResponse_61(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t temperatureDisplayMode) + void OnSuccessResponse_61(uint32_t txErrBusyChannelCount) { - VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); + VerifyOrReturn(CheckConstraintType("txErrBusyChannelCount", "", "uint32")); NextTest(); } - CHIP_ERROR TestWriteToTheMandatoryAttributeTemperatureDisplayMode_3() + CHIP_ERROR TestReadRxTotalCountAttributeValue_62() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t temperatureDisplayModeArgument; - temperatureDisplayModeArgument = 0; - ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - temperatureDisplayModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + cluster.ReadAttribute( + this, OnSuccessCallback_62, OnFailureCallback_62, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_62(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_62(uint32_t rxTotalCount) + { + VerifyOrReturn(CheckValue("rxTotalCount", rxTotalCount, 0UL)); - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_4() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeRxTotalCount_63() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - this, OnSuccessCallback_4, OnFailureCallback_4, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_63, OnFailureCallback_63, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(CHIP_ERROR error) + void OnFailureResponse_63(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_4(uint8_t temperatureDisplayMode) + void OnSuccessResponse_63(uint32_t rxTotalCount) { - VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); - + VerifyOrReturn(CheckConstraintType("rxTotalCount", "", "uint32")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_5() + CHIP_ERROR TestReadRxUnicastCountAttributeValue_64() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - this, OnSuccessCallback_5, OnFailureCallback_5, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_64, OnFailureCallback_64, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_5(CHIP_ERROR error) + void OnFailureResponse_64(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_5(uint8_t temperatureDisplayMode) + void OnSuccessResponse_64(uint32_t rxUnicastCount) { - VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); + VerifyOrReturn(CheckValue("rxUnicastCount", rxUnicastCount, 0UL)); + NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_6() + CHIP_ERROR TestValidateConstraintsOfAttributeRxUnicastCount_65() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_65, OnFailureCallback_65, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_65(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_6(uint8_t keypadLockout) + void OnSuccessResponse_65(uint32_t rxUnicastCount) { - VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); - + VerifyOrReturn(CheckConstraintType("rxUnicastCount", "", "uint32")); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_7() + CHIP_ERROR TestReadRxBroadcastCountAttributeValue_66() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_66, OnFailureCallback_66, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(CHIP_ERROR error) + void OnFailureResponse_66(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_7(uint8_t keypadLockout) + void OnSuccessResponse_66(uint32_t rxBroadcastCount) { - VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); + VerifyOrReturn(CheckValue("rxBroadcastCount", rxBroadcastCount, 0UL)); + NextTest(); } - CHIP_ERROR TestWriteToTheMandatoryAttributeKeypadLockout_8() + CHIP_ERROR TestValidateConstraintsOfAttributeRxBroadcastCount_67() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 0; - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + cluster.ReadAttribute( + this, OnSuccessCallback_67, OnFailureCallback_67, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_67(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_8() { NextTest(); } + void OnSuccessResponse_67(uint32_t rxBroadcastCount) + { + VerifyOrReturn(CheckConstraintType("rxBroadcastCount", "", "uint32")); + NextTest(); + } - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_9() + CHIP_ERROR TestReadRxDataCountAttributeValue_68() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_68, OnFailureCallback_68, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_9(CHIP_ERROR error) + void OnFailureResponse_68(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_9(uint8_t keypadLockout) + void OnSuccessResponse_68(uint32_t rxDataCount) { - VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); + VerifyOrReturn(CheckValue("rxDataCount", rxDataCount, 0UL)); NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_10() + CHIP_ERROR TestValidateConstraintsOfAttributeRxDataCount_69() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_69, OnFailureCallback_69, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_10(CHIP_ERROR error) + void OnFailureResponse_69(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_10(uint8_t keypadLockout) + void OnSuccessResponse_69(uint32_t rxDataCount) { - VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); + VerifyOrReturn(CheckConstraintType("rxDataCount", "", "uint32")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_11() + CHIP_ERROR TestReadRxDataPollCountAttributeValue_70() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - this, OnSuccessCallback_11, OnFailureCallback_11, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_70, OnFailureCallback_70, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_11(CHIP_ERROR error) + void OnFailureResponse_70(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_11(uint8_t scheduleProgrammingVisibility) + void OnSuccessResponse_70(uint32_t rxDataPollCount) { - VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); + VerifyOrReturn(CheckValue("rxDataPollCount", rxDataPollCount, 0UL)); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_12() + CHIP_ERROR TestValidateConstraintsOfAttributeRxDataPollCount_71() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - this, OnSuccessCallback_12, OnFailureCallback_12, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_71, OnFailureCallback_71, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_12(CHIP_ERROR error) + void OnFailureResponse_71(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_12(uint8_t scheduleProgrammingVisibility) + void OnSuccessResponse_71(uint32_t rxDataPollCount) { - VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); + VerifyOrReturn(CheckConstraintType("rxDataPollCount", "", "uint32")); NextTest(); } - CHIP_ERROR TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_13() + CHIP_ERROR TestReadRxBeaconCountAttributeValue_72() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = 0; - ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - scheduleProgrammingVisibilityArgument, this, OnSuccessCallback_13, OnFailureCallback_13)); + cluster.ReadAttribute( + this, OnSuccessCallback_72, OnFailureCallback_72, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_13(CHIP_ERROR error) + void OnFailureResponse_72(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_13() { NextTest(); } + void OnSuccessResponse_72(uint32_t rxBeaconCount) + { + VerifyOrReturn(CheckValue("rxBeaconCount", rxBeaconCount, 0UL)); - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_14() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeRxBeaconCount_73() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - this, OnSuccessCallback_14, OnFailureCallback_14, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_73, OnFailureCallback_73, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_14(CHIP_ERROR error) + void OnFailureResponse_73(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_14(uint8_t scheduleProgrammingVisibility) + void OnSuccessResponse_73(uint32_t rxBeaconCount) { - VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); - + VerifyOrReturn(CheckConstraintType("rxBeaconCount", "", "uint32")); NextTest(); } - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_15() + CHIP_ERROR TestReadRxBeaconRequestCountAttributeValue_74() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - this, OnSuccessCallback_15, OnFailureCallback_15, true)); + cluster.ReadAttribute( + this, OnSuccessCallback_74, OnFailureCallback_74, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_15(CHIP_ERROR error) + void OnFailureResponse_74(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_15(uint8_t scheduleProgrammingVisibility) + void OnSuccessResponse_74(uint32_t rxBeaconRequestCount) { - VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); + VerifyOrReturn(CheckValue("rxBeaconRequestCount", rxBeaconRequestCount, 0UL)); + NextTest(); } -}; -class Test_TC_TSUIC_2_2Suite : public TestCommand -{ -public: - Test_TC_TSUIC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_TSUIC_2_2", credsIssuerConfig), mTestIndex(0) + CHIP_ERROR TestValidateConstraintsOfAttributeRxBeaconRequestCount_75() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ~Test_TC_TSUIC_2_2Suite() {} + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_75, OnFailureCallback_75, true)); + return CHIP_NO_ERROR; + } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnFailureResponse_75(CHIP_ERROR error) { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Writes a value of 0 to TemperatureDisplayMode attribute of DUT\n"); - if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) - { - NextTest(); - return; - } - err = TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Writes a value of 1 to TemperatureDisplayMode attribute of DUT\n"); - if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) - { - NextTest(); - return; - } - err = TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Writes a value of 0 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) - { - NextTest(); - return; - } - err = TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Writes a value of 1 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) - { - NextTest(); - return; - } - err = TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Writes a value of 2 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) - { - NextTest(); - return; - } - err = TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Writes a value of 3 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) - { - NextTest(); - return; - } - err = TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Writes a value of 4 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) - { - NextTest(); - return; - } - err = TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Writes a value of 5 to KeypadLockout attribute of DUT\n"); - if (ShouldSkip("A_KEYPAD_LOCKOUT")) - { - NextTest(); - return; - } - err = TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_8(); - break; - case 9: - ChipLogProgress(chipTool, - " ***** Test Step 9 : Writes a value of 0 to ScheduleProgrammingVisibility attribute of DUT\n"); - if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) - { - NextTest(); - return; - } - err = TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_9(); - break; - case 10: - ChipLogProgress(chipTool, - " ***** Test Step 10 : Writes a value of 1 to ScheduleProgrammingVisibility attribute of DUT\n"); - if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) - { - NextTest(); - return; - } - err = TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_10(); - break; - } + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + void OnSuccessResponse_75(uint32_t rxBeaconRequestCount) + { + VerifyOrReturn(CheckConstraintType("rxBeaconRequestCount", "", "uint32")); + NextTest(); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + CHIP_ERROR TestReadRxOtherCountAttributeValue_76() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_76, OnFailureCallback_76, true)); + return CHIP_NO_ERROR; + } - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnFailureResponse_76(CHIP_ERROR error) { - bool isExpectedDnssdResult = false; + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_76(uint32_t rxOtherCount) + { + VerifyOrReturn(CheckValue("rxOtherCount", rxOtherCount, 0UL)); - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); NextTest(); } - static void OnFailureCallback_1(void * context, CHIP_ERROR error) + CHIP_ERROR TestValidateConstraintsOfAttributeRxOtherCount_77() { - (static_cast(context))->OnFailureResponse_1(error); - } + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_77, OnFailureCallback_77, true)); + return CHIP_NO_ERROR; + } - static void OnFailureCallback_2(void * context, CHIP_ERROR error) + void OnFailureResponse_77(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + void OnSuccessResponse_77(uint32_t rxOtherCount) + { + VerifyOrReturn(CheckConstraintType("rxOtherCount", "", "uint32")); + NextTest(); + } - static void OnFailureCallback_3(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadRxAddressFilteredCountAttributeValue_78() { - (static_cast(context))->OnFailureResponse_3(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_78, OnFailureCallback_78, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + void OnFailureResponse_78(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - static void OnFailureCallback_4(void * context, CHIP_ERROR error) + void OnSuccessResponse_78(uint32_t rxAddressFilteredCount) { - (static_cast(context))->OnFailureResponse_4(error); + VerifyOrReturn(CheckValue("rxAddressFilteredCount", rxAddressFilteredCount, 0UL)); + + NextTest(); } - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } + CHIP_ERROR TestValidateConstraintsOfAttributeRxAddressFilteredCount_79() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnFailureCallback_5(void * context, CHIP_ERROR error) + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_79, OnFailureCallback_79, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_79(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_5(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + void OnSuccessResponse_79(uint32_t rxAddressFilteredCount) + { + VerifyOrReturn(CheckConstraintType("rxAddressFilteredCount", "", "uint32")); + NextTest(); + } - static void OnFailureCallback_6(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadRxDestAddrFilteredCountAttributeValue_80() { - (static_cast(context))->OnFailureResponse_6(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_80, OnFailureCallback_80, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + void OnFailureResponse_80(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - static void OnFailureCallback_7(void * context, CHIP_ERROR error) + void OnSuccessResponse_80(uint32_t rxDestAddrFilteredCount) { - (static_cast(context))->OnFailureResponse_7(error); + VerifyOrReturn(CheckValue("rxDestAddrFilteredCount", rxDestAddrFilteredCount, 0UL)); + + NextTest(); } - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + CHIP_ERROR TestValidateConstraintsOfAttributeRxDestAddrFilteredCount_81() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - static void OnFailureCallback_8(void * context, CHIP_ERROR error) + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_81, OnFailureCallback_81, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_81(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_8(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + void OnSuccessResponse_81(uint32_t rxDestAddrFilteredCount) + { + VerifyOrReturn(CheckConstraintType("rxDestAddrFilteredCount", "", "uint32")); + NextTest(); + } - static void OnFailureCallback_9(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadRxDuplicatedCountAttributeValue_82() { - (static_cast(context))->OnFailureResponse_9(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_82, OnFailureCallback_82, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } + void OnFailureResponse_82(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - static void OnFailureCallback_10(void * context, CHIP_ERROR error) + void OnSuccessResponse_82(uint32_t rxDuplicatedCount) { - (static_cast(context))->OnFailureResponse_10(error); + VerifyOrReturn(CheckValue("rxDuplicatedCount", rxDuplicatedCount, 0UL)); + + NextTest(); } - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + CHIP_ERROR TestValidateConstraintsOfAttributeRxDuplicatedCount_83() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - // - // Tests methods - // + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_83, OnFailureCallback_83, true)); + return CHIP_NO_ERROR; + } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + void OnFailureResponse_83(CHIP_ERROR error) { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - CHIP_ERROR TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1() + void OnSuccessResponse_83(uint32_t rxDuplicatedCount) { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + VerifyOrReturn(CheckConstraintType("rxDuplicatedCount", "", "uint32")); + NextTest(); + } - uint8_t temperatureDisplayModeArgument; - temperatureDisplayModeArgument = 0; + CHIP_ERROR TestReadRxErrNoFrameCountAttributeValue_84() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - temperatureDisplayModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); + cluster.ReadAttribute( + this, OnSuccessCallback_84, OnFailureCallback_84, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_1(CHIP_ERROR error) + void OnFailureResponse_84(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_84(uint32_t rxErrNoFrameCount) + { + VerifyOrReturn(CheckValue("rxErrNoFrameCount", rxErrNoFrameCount, 0UL)); - CHIP_ERROR TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeRxErrNoFrameCount_85() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t temperatureDisplayModeArgument; - temperatureDisplayModeArgument = 1; - ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - temperatureDisplayModeArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + cluster.ReadAttribute( + this, OnSuccessCallback_85, OnFailureCallback_85, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_2(CHIP_ERROR error) + void OnFailureResponse_85(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_85(uint32_t rxErrNoFrameCount) + { + VerifyOrReturn(CheckConstraintType("rxErrNoFrameCount", "", "uint32")); + NextTest(); + } - CHIP_ERROR TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_3() + CHIP_ERROR TestReadRxErrUnknownNeighborCountAttributeValue_86() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 0; - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + cluster.ReadAttribute( + this, OnSuccessCallback_86, OnFailureCallback_86, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_86(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_86(uint32_t rxErrUnknownNeighborCount) + { + VerifyOrReturn(CheckValue("rxErrUnknownNeighborCount", rxErrUnknownNeighborCount, 0UL)); - CHIP_ERROR TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_4() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeRxErrUnknownNeighborCount_87() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 1; - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); + cluster.ReadAttribute( + this, OnSuccessCallback_87, OnFailureCallback_87, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(CHIP_ERROR error) + void OnFailureResponse_87(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_4() { NextTest(); } + void OnSuccessResponse_87(uint32_t rxErrUnknownNeighborCount) + { + VerifyOrReturn(CheckConstraintType("rxErrUnknownNeighborCount", "", "uint32")); + NextTest(); + } - CHIP_ERROR TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_5() + CHIP_ERROR TestReadRxErrInvalidScrAddrCountAttributeValue_88() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 2; - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); + cluster.ReadAttribute( + this, OnSuccessCallback_88, OnFailureCallback_88, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_5(CHIP_ERROR error) + void OnFailureResponse_88(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_5() { NextTest(); } + void OnSuccessResponse_88(uint32_t rxErrInvalidSrcAddrCount) + { + VerifyOrReturn(CheckValue("rxErrInvalidSrcAddrCount", rxErrInvalidSrcAddrCount, 0UL)); - CHIP_ERROR TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_6() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_89() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 3; - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_6, OnFailureCallback_6)); + cluster.ReadAttribute( + this, OnSuccessCallback_89, OnFailureCallback_89, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_89(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_89(uint32_t rxErrInvalidSrcAddrCount) + { + VerifyOrReturn(CheckConstraintType("rxErrInvalidSrcAddrCount", "", "uint32")); + NextTest(); + } - CHIP_ERROR TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_7() + CHIP_ERROR TestReadRxErrSecCountAttributeValue_90() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 4; - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); + cluster.ReadAttribute( + this, OnSuccessCallback_90, OnFailureCallback_90, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(CHIP_ERROR error) + void OnFailureResponse_90(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_7() { NextTest(); } + void OnSuccessResponse_90(uint32_t rxErrSecCount) + { + VerifyOrReturn(CheckValue("rxErrSecCount", rxErrSecCount, 0UL)); - CHIP_ERROR TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_8() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeRxErrInvalidSrcAddrCount_91() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 5; - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + cluster.ReadAttribute( + this, OnSuccessCallback_91, OnFailureCallback_91, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_91(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_8() { NextTest(); } + void OnSuccessResponse_91(uint32_t rxErrSecCount) + { + VerifyOrReturn(CheckConstraintType("rxErrSecCount", "", "uint32")); + NextTest(); + } - CHIP_ERROR TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_9() + CHIP_ERROR TestReadRxErrFcsCountAttributeValue_92() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = 0; - ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - scheduleProgrammingVisibilityArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); + cluster.ReadAttribute( + this, OnSuccessCallback_92, OnFailureCallback_92, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_9(CHIP_ERROR error) + void OnFailureResponse_92(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_9() { NextTest(); } + void OnSuccessResponse_92(uint32_t rxErrFcsCount) + { + VerifyOrReturn(CheckValue("rxErrFcsCount", rxErrFcsCount, 0UL)); - CHIP_ERROR TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_10() + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributeRxErrFcsCount_93() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = 1; - ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - scheduleProgrammingVisibilityArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); + cluster.ReadAttribute( + this, OnSuccessCallback_93, OnFailureCallback_93, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_10(CHIP_ERROR error) + void OnFailureResponse_93(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_10() { NextTest(); } -}; + void OnSuccessResponse_93(uint32_t rxErrFcsCount) + { + VerifyOrReturn(CheckConstraintType("rxErrFcsCount", "", "uint32")); + NextTest(); + } -class Test_TC_DIAG_TH_NW_1_1Suite : public TestCommand -{ -public: - Test_TC_DIAG_TH_NW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_TH_NW_1_1", credsIssuerConfig), mTestIndex(0) + CHIP_ERROR TestReadRxErrOtherCountAttributeValue_94() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_94, OnFailureCallback_94, true)); + return CHIP_NO_ERROR; } - ~Test_TC_DIAG_TH_NW_1_1Suite() {} + void OnFailureResponse_94(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnSuccessResponse_94(uint32_t rxErrOtherCount) { - CHIP_ERROR err = CHIP_NO_ERROR; + VerifyOrReturn(CheckValue("rxErrOtherCount", rxErrOtherCount, 0UL)); - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_TH_NW_1_1\n"); - } + NextTest(); + } - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_TH_NW_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + CHIP_ERROR TestValidateConstraintsOfAttributeRxErrOtherCount_95() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - Wait(); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_95, OnFailureCallback_95, true)); + return CHIP_NO_ERROR; + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Sends ResetCounts command\n"); - err = TestSendsResetCountsCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the Overruncount attribute\n"); - err = TestReadTheOverruncountAttribute_2(); - break; - } + void OnFailureResponse_95(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + void OnSuccessResponse_95(uint32_t rxErrOtherCount) + { + VerifyOrReturn(CheckConstraintType("rxErrOtherCount", "", "uint32")); + NextTest(); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + CHIP_ERROR TestReadActiveTimestampAttributeValue_96() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_96, OnFailureCallback_96, true)); + return CHIP_NO_ERROR; + } - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + void OnFailureResponse_96(CHIP_ERROR error) { - bool isExpectedDnssdResult = false; + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_96(uint64_t activeTimestamp) + { + VerifyOrReturn(CheckValue("activeTimestamp", activeTimestamp, 0ULL)); - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); NextTest(); } - static void OnFailureCallback_2(void * context, CHIP_ERROR error) + CHIP_ERROR TestValidateConstraintsOfAttributeActiveTimestamp_97() { - (static_cast(context))->OnFailureResponse_2(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_97, OnFailureCallback_97, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_2(void * context, uint64_t overrunCount) + void OnFailureResponse_97(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_2(overrunCount); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + void OnSuccessResponse_97(uint64_t activeTimestamp) { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + VerifyOrReturn(CheckConstraintType("activeTimestamp", "", "uint64")); + NextTest(); } - CHIP_ERROR TestSendsResetCountsCommand_1() + CHIP_ERROR TestReadPendingTimestampAttributeValue_98() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; - using RequestType = chip::app::Clusters::ThreadNetworkDiagnostics::Commands::ResetCounts::Type; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_98, OnFailureCallback_98, true)); + return CHIP_NO_ERROR; + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; + void OnFailureResponse_98(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); - }; + void OnSuccessResponse_98(uint64_t pendingTimestamp) + { + VerifyOrReturn(CheckValue("pendingTimestamp", pendingTimestamp, 0ULL)); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + NextTest(); + } + + CHIP_ERROR TestValidateConstraintsOfAttributePendingTimestamp_99() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_99, OnFailureCallback_99, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_1(CHIP_ERROR error) + void OnFailureResponse_99(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_99(uint64_t pendingTimestamp) + { + VerifyOrReturn(CheckConstraintType("pendingTimestamp", "", "uint64")); + NextTest(); + } - CHIP_ERROR TestReadTheOverruncountAttribute_2() + CHIP_ERROR TestReadDelayAttributeValue_100() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_100, OnFailureCallback_100, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_2(CHIP_ERROR error) + void OnFailureResponse_100(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_2(uint64_t overrunCount) + void OnSuccessResponse_100(uint32_t delay) { - VerifyOrReturn(CheckValue("overrunCount", overrunCount, 0ULL)); + VerifyOrReturn(CheckValue("delay", delay, 0UL)); + + NextTest(); + } + CHIP_ERROR TestValidateConstraintsOfAttributeDelay_101() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_101, OnFailureCallback_101, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_101(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_101(uint32_t delay) + { + VerifyOrReturn(CheckConstraintType("delay", "", "uint32")); NextTest(); } }; @@ -86404,6 +89962,7 @@ class Test_TC_SWDIAG_1_1Suite : public TestCommand const chip::app::DataModel::DecodableList & threadMetrics) { + VerifyOrReturn(CheckConstraintType("threadMetrics", "", "list")); NextTest(); } @@ -107808,6 +111367,7 @@ 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), @@ -107830,6 +111390,7 @@ 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),