From 4752dccc1364438c2a8077dc06a1e3dc62714ff2 Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Fri, 19 May 2023 14:37:37 +0200 Subject: [PATCH] MediaClusters: Update SkipChannel per issue 26104 (#26501) * MediaClusters: Update SkipChannel per issue 26104 * Update delegate methods * Apply restyle fix * Update cast issue * Update the generated files * Update logic & tests * Apply restyle * Updated code again * Updated tests * Adding random comments just to retrigger restyle * Restyle fix * Update tests * Fix conflicts * Update tests & code * Restyle fix * Update Test due to previous index calculation error * Add fix for tests * Update test & suggestion by Boris * Fix the issue with max value of channels * Simplify the decrease channel formula * Simplify the decrease channel formula * Rebase to the latest code + add Boris suggestion * Simplify code per Boris suggestion --- .../all-clusters-minimal-app.matter | 2 +- .../tv-app/android/java/ChannelManager.cpp | 2 +- examples/tv-app/android/java/ChannelManager.h | 2 +- .../linux/include/channel/ChannelManager.cpp | 29 +- .../linux/include/channel/ChannelManager.h | 2 +- examples/tv-app/tv-common/tv-app.matter | 2 +- .../tv-casting-common/tv-casting-app.matter | 2 +- .../channel-server/channel-delegate.h | 2 +- src/app/tests/suites/TV_ChannelCluster.yaml | 599 ++++++ .../zcl/data-model/chip/channel-cluster.xml | 2 +- .../data_model/controller-clusters.matter | 2 +- .../python/chip/clusters/Objects.py | 4 +- .../CHIP/zap-generated/MTRBaseClusters.mm | 2 +- .../CHIP/zap-generated/MTRClusters.mm | 2 +- .../zap-generated/cluster-objects.h | 4 +- .../zap-generated/cluster/Commands.h | 2 +- .../chip-tool/zap-generated/test/Commands.h | 995 +++++++++- .../zap-generated/cluster/Commands.h | 4 +- .../zap-generated/test/Commands.h | 1726 ++++++++++++++++- 19 files changed, 3321 insertions(+), 64 deletions(-) diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 256f2299e2c686..8069d0f4e2f665 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -3083,7 +3083,7 @@ server cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; diff --git a/examples/tv-app/android/java/ChannelManager.cpp b/examples/tv-app/android/java/ChannelManager.cpp index 84b13eea5a55be..4a8c3524431fd3 100644 --- a/examples/tv-app/android/java/ChannelManager.cpp +++ b/examples/tv-app/android/java/ChannelManager.cpp @@ -330,7 +330,7 @@ bool ChannelManager::HandleChangeChannelByNumber(const uint16_t & majorNumber, c return static_cast(ret); } -bool ChannelManager::HandleSkipChannel(const uint16_t & count) +bool ChannelManager::HandleSkipChannel(const int16_t & count) { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); diff --git a/examples/tv-app/android/java/ChannelManager.h b/examples/tv-app/android/java/ChannelManager.h index 0439900f7c37f2..77221069c30fc1 100644 --- a/examples/tv-app/android/java/ChannelManager.h +++ b/examples/tv-app/android/java/ChannelManager.h @@ -38,7 +38,7 @@ class ChannelManager : public ChannelDelegate void HandleChangeChannel(CommandResponseHelper & helper, const CharSpan & match) override; bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) override; - bool HandleSkipChannel(const uint16_t & count) override; + bool HandleSkipChannel(const int16_t & count) override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; diff --git a/examples/tv-app/linux/include/channel/ChannelManager.cpp b/examples/tv-app/linux/include/channel/ChannelManager.cpp index bc517928e80e4a..9d7c2556e4ece9 100644 --- a/examples/tv-app/linux/include/channel/ChannelManager.cpp +++ b/examples/tv-app/linux/include/channel/ChannelManager.cpp @@ -111,13 +111,19 @@ void ChannelManager::HandleChangeChannel(CommandResponseHelper((count + mCurrentChannelIndex) % mChannels.size()); - mCurrentChannelIndex = newChannelIndex; - mCurrentChannel = mChannels[mCurrentChannelIndex]; + int32_t newChannelIndex = static_cast(count) + static_cast(mCurrentChannelIndex); + uint16_t channelsSize = static_cast(mChannels.size()); + + // handle newChannelIndex out of range. + newChannelIndex = newChannelIndex % channelsSize; + + if (newChannelIndex < 0) + { + newChannelIndex = newChannelIndex + channelsSize; + } + + mCurrentChannelIndex = static_cast(newChannelIndex); + mCurrentChannel = mChannels[mCurrentChannelIndex]; return true; } diff --git a/examples/tv-app/linux/include/channel/ChannelManager.h b/examples/tv-app/linux/include/channel/ChannelManager.h index 0557624a3c408a..326edddc53cc77 100644 --- a/examples/tv-app/linux/include/channel/ChannelManager.h +++ b/examples/tv-app/linux/include/channel/ChannelManager.h @@ -39,7 +39,7 @@ class ChannelManager : public ChannelDelegate void HandleChangeChannel(CommandResponseHelper & helper, const CharSpan & match) override; bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) override; - bool HandleSkipChannel(const uint16_t & count) override; + bool HandleSkipChannel(const int16_t & count) override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index eb909228662b9c..378d4d0aa81ff7 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -1850,7 +1850,7 @@ server cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } response struct ChangeChannelResponse = 1 { diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index cb5ee908d264c7..c66b0783124e69 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -1370,7 +1370,7 @@ client cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ diff --git a/src/app/clusters/channel-server/channel-delegate.h b/src/app/clusters/channel-server/channel-delegate.h index 60f5aba15af1c3..bf2326dfe51aa4 100644 --- a/src/app/clusters/channel-server/channel-delegate.h +++ b/src/app/clusters/channel-server/channel-delegate.h @@ -42,7 +42,7 @@ class Delegate virtual void HandleChangeChannel(CommandResponseHelper & helper, const chip::CharSpan & match) = 0; virtual bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) = 0; - virtual bool HandleSkipChannel(const uint16_t & count) = 0; + virtual bool HandleSkipChannel(const int16_t & count) = 0; bool HasFeature(chip::EndpointId endpoint, ChannelFeature feature); virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 0; diff --git a/src/app/tests/suites/TV_ChannelCluster.yaml b/src/app/tests/suites/TV_ChannelCluster.yaml index 93a01cdc207629..56c09bc81be192 100644 --- a/src/app/tests/suites/TV_ChannelCluster.yaml +++ b/src/app/tests/suites/TV_ChannelCluster.yaml @@ -112,8 +112,607 @@ tests: value: 0 - label: "Skip Channel Command" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 2 + + - label: "Verify that Skip Channel Command set correct current channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + - label: "Skip Channel Command" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 123 + + - label: "Verify that Skip Channel Command set correct current channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + ############################# + # Test Skip Channel Up 1..8 # + ############################# + + - label: "Test 1.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 1.2 - Skip Up By 1" command: "SkipChannel" arguments: values: - name: "Count" value: 1 + + - label: + "Test 1.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 3, + Name: "World Channel", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Up 2 # + + - label: "Test 2.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 2.2 - Skip Up By 2" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 2 + + - label: + "Test 2.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 6, + MinorNumber: 0, + Name: "ABC", + CallSign: "KAAL-TV", + AffiliateCallSign: "KAAL", + } + + # Test Skip Channel Up 3 # + + - label: "Test 3.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 3.2 - Skip Up By 3" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 3 + + - label: + "Test 3.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Up 4 # + + - label: "Test 4.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 4.2 - Skip Up By 4" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 4 + + - label: + "Test 4.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Up 5 # + + - label: "Test 5.2 - Skip Up By 5" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 5 + + - label: + "Test 5.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 3, + Name: "World Channel", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Up 6 # + + - label: "Test 6.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 6.2 - Skip Up By 6" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 6 + + - label: + "Test 6.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 6, + MinorNumber: 0, + Name: "ABC", + CallSign: "KAAL-TV", + AffiliateCallSign: "KAAL", + } + + # Test Skip Channel Up 7 # + + - label: "Test 7.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 7.2 - Skip Up By 7" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 7 + + - label: + "Test 7.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Up 8 # + + - label: "Test 8.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 8.2 - Skip Up By 8" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 8 + + - label: + "Test 8.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + ############################### + # Test Skip Channel Down 1..8 # + ############################### + + - label: "Test 1.2 - Skip Down By 1" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -1 + + - label: + "Test 1.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Down 2 # + + - label: "Test 2.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 2.2 - Skip Down By 2" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -2 + + - label: + "Test 2.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 6, + MinorNumber: 0, + Name: "ABC", + CallSign: "KAAL-TV", + AffiliateCallSign: "KAAL", + } + + # Test Skip Channel Down 3 # + + - label: "Test 3.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 3.2 - Skip Down By 3" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -3 + + - label: + "Test 3.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 3, + Name: "World Channel", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Down 4 # + + - label: "Test 4.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 4.2 - Skip Down By 4" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -4 + + - label: + "Test 4.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Down 5 # + + - label: "Test 5.2 - Skip Down By 5" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -5 + + - label: + "Test 5.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Down 6 # + + - label: "Test 6.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 6.2 - Skip Down By 6" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -6 + + - label: + "Test 6.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 6, + MinorNumber: 0, + Name: "ABC", + CallSign: "KAAL-TV", + AffiliateCallSign: "KAAL", + } + + # Test Skip Channel Down 7 # + + - label: "Test 7.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 7.2 - Skip Down By 7" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -7 + + - label: + "Test 7.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 3, + Name: "World Channel", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + # Test Skip Channel Down 8 # + + - label: "Test 8.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 8.2 - Skip Down By 8" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -8 + + - label: + "Test 8.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + ############################### + # Test Skip Channel Up 32,767 # + ############################### + + - label: "Test 1.2 - Skip Up By 32,767" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: 32767 + + - label: + "Test 1.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 1, + Name: "PBS", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } + + ################################# + # Test Skip Channel Down 32,768 # + ################################# + + - label: "Test 1.1 - Start from Channel 3" + command: "ChangeChannelByNumber" + arguments: + values: + - name: "MajorNumber" + value: 9 + - name: "MinorNumber" + value: 2 + + - label: "Test 1.2 - Skip Down By 32,768" + command: "SkipChannel" + arguments: + values: + - name: "Count" + value: -32768 + + - label: + "Test 1.3 - Verify that Skip Channel Command set correct current + channel" + command: "readAttribute" + attribute: "CurrentChannel" + response: + value: + { + MajorNumber: 9, + MinorNumber: 2, + Name: "PBS Kids", + CallSign: "KCTS-TV", + AffiliateCallSign: "KCTS", + } diff --git a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml index 47ac01d7eb5cc1..97ffeefe64b424 100644 --- a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml @@ -41,7 +41,7 @@ limitations under the License. This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index f1f4eb2bdf4cca..86d336bbaa0226 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -5026,7 +5026,7 @@ client cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 0b2a818f8ed959..709c549fce833c 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -28124,10 +28124,10 @@ class SkipChannel(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="count", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="count", Tag=0, Type=int), ]) - count: 'uint' = 0 + count: 'int' = 0 class Attributes: @dataclass diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index c72f186934b01b..2d4cd5b362a8d8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -93960,7 +93960,7 @@ - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params compl invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); } } - request.count = params.count.unsignedShortValue; + request.count = params.count.shortValue; return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 70c0811649afc8..518e1951426d64 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -25434,7 +25434,7 @@ - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); } } - request.count = params.count.unsignedShortValue; + request.count = params.count.shortValue; return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index f712d1fc4df4e6..fa8de958fb201f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -24799,7 +24799,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::SkipChannel::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } - uint16_t count = static_cast(0); + int16_t count = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -24814,7 +24814,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::SkipChannel::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } - uint16_t count = static_cast(0); + int16_t count = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace SkipChannel diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 728f0c8f4ab04a..d9f38d3d821d35 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -7141,7 +7141,7 @@ class ChannelSkipChannel : public ClusterCommand public: ChannelSkipChannel(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("skip-channel", credsIssuerConfig) { - AddArgument("Count", 0, UINT16_MAX, &mRequest.count); + AddArgument("Count", INT16_MIN, INT16_MAX, &mRequest.count); ClusterCommand::AddArguments(); } diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index ab7ca592e76553..89e38aeae44aff 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -36758,7 +36758,7 @@ class Test_TC_CHANNEL_5_3Suite : public TestCommand VerifyOrDo(!ShouldSkip("CHANNEL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Channel::Commands::SkipChannel::Type value; - value.count = 1U; + value.count = 1; return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, chip::NullOptional @@ -60634,7 +60634,7 @@ class TV_MediaPlaybackClusterSuite : public TestCommand class TV_ChannelClusterSuite : public TestCommand { public: - TV_ChannelClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TV_ChannelCluster", 7, credsIssuerConfig) + TV_ChannelClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TV_ChannelCluster", 60, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -60782,74 +60782,997 @@ class TV_ChannelClusterSuite : public TestCommand case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 6U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 0U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("ABC", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KAAL-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KAAL", 4))); + } + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 3U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("World Channel", 13))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 1U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS", 3))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("currentChannel", value)); + VerifyOrReturn(CheckValue("currentChannel.Value().majorNumber", value.Value().majorNumber, 9U)); + VerifyOrReturn(CheckValue("currentChannel.Value().minorNumber", value.Value().minorNumber, 2U)); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().name", value.Value().name)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().name.Value()", value.Value().name.Value(), + chip::CharSpan("PBS Kids", 8))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().callSign", value.Value().callSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().callSign.Value()", value.Value().callSign.Value(), + chip::CharSpan("KCTS-TV", 7))); + VerifyOrReturn(CheckValuePresent("currentChannel.Value().affiliateCallSign", value.Value().affiliateCallSign)); + VerifyOrReturn(CheckValueAsString("currentChannel.Value().affiliateCallSign.Value()", + value.Value().affiliateCallSign.Value(), chip::CharSpan("KCTS", 4))); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read attribute Channel list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ChannelList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute channel lineup"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::Lineup::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read attribute current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Change Channel Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannel::Type value; + value.match = chip::Span("PBSgarbage: not in length on purpose", 3); + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannel::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Change Channel By Number Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 6U; + value.minorNumber = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Skip Channel Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 2; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Skip Channel Command"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 123; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Test 1.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Test 1.2 - Skip Up By 1"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 1; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Test 2.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Test 2.2 - Skip Up By 2"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 2; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Test 2.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Test 3.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Test 3.2 - Skip Up By 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 3; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Test 3.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Test 4.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Test 4.2 - Skip Up By 4"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 4; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Test 4.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "Test 5.2 - Skip Up By 5"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 5; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); } - } + case 23: { + LogStep(23, "Test 5.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Test 6.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); + ); + } + case 25: { + LogStep(25, "Test 6.2 - Skip Up By 6"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee(kIdentityAlpha, value); + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 6; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); } - case 1: { - LogStep(1, "Read attribute Channel list"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::ChannelList::Id, true, + case 26: { + LogStep(26, "Test 6.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, chip::NullOptional); } - case 2: { - LogStep(2, "Read attribute channel lineup"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::Lineup::Id, true, + case 27: { + LogStep(27, "Test 7.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Test 7.2 - Skip Up By 7"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 7; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 29: { + LogStep(29, "Test 7.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, chip::NullOptional); } - case 3: { - LogStep(3, "Read attribute current channel"); + case 30: { + LogStep(30, "Test 8.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 31: { + LogStep(31, "Test 8.2 - Skip Up By 8"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 8; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 32: { + LogStep(32, "Test 8.3 - Verify that Skip Channel Command set correct current channel"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, chip::NullOptional); } - case 4: { - LogStep(4, "Change Channel Command"); + case 33: { + LogStep(33, "Test 1.2 - Skip Down By 1"); ListFreer listFreer; - chip::app::Clusters::Channel::Commands::ChangeChannel::Type value; - value.match = chip::Span("PBSgarbage: not in length on purpose", 3); - return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannel::Id, value, + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -1; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, chip::NullOptional ); } - case 5: { - LogStep(5, "Change Channel By Number Command"); + case 34: { + LogStep(34, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 35: { + LogStep(35, "Test 2.1 - Start from Channel 3"); ListFreer listFreer; chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; - value.majorNumber = 6U; - value.minorNumber = 0U; + value.majorNumber = 9U; + value.minorNumber = 2U; return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, chip::NullOptional ); } - case 6: { - LogStep(6, "Skip Channel Command"); + case 36: { + LogStep(36, "Test 2.2 - Skip Down By 2"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -2; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 37: { + LogStep(37, "Test 2.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 38: { + LogStep(38, "Test 3.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 39: { + LogStep(39, "Test 3.2 - Skip Down By 3"); ListFreer listFreer; chip::app::Clusters::Channel::Commands::SkipChannel::Type value; - value.count = 1U; + value.count = -3; return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, chip::NullOptional ); } + case 40: { + LogStep(40, "Test 3.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 41: { + LogStep(41, "Test 4.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 42: { + LogStep(42, "Test 4.2 - Skip Down By 4"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -4; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 43: { + LogStep(43, "Test 4.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, "Test 5.2 - Skip Down By 5"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -5; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 45: { + LogStep(45, "Test 5.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 46: { + LogStep(46, "Test 6.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 47: { + LogStep(47, "Test 6.2 - Skip Down By 6"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -6; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 48: { + LogStep(48, "Test 6.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 49: { + LogStep(49, "Test 7.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 50: { + LogStep(50, "Test 7.2 - Skip Down By 7"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -7; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 51: { + LogStep(51, "Test 7.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 52: { + LogStep(52, "Test 8.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 53: { + LogStep(53, "Test 8.2 - Skip Down By 8"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -8; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 54: { + LogStep(54, "Test 8.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 55: { + LogStep(55, "Test 1.2 - Skip Up By 32,767"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = 32767; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 56: { + LogStep(56, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } + case 57: { + LogStep(57, "Test 1.1 - Start from Channel 3"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type value; + value.majorNumber = 9U; + value.minorNumber = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::ChangeChannelByNumber::Id, value, + chip::NullOptional + + ); + } + case 58: { + LogStep(58, "Test 1.2 - Skip Down By 32,768"); + ListFreer listFreer; + chip::app::Clusters::Channel::Commands::SkipChannel::Type value; + value.count = -32768; + return SendCommand(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Commands::SkipChannel::Id, value, + chip::NullOptional + + ); + } + case 59: { + LogStep(59, "Test 1.3 - Verify that Skip Channel Command set correct current channel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Channel::Id, Channel::Attributes::CurrentChannel::Id, true, + chip::NullOptional); + } } return CHIP_NO_ERROR; } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index b69c3ef1dcbf1b..520ff1615daf13 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -84346,7 +84346,7 @@ class ChannelSkipChannel : public ClusterCommand { ChannelSkipChannel() : ClusterCommand("skip-channel") { - AddArgument("Count", 0, UINT16_MAX, &mRequest.count); + AddArgument("Count", INT16_MIN, INT16_MAX, &mRequest.count); ClusterCommand::AddArguments(); } @@ -84359,7 +84359,7 @@ class ChannelSkipChannel : public ClusterCommand { __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.count = [NSNumber numberWithUnsignedShort:mRequest.count]; + params.count = [NSNumber numberWithShort:mRequest.count]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 589e59669133b4..39eb96909bb5de 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -49337,7 +49337,7 @@ class Test_TC_CHANNEL_5_3 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:1U]; + params.count = [NSNumber numberWithShort:1]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Sends a SkipChannel command to the DUT Error: %@", err); @@ -83573,6 +83573,236 @@ class TV_ChannelCluster : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 6 : Skip Channel Command\n"); err = TestSkipChannelCommand_6(); break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Verify that Skip Channel Command set correct current channel\n"); + err = TestVerifyThatSkipChannelCommandSetCorrectCurrentChannel_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Skip Channel Command\n"); + err = TestSkipChannelCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Verify that Skip Channel Command set correct current channel\n"); + err = TestVerifyThatSkipChannelCommandSetCorrectCurrentChannel_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Test 1.1 - Start from Channel 3\n"); + err = TestTest11StartFromChannel3_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Test 1.2 - Skip Up By 1\n"); + err = TestTest12SkipUpBy1_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Test 1.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Test 2.1 - Start from Channel 3\n"); + err = TestTest21StartFromChannel3_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Test 2.2 - Skip Up By 2\n"); + err = TestTest22SkipUpBy2_14(); + break; + case 15: + ChipLogProgress( + chipTool, " ***** Test Step 15 : Test 2.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest23VerifyThatSkipChannelCommandSetCorrectCurrentChannel_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Test 3.1 - Start from Channel 3\n"); + err = TestTest31StartFromChannel3_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Test 3.2 - Skip Up By 3\n"); + err = TestTest32SkipUpBy3_17(); + break; + case 18: + ChipLogProgress( + chipTool, " ***** Test Step 18 : Test 3.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest33VerifyThatSkipChannelCommandSetCorrectCurrentChannel_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Test 4.1 - Start from Channel 3\n"); + err = TestTest41StartFromChannel3_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Test 4.2 - Skip Up By 4\n"); + err = TestTest42SkipUpBy4_20(); + break; + case 21: + ChipLogProgress( + chipTool, " ***** Test Step 21 : Test 4.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest43VerifyThatSkipChannelCommandSetCorrectCurrentChannel_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Test 5.2 - Skip Up By 5\n"); + err = TestTest52SkipUpBy5_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Test 5.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest53VerifyThatSkipChannelCommandSetCorrectCurrentChannel_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Test 6.1 - Start from Channel 3\n"); + err = TestTest61StartFromChannel3_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Test 6.2 - Skip Up By 6\n"); + err = TestTest62SkipUpBy6_25(); + break; + case 26: + ChipLogProgress( + chipTool, " ***** Test Step 26 : Test 6.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest63VerifyThatSkipChannelCommandSetCorrectCurrentChannel_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Test 7.1 - Start from Channel 3\n"); + err = TestTest71StartFromChannel3_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Test 7.2 - Skip Up By 7\n"); + err = TestTest72SkipUpBy7_28(); + break; + case 29: + ChipLogProgress( + chipTool, " ***** Test Step 29 : Test 7.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest73VerifyThatSkipChannelCommandSetCorrectCurrentChannel_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Test 8.1 - Start from Channel 3\n"); + err = TestTest81StartFromChannel3_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Test 8.2 - Skip Up By 8\n"); + err = TestTest82SkipUpBy8_31(); + break; + case 32: + ChipLogProgress( + chipTool, " ***** Test Step 32 : Test 8.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest83VerifyThatSkipChannelCommandSetCorrectCurrentChannel_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Test 1.2 - Skip Down By 1\n"); + err = TestTest12SkipDownBy1_33(); + break; + case 34: + ChipLogProgress( + chipTool, " ***** Test Step 34 : Test 1.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Test 2.1 - Start from Channel 3\n"); + err = TestTest21StartFromChannel3_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Test 2.2 - Skip Down By 2\n"); + err = TestTest22SkipDownBy2_36(); + break; + case 37: + ChipLogProgress( + chipTool, " ***** Test Step 37 : Test 2.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest23VerifyThatSkipChannelCommandSetCorrectCurrentChannel_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Test 3.1 - Start from Channel 3\n"); + err = TestTest31StartFromChannel3_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Test 3.2 - Skip Down By 3\n"); + err = TestTest32SkipDownBy3_39(); + break; + case 40: + ChipLogProgress( + chipTool, " ***** Test Step 40 : Test 3.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest33VerifyThatSkipChannelCommandSetCorrectCurrentChannel_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Test 4.1 - Start from Channel 3\n"); + err = TestTest41StartFromChannel3_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Test 4.2 - Skip Down By 4\n"); + err = TestTest42SkipDownBy4_42(); + break; + case 43: + ChipLogProgress( + chipTool, " ***** Test Step 43 : Test 4.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest43VerifyThatSkipChannelCommandSetCorrectCurrentChannel_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Test 5.2 - Skip Down By 5\n"); + err = TestTest52SkipDownBy5_44(); + break; + case 45: + ChipLogProgress( + chipTool, " ***** Test Step 45 : Test 5.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest53VerifyThatSkipChannelCommandSetCorrectCurrentChannel_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Test 6.1 - Start from Channel 3\n"); + err = TestTest61StartFromChannel3_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Test 6.2 - Skip Down By 6\n"); + err = TestTest62SkipDownBy6_47(); + break; + case 48: + ChipLogProgress( + chipTool, " ***** Test Step 48 : Test 6.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest63VerifyThatSkipChannelCommandSetCorrectCurrentChannel_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Test 7.1 - Start from Channel 3\n"); + err = TestTest71StartFromChannel3_49(); + break; + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Test 7.2 - Skip Down By 7\n"); + err = TestTest72SkipDownBy7_50(); + break; + case 51: + ChipLogProgress( + chipTool, " ***** Test Step 51 : Test 7.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest73VerifyThatSkipChannelCommandSetCorrectCurrentChannel_51(); + break; + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : Test 8.1 - Start from Channel 3\n"); + err = TestTest81StartFromChannel3_52(); + break; + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Test 8.2 - Skip Down By 8\n"); + err = TestTest82SkipDownBy8_53(); + break; + case 54: + ChipLogProgress( + chipTool, " ***** Test Step 54 : Test 8.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest83VerifyThatSkipChannelCommandSetCorrectCurrentChannel_54(); + break; + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Test 1.2 - Skip Up By 32,767\n"); + err = TestTest12SkipUpBy32767_55(); + break; + case 56: + ChipLogProgress( + chipTool, " ***** Test Step 56 : Test 1.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_56(); + break; + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : Test 1.1 - Start from Channel 3\n"); + err = TestTest11StartFromChannel3_57(); + break; + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : Test 1.2 - Skip Down By 32,768\n"); + err = TestTest12SkipDownBy32768_58(); + break; + case 59: + ChipLogProgress( + chipTool, " ***** Test Step 59 : Test 1.3 - Verify that Skip Channel Command set correct current channel\n"); + err = TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_59(); + break; } if (CHIP_NO_ERROR != err) { @@ -83605,6 +83835,165 @@ class TV_ChannelCluster : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -83618,7 +84007,7 @@ class TV_ChannelCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 60; chip::Optional mNodeId; chip::Optional mCluster; @@ -83810,7 +84199,59 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:1U]; + params.count = [NSNumber numberWithShort:2]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Skip Channel Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatSkipChannelCommandSetCorrectCurrentChannel_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSkipChannelCommand_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:123]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Skip Channel Command Error: %@", err); @@ -83822,6 +84263,1285 @@ class TV_ChannelCluster : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestVerifyThatSkipChannelCommandSetCorrectCurrentChannel_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest11StartFromChannel3_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest12SkipUpBy1_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:1]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.2 - Skip Up By 1 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 1.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 3U)); + VerifyOrReturn( + CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"World Channel")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest21StartFromChannel3_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 2.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest22SkipUpBy2_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:2]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 2.2 - Skip Up By 2 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest23VerifyThatSkipChannelCommandSetCorrectCurrentChannel_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 2.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 6U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KAAL")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest31StartFromChannel3_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 3.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest32SkipUpBy3_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:3]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 3.2 - Skip Up By 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest33VerifyThatSkipChannelCommandSetCorrectCurrentChannel_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 3.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest41StartFromChannel3_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 4.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest42SkipUpBy4_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:4]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 4.2 - Skip Up By 4 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest43VerifyThatSkipChannelCommandSetCorrectCurrentChannel_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 4.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest52SkipUpBy5_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:5]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 5.2 - Skip Up By 5 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest53VerifyThatSkipChannelCommandSetCorrectCurrentChannel_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 5.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 3U)); + VerifyOrReturn( + CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"World Channel")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest61StartFromChannel3_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 6.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest62SkipUpBy6_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:6]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 6.2 - Skip Up By 6 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest63VerifyThatSkipChannelCommandSetCorrectCurrentChannel_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 6.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 6U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KAAL")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest71StartFromChannel3_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 7.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest72SkipUpBy7_28() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:7]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 7.2 - Skip Up By 7 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest73VerifyThatSkipChannelCommandSetCorrectCurrentChannel_29() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 7.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest81StartFromChannel3_30() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 8.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest82SkipUpBy8_31() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:8]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 8.2 - Skip Up By 8 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest83VerifyThatSkipChannelCommandSetCorrectCurrentChannel_32() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 8.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest12SkipDownBy1_33() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-1]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.2 - Skip Down By 1 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_34() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 1.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest21StartFromChannel3_35() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 2.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest22SkipDownBy2_36() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-2]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 2.2 - Skip Down By 2 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest23VerifyThatSkipChannelCommandSetCorrectCurrentChannel_37() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 2.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 6U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KAAL")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest31StartFromChannel3_38() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 3.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest32SkipDownBy3_39() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-3]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 3.2 - Skip Down By 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest33VerifyThatSkipChannelCommandSetCorrectCurrentChannel_40() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 3.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 3U)); + VerifyOrReturn( + CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"World Channel")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest41StartFromChannel3_41() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 4.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest42SkipDownBy4_42() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-4]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 4.2 - Skip Down By 4 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest43VerifyThatSkipChannelCommandSetCorrectCurrentChannel_43() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 4.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest52SkipDownBy5_44() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-5]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 5.2 - Skip Down By 5 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest53VerifyThatSkipChannelCommandSetCorrectCurrentChannel_45() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 5.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest61StartFromChannel3_46() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 6.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest62SkipDownBy6_47() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-6]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 6.2 - Skip Down By 6 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest63VerifyThatSkipChannelCommandSetCorrectCurrentChannel_48() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 6.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 6U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 0U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"ABC")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KAAL-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KAAL")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest71StartFromChannel3_49() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 7.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest72SkipDownBy7_50() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-7]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 7.2 - Skip Down By 7 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest73VerifyThatSkipChannelCommandSetCorrectCurrentChannel_51() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 7.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 3U)); + VerifyOrReturn( + CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"World Channel")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest81StartFromChannel3_52() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 8.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest82SkipDownBy8_53() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-8]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 8.2 - Skip Down By 8 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest83VerifyThatSkipChannelCommandSetCorrectCurrentChannel_54() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 8.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest12SkipUpBy32767_55() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:32767]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.2 - Skip Up By 32,767 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_56() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 1.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 1U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest11StartFromChannel3_57() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = [NSNumber numberWithUnsignedShort:2U]; + [cluster changeChannelByNumberWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.1 - Start from Channel 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest12SkipDownBy32768_58() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithShort:-32768]; + [cluster skipChannelWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Test 1.2 - Skip Down By 32,768 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTest13VerifyThatSkipChannelCommandSetCorrectCurrentChannel_59() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletion:^( + MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test 1.3 - Verify that Skip Channel Command set correct current channel Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("MajorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).majorNumber, 9U)); + VerifyOrReturn(CheckValue("MinorNumber", ((MTRChannelClusterChannelInfoStruct *) actualValue).minorNumber, 2U)); + VerifyOrReturn(CheckValueAsString("Name", ((MTRChannelClusterChannelInfoStruct *) actualValue).name, @"PBS Kids")); + VerifyOrReturn( + CheckValueAsString("CallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).callSign, @"KCTS-TV")); + VerifyOrReturn(CheckValueAsString( + "AffiliateCallSign", ((MTRChannelClusterChannelInfoStruct *) actualValue).affiliateCallSign, @"KCTS")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class TV_LowPowerCluster : public TestCommandBridge {