Skip to content

Commit 5941742

Browse files
bzbarsky-applepull[bot]
authored andcommitted
Align naming in Channel cluster XML with the spec. (#24508)
* Align naming in Channel cluster XML with the spec. * Auto-update ZAP files. * Regenerate generated code. * Address review comment.
1 parent 5029032 commit 5941742

File tree

42 files changed

+448
-389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+448
-389
lines changed

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+5-5
Original file line numberDiff line numberDiff line change
@@ -3198,15 +3198,15 @@ server cluster Channel = 1284 {
31983198
kLineupInfo = 0x2;
31993199
}
32003200

3201-
struct ChannelInfo {
3201+
struct ChannelInfoStruct {
32023202
int16u majorNumber = 0;
32033203
int16u minorNumber = 1;
3204-
optional char_string<32> name = 2;
3205-
optional char_string<32> callSign = 3;
3206-
optional char_string<32> affiliateCallSign = 4;
3204+
optional char_string name = 2;
3205+
optional char_string callSign = 3;
3206+
optional char_string affiliateCallSign = 4;
32073207
}
32083208

3209-
readonly attribute ChannelInfo channelList[] = 0;
3209+
readonly attribute ChannelInfoStruct channelList[] = 0;
32103210
readonly attribute bitmap32 featureMap = 65532;
32113211
readonly attribute int16u clusterRevision = 65533;
32123212
}

examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

+2-2
Original file line numberDiff line numberDiff line change
@@ -17717,7 +17717,7 @@
1771717717
"code": 1,
1771817718
"mfgCode": null,
1771917719
"side": "server",
17720-
"type": "LineupInfo",
17720+
"type": "LineupInfoStruct",
1772117721
"included": 0,
1772217722
"storageOption": "External",
1772317723
"singleton": 0,
@@ -17733,7 +17733,7 @@
1773317733
"code": 2,
1773417734
"mfgCode": null,
1773517735
"side": "server",
17736-
"type": "ChannelInfo",
17736+
"type": "ChannelInfoStruct",
1773717737
"included": 0,
1773817738
"storageOption": "External",
1773917739
"singleton": 0,

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap

+2-2
Original file line numberDiff line numberDiff line change
@@ -17217,7 +17217,7 @@
1721717217
"code": 1,
1721817218
"mfgCode": null,
1721917219
"side": "server",
17220-
"type": "LineupInfo",
17220+
"type": "LineupInfoStruct",
1722117221
"included": 0,
1722217222
"storageOption": "External",
1722317223
"singleton": 0,
@@ -17233,7 +17233,7 @@
1723317233
"code": 2,
1723417234
"mfgCode": null,
1723517235
"side": "server",
17236-
"type": "ChannelInfo",
17236+
"type": "ChannelInfoStruct",
1723717237
"included": 0,
1723817238
"storageOption": "External",
1723917239
"singleton": 0,

examples/thermostat/thermostat-common/thermostat.zap

+2-2
Original file line numberDiff line numberDiff line change
@@ -13253,7 +13253,7 @@
1325313253
"code": 1,
1325413254
"mfgCode": null,
1325513255
"side": "server",
13256-
"type": "LineupInfo",
13256+
"type": "LineupInfoStruct",
1325713257
"included": 1,
1325813258
"storageOption": "RAM",
1325913259
"singleton": 0,
@@ -13269,7 +13269,7 @@
1326913269
"code": 2,
1327013270
"mfgCode": null,
1327113271
"side": "server",
13272-
"type": "ChannelInfo",
13272+
"type": "ChannelInfoStruct",
1327313273
"included": 1,
1327413274
"storageOption": "RAM",
1327513275
"singleton": 0,

examples/tv-app/android/java/ChannelManager.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ CHIP_ERROR ChannelManager::HandleGetChannelList(AttributeValueEncoder & aEncoder
7878

7979
for (jint i = 0; i < length; i++)
8080
{
81-
chip::app::Clusters::Channel::Structs::ChannelInfo::Type channelInfo;
81+
chip::app::Clusters::Channel::Structs::ChannelInfoStruct::Type channelInfo;
8282
jobject channelObject = env->GetObjectArrayElement(channelInfoList, i);
8383
jclass channelClass = env->GetObjectClass(channelObject);
8484

@@ -131,7 +131,7 @@ CHIP_ERROR ChannelManager::HandleGetChannelList(AttributeValueEncoder & aEncoder
131131

132132
CHIP_ERROR ChannelManager::HandleGetLineup(AttributeValueEncoder & aEncoder)
133133
{
134-
chip::app::Clusters::Channel::Structs::LineupInfo::Type lineupInfo;
134+
chip::app::Clusters::Channel::Structs::LineupInfoStruct::Type lineupInfo;
135135
CHIP_ERROR err = CHIP_NO_ERROR;
136136
JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();
137137

@@ -193,7 +193,7 @@ CHIP_ERROR ChannelManager::HandleGetLineup(AttributeValueEncoder & aEncoder)
193193

194194
CHIP_ERROR ChannelManager::HandleGetCurrentChannel(AttributeValueEncoder & aEncoder)
195195
{
196-
chip::app::Clusters::Channel::Structs::ChannelInfo::Type channelInfo;
196+
chip::app::Clusters::Channel::Structs::ChannelInfoStruct::Type channelInfo;
197197
CHIP_ERROR err = CHIP_NO_ERROR;
198198
JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();
199199
ChipLogProgress(Zcl, "Received ChannelManager::HandleGetCurrentChannel");

examples/tv-app/linux/include/channel/ChannelManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ using chip::app::AttributeValueEncoder;
2525
using chip::app::CommandResponseHelper;
2626
using ChannelDelegate = chip::app::Clusters::Channel::Delegate;
2727
using ChangeChannelResponseType = chip::app::Clusters::Channel::Commands::ChangeChannelResponse::Type;
28-
using ChannelInfoType = chip::app::Clusters::Channel::Structs::ChannelInfo::Type;
29-
using LineupInfoType = chip::app::Clusters::Channel::Structs::LineupInfo::Type;
28+
using ChannelInfoType = chip::app::Clusters::Channel::Structs::ChannelInfoStruct::Type;
29+
using LineupInfoType = chip::app::Clusters::Channel::Structs::LineupInfoStruct::Type;
3030

3131
class ChannelManager : public ChannelDelegate
3232
{

examples/tv-app/tv-common/tv-app.matter

+8-8
Original file line numberDiff line numberDiff line change
@@ -1574,24 +1574,24 @@ server cluster Channel = 1284 {
15741574
kLineupInfo = 0x2;
15751575
}
15761576

1577-
struct ChannelInfo {
1577+
struct ChannelInfoStruct {
15781578
int16u majorNumber = 0;
15791579
int16u minorNumber = 1;
1580-
optional char_string<32> name = 2;
1581-
optional char_string<32> callSign = 3;
1582-
optional char_string<32> affiliateCallSign = 4;
1580+
optional char_string name = 2;
1581+
optional char_string callSign = 3;
1582+
optional char_string affiliateCallSign = 4;
15831583
}
15841584

1585-
struct LineupInfo {
1585+
struct LineupInfoStruct {
15861586
char_string operatorName = 0;
15871587
optional char_string lineupName = 1;
15881588
optional char_string postalCode = 2;
15891589
LineupInfoTypeEnum lineupInfoType = 3;
15901590
}
15911591

1592-
readonly attribute ChannelInfo channelList[] = 0;
1593-
readonly attribute nullable LineupInfo lineup = 1;
1594-
readonly attribute nullable ChannelInfo currentChannel = 2;
1592+
readonly attribute ChannelInfoStruct channelList[] = 0;
1593+
readonly attribute nullable LineupInfoStruct lineup = 1;
1594+
readonly attribute nullable ChannelInfoStruct currentChannel = 2;
15951595
readonly attribute command_id generatedCommandList[] = 65528;
15961596
readonly attribute command_id acceptedCommandList[] = 65529;
15971597
readonly attribute attrib_id attributeList[] = 65531;

examples/tv-app/tv-common/tv-app.zap

+4-4
Original file line numberDiff line numberDiff line change
@@ -7737,7 +7737,7 @@
77377737
"code": 1,
77387738
"mfgCode": null,
77397739
"side": "server",
7740-
"type": "LineupInfo",
7740+
"type": "LineupInfoStruct",
77417741
"included": 1,
77427742
"storageOption": "External",
77437743
"singleton": 0,
@@ -7753,7 +7753,7 @@
77537753
"code": 2,
77547754
"mfgCode": null,
77557755
"side": "server",
7756-
"type": "ChannelInfo",
7756+
"type": "ChannelInfoStruct",
77577757
"included": 1,
77587758
"storageOption": "External",
77597759
"singleton": 0,
@@ -10811,7 +10811,7 @@
1081110811
"code": 1,
1081210812
"mfgCode": null,
1081310813
"side": "server",
10814-
"type": "LineupInfo",
10814+
"type": "LineupInfoStruct",
1081510815
"included": 0,
1081610816
"storageOption": "RAM",
1081710817
"singleton": 0,
@@ -10827,7 +10827,7 @@
1082710827
"code": 2,
1082810828
"mfgCode": null,
1082910829
"side": "server",
10830-
"type": "ChannelInfo",
10830+
"type": "ChannelInfoStruct",
1083110831
"included": 0,
1083210832
"storageOption": "RAM",
1083310833
"singleton": 0,

examples/tv-casting-app/tv-casting-common/tv-casting-app.matter

+8-8
Original file line numberDiff line numberDiff line change
@@ -1686,24 +1686,24 @@ client cluster Channel = 1284 {
16861686
kLineupInfo = 0x2;
16871687
}
16881688

1689-
struct ChannelInfo {
1689+
struct ChannelInfoStruct {
16901690
int16u majorNumber = 0;
16911691
int16u minorNumber = 1;
1692-
optional char_string<32> name = 2;
1693-
optional char_string<32> callSign = 3;
1694-
optional char_string<32> affiliateCallSign = 4;
1692+
optional char_string name = 2;
1693+
optional char_string callSign = 3;
1694+
optional char_string affiliateCallSign = 4;
16951695
}
16961696

1697-
struct LineupInfo {
1697+
struct LineupInfoStruct {
16981698
char_string operatorName = 0;
16991699
optional char_string lineupName = 1;
17001700
optional char_string postalCode = 2;
17011701
LineupInfoTypeEnum lineupInfoType = 3;
17021702
}
17031703

1704-
readonly attribute ChannelInfo channelList[] = 0;
1705-
readonly attribute nullable LineupInfo lineup = 1;
1706-
readonly attribute nullable ChannelInfo currentChannel = 2;
1704+
readonly attribute ChannelInfoStruct channelList[] = 0;
1705+
readonly attribute nullable LineupInfoStruct lineup = 1;
1706+
readonly attribute nullable ChannelInfoStruct currentChannel = 2;
17071707
readonly attribute int16u clusterRevision = 65533;
17081708

17091709
request struct ChangeChannelRequest {

examples/tv-casting-app/tv-casting-common/tv-casting-app.zap

+2-2
Original file line numberDiff line numberDiff line change
@@ -12409,7 +12409,7 @@
1240912409
"code": 1,
1241012410
"mfgCode": null,
1241112411
"side": "server",
12412-
"type": "LineupInfo",
12412+
"type": "LineupInfoStruct",
1241312413
"included": 1,
1241412414
"storageOption": "External",
1241512415
"singleton": 0,
@@ -12425,7 +12425,7 @@
1242512425
"code": 2,
1242612426
"mfgCode": null,
1242712427
"side": "server",
12428-
"type": "ChannelInfo",
12428+
"type": "ChannelInfoStruct",
1242912429
"included": 1,
1243012430
"storageOption": "External",
1243112431
"singleton": 0,

src/app/tests/suites/TV_ChannelCluster.yaml

+29-29
Original file line numberDiff line numberDiff line change
@@ -35,32 +35,32 @@ tests:
3535
value:
3636
[
3737
{
38-
majorNumber: 6,
39-
minorNumber: 0,
40-
name: "ABC",
41-
callSign: "KAAL-TV",
42-
affiliateCallSign: "KAAL",
38+
MajorNumber: 6,
39+
MinorNumber: 0,
40+
Name: "ABC",
41+
CallSign: "KAAL-TV",
42+
AffiliateCallSign: "KAAL",
4343
},
4444
{
45-
majorNumber: 9,
46-
minorNumber: 1,
47-
name: "PBS",
48-
callSign: "KCTS-TV",
49-
affiliateCallSign: "KCTS",
45+
MajorNumber: 9,
46+
MinorNumber: 1,
47+
Name: "PBS",
48+
CallSign: "KCTS-TV",
49+
AffiliateCallSign: "KCTS",
5050
},
5151
{
52-
majorNumber: 9,
53-
minorNumber: 2,
54-
name: "PBS Kids",
55-
callSign: "KCTS-TV",
56-
affiliateCallSign: "KCTS",
52+
MajorNumber: 9,
53+
MinorNumber: 2,
54+
Name: "PBS Kids",
55+
CallSign: "KCTS-TV",
56+
AffiliateCallSign: "KCTS",
5757
},
5858
{
59-
majorNumber: 9,
60-
minorNumber: 3,
61-
name: "World Channel",
62-
callSign: "KCTS-TV",
63-
affiliateCallSign: "KCTS",
59+
MajorNumber: 9,
60+
MinorNumber: 3,
61+
Name: "World Channel",
62+
CallSign: "KCTS-TV",
63+
AffiliateCallSign: "KCTS",
6464
},
6565
]
6666

@@ -70,10 +70,10 @@ tests:
7070
response:
7171
value:
7272
{
73-
operatorName: "Comcast",
74-
lineupName: "Comcast King County",
75-
postalCode: "98052",
76-
lineupInfoType: 0,
73+
OperatorName: "Comcast",
74+
LineupName: "Comcast King County",
75+
PostalCode: "98052",
76+
LineupInfoType: 0,
7777
}
7878

7979
- label: "Read attribute current channel"
@@ -82,11 +82,11 @@ tests:
8282
response:
8383
value:
8484
{
85-
majorNumber: 6,
86-
minorNumber: 0,
87-
name: "ABC",
88-
callSign: "KAAL-TV",
89-
affiliateCallSign: "KAAL",
85+
MajorNumber: 6,
86+
MinorNumber: 0,
87+
Name: "ABC",
88+
CallSign: "KAAL-TV",
89+
AffiliateCallSign: "KAAL",
9090
}
9191

9292
- label: "Change Channel Command"

src/app/tests/suites/certification/Test_TC_CHANNEL_5_3.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ tests:
8787
response:
8888
value: [majorNumber: majornumber, minorNumber: minornumber + 1]
8989
constraints:
90-
type: ChannelInfo
90+
type: ChannelInfoStruct

src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml

+21-21
Original file line numberDiff line numberDiff line change
@@ -24,54 +24,54 @@ limitations under the License.
2424
<client init="false" tick="false">true</client>
2525
<server init="false" tick="false">true</server>
2626
<description>This cluster provides an interface for controlling the current Channel on a device.</description>
27-
<attribute side="server" code="0x0000" define="CHANNEL_LIST" type="ARRAY" entryType="ChannelInfo" length="254" writable="false" optional="true">ChannelList</attribute>
28-
<attribute side="server" code="0x0001" define="CHANNEL_LINEUP" type="LineupInfo" default="0x0" isNullable="true" writable="false" optional="true">Lineup</attribute>
29-
<attribute side="server" code="0x0002" define="CHANNEL_CURRENT_CHANNEL" type="ChannelInfo" default="0x0" isNullable="true" writable="false" optional="true">CurrentChannel</attribute>
27+
<attribute side="server" code="0x0000" define="CHANNEL_LIST" type="ARRAY" entryType="ChannelInfoStruct" length="254" writable="false" optional="true">ChannelList</attribute>
28+
<attribute side="server" code="0x0001" define="CHANNEL_LINEUP" type="LineupInfoStruct" default="0x0" isNullable="true" writable="false" optional="true">Lineup</attribute>
29+
<attribute side="server" code="0x0002" define="CHANNEL_CURRENT_CHANNEL" type="ChannelInfoStruct" default="0x0" isNullable="true" writable="false" optional="true">CurrentChannel</attribute>
3030

3131
<command source="client" code="0x00" name="ChangeChannel" response="ChangeChannelResponse" optional="true">
3232
<description>Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. </description>
33-
<arg name="match" type="CHAR_STRING"/>
33+
<arg name="Match" type="CHAR_STRING"/>
3434
</command>
3535

3636
<command source="client" code="0x02" name="ChangeChannelByNumber" optional="false">
3737
<description>Change the channel on the media plaeyer to the channel with the given Number in the ChannelList attribute.</description>
38-
<arg name="majorNumber" type="INT16U"/>
39-
<arg name="minorNumber" type="INT16U"/>
38+
<arg name="MajorNumber" type="INT16U"/>
39+
<arg name="MinorNumber" type="INT16U"/>
4040
</command>
4141

4242
<command source="client" code="0x03" name="SkipChannel" optional="false">
4343
<description>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.</description>
44-
<arg name="count" type="INT16U"/>
44+
<arg name="Count" type="INT16U"/>
4545
</command>
4646

4747
<command source="server" code="0x01" name="ChangeChannelResponse" optional="true">
4848
<description>Upon receipt, this SHALL display the active status of the input list on screen.</description>
49-
<arg name="status" type="ChannelStatusEnum"/>
50-
<arg name="data" type="CHAR_STRING" optional="true"/>
49+
<arg name="Status" type="ChannelStatusEnum"/>
50+
<arg name="Data" type="CHAR_STRING" optional="true"/>
5151
</command>
5252

5353
</cluster>
5454

55-
<struct name="ChannelInfo">
55+
<struct name="ChannelInfoStruct">
5656
<cluster code="0x0504"/>
57-
<item name="majorNumber" type="INT16U"/>
58-
<item name="minorNumber" type="INT16U"/>
59-
<item name="name" type="CHAR_STRING" optional="true" length="32"/>
60-
<item name="callSign" type="CHAR_STRING" optional="true" length="32"/>
61-
<item name="affiliateCallSign" type="CHAR_STRING" optional="true" length="32"/>
57+
<item name="MajorNumber" type="INT16U"/>
58+
<item name="MinorNumber" type="INT16U"/>
59+
<item name="Name" type="CHAR_STRING" optional="true"/>
60+
<item name="CallSign" type="CHAR_STRING" optional="true"/>
61+
<item name="AffiliateCallSign" type="CHAR_STRING" optional="true"/>
6262
</struct>
6363

64-
<struct name="LineupInfo">
64+
<struct name="LineupInfoStruct">
6565
<cluster code="0x0504"/>
66-
<item name="operatorName" type="CHAR_STRING"/>
67-
<item name="lineupName" type="CHAR_STRING" default="" optional="true"/>
68-
<item name="postalCode" type="CHAR_STRING" default="" optional="true"/>
69-
<item name="lineupInfoType" type="LineupInfoTypeEnum"/>
66+
<item name="OperatorName" type="CHAR_STRING"/>
67+
<item name="LineupName" type="CHAR_STRING" default="" optional="true"/>
68+
<item name="PostalCode" type="CHAR_STRING" default="" optional="true"/>
69+
<item name="LineupInfoType" type="LineupInfoTypeEnum"/>
7070
</struct>
7171

7272
<enum name="LineupInfoTypeEnum" type="ENUM8">
7373
<cluster code="0x0504"/>
74-
<item name="Mso" value="0x00"/>
74+
<item name="MSO" value="0x00"/>
7575
</enum>
7676

7777
<enum name="ChannelStatusEnum" type="ENUM8">

0 commit comments

Comments
 (0)