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)
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 dca5447..b741110 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
@@ -3283,8 +3283,8 @@
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
- char_string<32> name = 2;
- char_string<32> description = 3;
+ char_string name = 2;
+ char_string description = 3;
}
readonly attribute InputInfoStruct inputList[] = 0;
diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter
index c1f34df..c948b0e 100644
--- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter
+++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter
@@ -1259,8 +1259,8 @@
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
- char_string<32> name = 2;
- char_string<32> description = 3;
+ char_string name = 2;
+ char_string description = 3;
}
readonly attribute InputInfoStruct inputList[] = 0;
diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter
index 119e2b6..6799ca2 100644
--- a/examples/placeholder/linux/apps/app1/config.matter
+++ b/examples/placeholder/linux/apps/app1/config.matter
@@ -5666,8 +5666,8 @@
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
- char_string<32> name = 2;
- char_string<32> description = 3;
+ char_string name = 2;
+ char_string description = 3;
}
readonly attribute InputInfoStruct inputList[] = 0;
@@ -5695,7 +5695,7 @@
/** Upon receipt, this SHALL hide the input list from the screen. */
command HideInputStatus(): DefaultSuccess = 2;
/** 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. */
- command RenameInput(RenameInputRequest): DefaultSuccess = 3;
+ command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
}
/** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */
@@ -5722,8 +5722,8 @@
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
- char_string<32> name = 2;
- char_string<32> description = 3;
+ char_string name = 2;
+ char_string description = 3;
}
readonly attribute InputInfoStruct inputList[] = 0;
@@ -5747,7 +5747,7 @@
command SelectInput(SelectInputRequest): DefaultSuccess = 0;
command ShowInputStatus(): DefaultSuccess = 1;
command HideInputStatus(): DefaultSuccess = 2;
- command RenameInput(RenameInputRequest): DefaultSuccess = 3;
+ command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
}
/** This cluster provides an interface for managing low power mode on a device. */
diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter
index 0fd6a2c..7b11807 100644
--- a/examples/placeholder/linux/apps/app2/config.matter
+++ b/examples/placeholder/linux/apps/app2/config.matter
@@ -5625,8 +5625,8 @@
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
- char_string<32> name = 2;
- char_string<32> description = 3;
+ char_string name = 2;
+ char_string description = 3;
}
readonly attribute InputInfoStruct inputList[] = 0;
@@ -5654,7 +5654,7 @@
/** Upon receipt, this SHALL hide the input list from the screen. */
command HideInputStatus(): DefaultSuccess = 2;
/** 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. */
- command RenameInput(RenameInputRequest): DefaultSuccess = 3;
+ command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
}
/** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */
@@ -5681,8 +5681,8 @@
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
- char_string<32> name = 2;
- char_string<32> description = 3;
+ char_string name = 2;
+ char_string description = 3;
}
readonly attribute InputInfoStruct inputList[] = 0;
@@ -5706,7 +5706,7 @@
command SelectInput(SelectInputRequest): DefaultSuccess = 0;
command ShowInputStatus(): DefaultSuccess = 1;
command HideInputStatus(): DefaultSuccess = 2;
- command RenameInput(RenameInputRequest): DefaultSuccess = 3;
+ command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
}
/** This cluster provides an interface for managing low power mode on a device. */
diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter
index 3f80e94..d8031ff 100644
--- a/examples/tv-app/tv-common/tv-app.matter
+++ b/examples/tv-app/tv-common/tv-app.matter
@@ -2026,8 +2026,8 @@
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
- char_string<32> name = 2;
- char_string<32> description = 3;
+ char_string name = 2;
+ char_string description = 3;
}
readonly attribute InputInfoStruct inputList[] = 0;
@@ -2051,7 +2051,7 @@
command SelectInput(SelectInputRequest): DefaultSuccess = 0;
command ShowInputStatus(): DefaultSuccess = 1;
command HideInputStatus(): DefaultSuccess = 2;
- command RenameInput(RenameInputRequest): DefaultSuccess = 3;
+ command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
}
/** This cluster provides an interface for managing low power mode on a device. */
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 02fcda0..c217b7d 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
@@ -1560,8 +1560,8 @@
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
- char_string<32> name = 2;
- char_string<32> description = 3;
+ char_string name = 2;
+ char_string description = 3;
}
readonly attribute InputInfoStruct inputList[] = 0;
@@ -1589,7 +1589,7 @@
/** Upon receipt, this SHALL hide the input list from the screen. */
command HideInputStatus(): DefaultSuccess = 2;
/** 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. */
- command RenameInput(RenameInputRequest): DefaultSuccess = 3;
+ command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
}
/** This cluster provides an interface for managing low power mode on a device. */
diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h
index f5a6347..e0369d5 100644
--- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h
+++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h
@@ -437,6 +437,7 @@
0x00000101, /* Cluster: Door Lock, Command: SetCredential, Privilege: administer */ \
0x00000101, /* Cluster: Door Lock, Command: GetCredentialStatus, Privilege: administer */ \
0x00000101, /* Cluster: Door Lock, Command: ClearCredential, Privilege: administer */ \
+ 0x00000507, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \
0xFFF1FC06, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \
0xFFF1FC06, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \
}
@@ -490,6 +491,7 @@
0x00000022, /* Cluster: Door Lock, Command: SetCredential, Privilege: administer */ \
0x00000024, /* Cluster: Door Lock, Command: GetCredentialStatus, Privilege: administer */ \
0x00000026, /* Cluster: Door Lock, Command: ClearCredential, Privilege: administer */ \
+ 0x00000003, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \
0x00000000, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \
0x00000001, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \
}
@@ -543,6 +545,7 @@
kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: SetCredential, Privilege: administer */ \
kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: GetCredentialStatus, Privilege: administer */ \
kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: ClearCredential, Privilege: administer */ \
+ kMatterAccessPrivilegeManage, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \
kMatterAccessPrivilegeManage, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \
kMatterAccessPrivilegeManage, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \
}
diff --git a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml
index e2841a1..495160b 100644
--- a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
-Copyright (c) 2021 Project CHIP Authors
+Copyright (c) 2021-2023 Project CHIP Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
<define>MEDIA_INPUT_CLUSTER</define>
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
- <!-- TODO: Add feature map once it is supported -->
+
<description>This cluster provides an interface for controlling the Input Selector on a media device such as a TV.</description>
<attribute side="server" code="0x0000" define="MEDIA_INPUT_LIST" type="ARRAY" entryType="InputInfoStruct" length="254" writable="false" optional="false">InputList</attribute>
<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 @@
<command source="client" code="0x03" name="RenameInput" optional="true">
<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>
+ <access op="invoke" privilege="manage"/>
<arg name="Index" type="int8u"/>
<arg name="Name" type="char_string"/>
</command>
@@ -53,8 +54,8 @@
<cluster code="0x0507"/>
<item name="Index" type="int8u"/>
<item name="InputType" type="InputTypeEnum"/>
- <item name="Name" type="char_string" length="32"/>
- <item name="Description" type="char_string" length="32"/>
+ <item name="Name" type="char_string"/>
+ <item name="Description" type="char_string"/>
</struct>
<enum name="InputTypeEnum" type="enum8">
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index 38db309..585acb5 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -6006,8 +6006,8 @@
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
- char_string<32> name = 2;
- char_string<32> description = 3;
+ char_string name = 2;
+ char_string description = 3;
}
readonly attribute InputInfoStruct inputList[] = 0;
@@ -6035,7 +6035,7 @@
/** Upon receipt, this SHALL hide the input list from the screen. */
command HideInputStatus(): DefaultSuccess = 2;
/** 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. */
- command RenameInput(RenameInputRequest): DefaultSuccess = 3;
+ command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3;
}
/** This cluster provides an interface for managing low power mode on a device. */