From cfb70324215acbac9f76a86212a09ab4a7d06813 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 21 Sep 2023 11:08:25 -0400 Subject: [PATCH] Undo incompatible change on channel clusters --- .../all-clusters-minimal-app.matter | 2 +- ...ootnode_basicvideoplayer_0ff86e943b.matter | 2 +- .../placeholder/linux/apps/app1/config.matter | 4 +- .../placeholder/linux/apps/app2/config.matter | 4 +- examples/tv-app/tv-common/tv-app.matter | 2 +- .../tv-casting-common/tv-casting-app.matter | 2 +- .../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 +- .../zap-generated/cluster-objects.h | 4 +- .../zap-generated/cluster/Commands.h | 2 +- .../zap-generated/cluster/Commands.h | 4 +- .../zap-generated/test/Commands.h | 42 +++++++++---------- 14 files changed, 39 insertions(+), 39 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 46275f3cf29b1c..d514d42061268a 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 @@ -3183,7 +3183,7 @@ server cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index 7962fe51fb2f3d..d8907397cc26ce 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -1162,7 +1162,7 @@ server cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } response struct ChangeChannelResponse = 1 { diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 218b27b6436ae9..fa283c471267b3 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -5375,7 +5375,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. */ @@ -5438,7 +5438,7 @@ server cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 6caa8b80af491c..78a45b3636cede 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -5334,7 +5334,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. */ @@ -5397,7 +5397,7 @@ server cluster Channel = 1284 { } request struct SkipChannelRequest { - INT16U count = 0; + INT16S count = 0; } command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index dbaf6b0b97b4a5..2f5019a4fd0768 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -1891,7 +1891,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 dd77b9e74e6185..b789255710aacc 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 @@ -1426,7 +1426,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/zap-templates/zcl/data-model/chip/channel-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml index 246b78ff10a1ee..ab70f9c93b5e1a 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 a2646038fd168d..db4326c1145065 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -5839,7 +5839,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 85c9c5ad394b29..ca33a46589350a 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -32647,10 +32647,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 cfa3ef2cbc7437..4a836a0ee0f31f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -105036,7 +105036,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/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 08d0e50de87dcb..2da4c0b7916186 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 @@ -27965,7 +27965,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 & aWriter, TLV::Tag aTag) const; @@ -27980,7 +27980,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 c5546eafec6ee3..a85437d32e538f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -8765,7 +8765,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/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index c56ec60e54b6d8..ad359cde71a567 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -125390,7 +125390,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(); } @@ -125407,7 +125407,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 574bb236a4c8a4..a9fee22507a367 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -75923,7 +75923,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(@"Step 4: TH sends a SkipChannel command to the DUT with a value of 1 Error: %@", err); @@ -118373,7 +118373,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:2U]; + params.count = [NSNumber numberWithShort:2]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Skip Channel Command Error: %@", err); @@ -118425,7 +118425,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:123U]; + params.count = [NSNumber numberWithShort:123]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Skip Channel Command Error: %@", err); @@ -118499,7 +118499,7 @@ 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:1]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 1.2 - Skip Up By 1 Error: %@", err); @@ -118574,7 +118574,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:2U]; + params.count = [NSNumber numberWithShort:2]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 2.2 - Skip Up By 2 Error: %@", err); @@ -118648,7 +118648,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:3U]; + params.count = [NSNumber numberWithShort:3]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 3.2 - Skip Up By 3 Error: %@", err); @@ -118722,7 +118722,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:4U]; + params.count = [NSNumber numberWithShort:4]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 4.2 - Skip Up By 4 Error: %@", err); @@ -118774,7 +118774,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:5U]; + params.count = [NSNumber numberWithShort:5]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 5.2 - Skip Up By 5 Error: %@", err); @@ -118849,7 +118849,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:6U]; + params.count = [NSNumber numberWithShort:6]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 6.2 - Skip Up By 6 Error: %@", err); @@ -118923,7 +118923,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:7U]; + params.count = [NSNumber numberWithShort:7]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 7.2 - Skip Up By 7 Error: %@", err); @@ -118997,7 +118997,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:8U]; + params.count = [NSNumber numberWithShort:8]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 8.2 - Skip Up By 8 Error: %@", err); @@ -119049,7 +119049,7 @@ 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:-1]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 1.2 - Skip Down By 1 Error: %@", err); @@ -119123,7 +119123,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:-2U]; + params.count = [NSNumber numberWithShort:-2]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 2.2 - Skip Down By 2 Error: %@", err); @@ -119197,7 +119197,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:-3U]; + params.count = [NSNumber numberWithShort:-3]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 3.2 - Skip Down By 3 Error: %@", err); @@ -119272,7 +119272,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:-4U]; + params.count = [NSNumber numberWithShort:-4]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 4.2 - Skip Down By 4 Error: %@", err); @@ -119324,7 +119324,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:-5U]; + params.count = [NSNumber numberWithShort:-5]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 5.2 - Skip Down By 5 Error: %@", err); @@ -119398,7 +119398,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:-6U]; + params.count = [NSNumber numberWithShort:-6]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 6.2 - Skip Down By 6 Error: %@", err); @@ -119472,7 +119472,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:-7U]; + params.count = [NSNumber numberWithShort:-7]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 7.2 - Skip Down By 7 Error: %@", err); @@ -119547,7 +119547,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:-8U]; + params.count = [NSNumber numberWithShort:-8]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 8.2 - Skip Down By 8 Error: %@", err); @@ -119599,7 +119599,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:32767U]; + params.count = [NSNumber numberWithShort:32767]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 1.2 - Skip Up By 32,767 Error: %@", err); @@ -119673,7 +119673,7 @@ class TV_ChannelCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:-32768U]; + params.count = [NSNumber numberWithShort:-32768]; [cluster skipChannelWithParams:params completion:^(NSError * _Nullable err) { NSLog(@"Test 1.2 - Skip Down By 32,768 Error: %@", err);