Skip to content

Commit 1484986

Browse files
andy31415pull[bot]
authored andcommitted
Make Media Input Cluster match the spec (#30060)
* Change media input xml to spec * Zap regen * minor change to kick CI * minor change to kick CI (featuremap already supported)
1 parent c55e415 commit 1484986

File tree

9 files changed

+33
-29
lines changed

9 files changed

+33
-29
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -3283,8 +3283,8 @@ server cluster MediaInput = 1287 {
32833283
struct InputInfoStruct {
32843284
int8u index = 0;
32853285
InputTypeEnum inputType = 1;
3286-
char_string<32> name = 2;
3287-
char_string<32> description = 3;
3286+
char_string name = 2;
3287+
char_string description = 3;
32883288
}
32893289

32903290
readonly attribute InputInfoStruct inputList[] = 0;

examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter

+2-2
Original file line numberDiff line numberDiff line change
@@ -1259,8 +1259,8 @@ server cluster MediaInput = 1287 {
12591259
struct InputInfoStruct {
12601260
int8u index = 0;
12611261
InputTypeEnum inputType = 1;
1262-
char_string<32> name = 2;
1263-
char_string<32> description = 3;
1262+
char_string name = 2;
1263+
char_string description = 3;
12641264
}
12651265

12661266
readonly attribute InputInfoStruct inputList[] = 0;

examples/placeholder/linux/apps/app1/config.matter

+6-6
Original file line numberDiff line numberDiff line change
@@ -5666,8 +5666,8 @@ client cluster MediaInput = 1287 {
56665666
struct InputInfoStruct {
56675667
int8u index = 0;
56685668
InputTypeEnum inputType = 1;
5669-
char_string<32> name = 2;
5670-
char_string<32> description = 3;
5669+
char_string name = 2;
5670+
char_string description = 3;
56715671
}
56725672

56735673
readonly attribute InputInfoStruct inputList[] = 0;
@@ -5695,7 +5695,7 @@ client cluster MediaInput = 1287 {
56955695
/** Upon receipt, this SHALL hide the input list from the screen. */
56965696
command HideInputStatus(): DefaultSuccess = 2;
56975697
/** Upon receipt, this SHALL rename the input at a specific index in the Input List. Updates to the input name SHALL appear in the TV settings menus. */
5698-
command RenameInput(RenameInputRequest): DefaultSuccess = 3;
5698+
command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
56995699
}
57005700

57015701
/** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */
@@ -5722,8 +5722,8 @@ server cluster MediaInput = 1287 {
57225722
struct InputInfoStruct {
57235723
int8u index = 0;
57245724
InputTypeEnum inputType = 1;
5725-
char_string<32> name = 2;
5726-
char_string<32> description = 3;
5725+
char_string name = 2;
5726+
char_string description = 3;
57275727
}
57285728

57295729
readonly attribute InputInfoStruct inputList[] = 0;
@@ -5747,7 +5747,7 @@ server cluster MediaInput = 1287 {
57475747
command SelectInput(SelectInputRequest): DefaultSuccess = 0;
57485748
command ShowInputStatus(): DefaultSuccess = 1;
57495749
command HideInputStatus(): DefaultSuccess = 2;
5750-
command RenameInput(RenameInputRequest): DefaultSuccess = 3;
5750+
command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
57515751
}
57525752

57535753
/** This cluster provides an interface for managing low power mode on a device. */

examples/placeholder/linux/apps/app2/config.matter

+6-6
Original file line numberDiff line numberDiff line change
@@ -5625,8 +5625,8 @@ client cluster MediaInput = 1287 {
56255625
struct InputInfoStruct {
56265626
int8u index = 0;
56275627
InputTypeEnum inputType = 1;
5628-
char_string<32> name = 2;
5629-
char_string<32> description = 3;
5628+
char_string name = 2;
5629+
char_string description = 3;
56305630
}
56315631

56325632
readonly attribute InputInfoStruct inputList[] = 0;
@@ -5654,7 +5654,7 @@ client cluster MediaInput = 1287 {
56545654
/** Upon receipt, this SHALL hide the input list from the screen. */
56555655
command HideInputStatus(): DefaultSuccess = 2;
56565656
/** Upon receipt, this SHALL rename the input at a specific index in the Input List. Updates to the input name SHALL appear in the TV settings menus. */
5657-
command RenameInput(RenameInputRequest): DefaultSuccess = 3;
5657+
command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
56585658
}
56595659

56605660
/** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */
@@ -5681,8 +5681,8 @@ server cluster MediaInput = 1287 {
56815681
struct InputInfoStruct {
56825682
int8u index = 0;
56835683
InputTypeEnum inputType = 1;
5684-
char_string<32> name = 2;
5685-
char_string<32> description = 3;
5684+
char_string name = 2;
5685+
char_string description = 3;
56865686
}
56875687

56885688
readonly attribute InputInfoStruct inputList[] = 0;
@@ -5706,7 +5706,7 @@ server cluster MediaInput = 1287 {
57065706
command SelectInput(SelectInputRequest): DefaultSuccess = 0;
57075707
command ShowInputStatus(): DefaultSuccess = 1;
57085708
command HideInputStatus(): DefaultSuccess = 2;
5709-
command RenameInput(RenameInputRequest): DefaultSuccess = 3;
5709+
command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
57105710
}
57115711

57125712
/** This cluster provides an interface for managing low power mode on a device. */

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -2026,8 +2026,8 @@ server cluster MediaInput = 1287 {
20262026
struct InputInfoStruct {
20272027
int8u index = 0;
20282028
InputTypeEnum inputType = 1;
2029-
char_string<32> name = 2;
2030-
char_string<32> description = 3;
2029+
char_string name = 2;
2030+
char_string description = 3;
20312031
}
20322032

20332033
readonly attribute InputInfoStruct inputList[] = 0;
@@ -2051,7 +2051,7 @@ server cluster MediaInput = 1287 {
20512051
command SelectInput(SelectInputRequest): DefaultSuccess = 0;
20522052
command ShowInputStatus(): DefaultSuccess = 1;
20532053
command HideInputStatus(): DefaultSuccess = 2;
2054-
command RenameInput(RenameInputRequest): DefaultSuccess = 3;
2054+
command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
20552055
}
20562056

20572057
/** This cluster provides an interface for managing low power mode on a device. */

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1560,8 +1560,8 @@ client cluster MediaInput = 1287 {
15601560
struct InputInfoStruct {
15611561
int8u index = 0;
15621562
InputTypeEnum inputType = 1;
1563-
char_string<32> name = 2;
1564-
char_string<32> description = 3;
1563+
char_string name = 2;
1564+
char_string description = 3;
15651565
}
15661566

15671567
readonly attribute InputInfoStruct inputList[] = 0;
@@ -1589,7 +1589,7 @@ client cluster MediaInput = 1287 {
15891589
/** Upon receipt, this SHALL hide the input list from the screen. */
15901590
command HideInputStatus(): DefaultSuccess = 2;
15911591
/** Upon receipt, this SHALL rename the input at a specific index in the Input List. Updates to the input name SHALL appear in the TV settings menus. */
1592-
command RenameInput(RenameInputRequest): DefaultSuccess = 3;
1592+
command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
15931593
}
15941594

15951595
/** This cluster provides an interface for managing low power mode on a device. */

scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h

+3
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@
437437
0x00000101, /* Cluster: Door Lock, Command: SetCredential, Privilege: administer */ \
438438
0x00000101, /* Cluster: Door Lock, Command: GetCredentialStatus, Privilege: administer */ \
439439
0x00000101, /* Cluster: Door Lock, Command: ClearCredential, Privilege: administer */ \
440+
0x00000507, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \
440441
0xFFF1FC06, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \
441442
0xFFF1FC06, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \
442443
}
@@ -490,6 +491,7 @@
490491
0x00000022, /* Cluster: Door Lock, Command: SetCredential, Privilege: administer */ \
491492
0x00000024, /* Cluster: Door Lock, Command: GetCredentialStatus, Privilege: administer */ \
492493
0x00000026, /* Cluster: Door Lock, Command: ClearCredential, Privilege: administer */ \
494+
0x00000003, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \
493495
0x00000000, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \
494496
0x00000001, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \
495497
}
@@ -543,6 +545,7 @@
543545
kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: SetCredential, Privilege: administer */ \
544546
kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: GetCredentialStatus, Privilege: administer */ \
545547
kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: ClearCredential, Privilege: administer */ \
548+
kMatterAccessPrivilegeManage, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \
546549
kMatterAccessPrivilegeManage, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \
547550
kMatterAccessPrivilegeManage, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \
548551
}

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<!--
3-
Copyright (c) 2021 Project CHIP Authors
3+
Copyright (c) 2021-2023 Project CHIP Authors
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ limitations under the License.
2323
<define>MEDIA_INPUT_CLUSTER</define>
2424
<client init="false" tick="false">true</client>
2525
<server init="false" tick="false">true</server>
26-
<!-- TODO: Add feature map once it is supported -->
26+
2727
<description>This cluster provides an interface for controlling the Input Selector on a media device such as a TV.</description>
2828
<attribute side="server" code="0x0000" define="MEDIA_INPUT_LIST" type="ARRAY" entryType="InputInfoStruct" length="254" writable="false" optional="false">InputList</attribute>
2929
<attribute side="server" code="0x0001" define="MEDIA_INPUT_CURRENT_INPUT" type="int8u" default="0x00" min="0x00" max="0xFF" writable="false" optional="false">CurrentInput</attribute>
@@ -43,6 +43,7 @@ limitations under the License.
4343

4444
<command source="client" code="0x03" name="RenameInput" optional="true">
4545
<description>Upon receipt, this SHALL rename the input at a specific index in the Input List. Updates to the input name SHALL appear in the TV settings menus. </description>
46+
<access op="invoke" privilege="manage"/>
4647
<arg name="Index" type="int8u"/>
4748
<arg name="Name" type="char_string"/>
4849
</command>
@@ -53,8 +54,8 @@ limitations under the License.
5354
<cluster code="0x0507"/>
5455
<item name="Index" type="int8u"/>
5556
<item name="InputType" type="InputTypeEnum"/>
56-
<item name="Name" type="char_string" length="32"/>
57-
<item name="Description" type="char_string" length="32"/>
57+
<item name="Name" type="char_string"/>
58+
<item name="Description" type="char_string"/>
5859
</struct>
5960

6061
<enum name="InputTypeEnum" type="enum8">

src/controller/data_model/controller-clusters.matter

+3-3
Original file line numberDiff line numberDiff line change
@@ -6006,8 +6006,8 @@ client cluster MediaInput = 1287 {
60066006
struct InputInfoStruct {
60076007
int8u index = 0;
60086008
InputTypeEnum inputType = 1;
6009-
char_string<32> name = 2;
6010-
char_string<32> description = 3;
6009+
char_string name = 2;
6010+
char_string description = 3;
60116011
}
60126012

60136013
readonly attribute InputInfoStruct inputList[] = 0;
@@ -6035,7 +6035,7 @@ client cluster MediaInput = 1287 {
60356035
/** Upon receipt, this SHALL hide the input list from the screen. */
60366036
command HideInputStatus(): DefaultSuccess = 2;
60376037
/** Upon receipt, this SHALL rename the input at a specific index in the Input List. Updates to the input name SHALL appear in the TV settings menus. */
6038-
command RenameInput(RenameInputRequest): DefaultSuccess = 3;
6038+
command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
60396039
}
60406040

60416041
/** This cluster provides an interface for managing low power mode on a device. */

0 commit comments

Comments
 (0)