Skip to content

Commit

Permalink
Align naming in Media Input cluster XML with the spec. (#24504)
Browse files Browse the repository at this point in the history
* Align naming in Media Input cluster XML with the spec.

* Regenerate generated code.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jul 25, 2023
1 parent 7628b1e commit 916c189
Show file tree
Hide file tree
Showing 33 changed files with 195 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3293,14 +3293,14 @@ server cluster MediaInput = 1287 {
kNameUpdates = 0x1;
}

struct InputInfo {
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
char_string<32> name = 2;
char_string<32> description = 3;
}

readonly attribute InputInfo inputList[] = 0;
readonly attribute InputInfoStruct inputList[] = 0;
readonly attribute int8u currentInput = 1;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2649,14 +2649,14 @@ server cluster MediaInput = 1287 {
kNameUpdates = 0x1;
}

struct InputInfo {
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
char_string<32> name = 2;
char_string<32> description = 3;
}

readonly attribute InputInfo inputList[] = 0;
readonly attribute InputInfoStruct inputList[] = 0;
readonly attribute int8u currentInput = 1;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/MediaInputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ CHIP_ERROR MediaInputManager::HandleGetInputList(chip::app::AttributeValueEncode
jint size = env->GetArrayLength(inputArray);
for (int i = 0; i < size; i++)
{
app::Clusters::MediaInput::Structs::InputInfo::Type mediaInput;
app::Clusters::MediaInput::Structs::InputInfoStruct::Type mediaInput;

jobject inputObj = env->GetObjectArrayElement(inputArray, i);
jclass inputClass = env->GetObjectClass(inputObj);
Expand Down
4 changes: 2 additions & 2 deletions examples/tv-app/linux/include/media-input/MediaInputManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <app/clusters/media-input-server/media-input-server.h>
#include <vector>

using InputInfoType = chip::app::Clusters::MediaInput::Structs::InputInfo::Type;
using InputInfoType = chip::app::Clusters::MediaInput::Structs::InputInfoStruct::Type;

class MediaInputManager : public chip::app::Clusters::MediaInput::Delegate
{
Expand All @@ -39,7 +39,7 @@ class MediaInputManager : public chip::app::Clusters::MediaInput::Delegate

protected:
uint8_t mCurrentInput;
std::vector<chip::app::Clusters::MediaInput::Structs::InputInfo::Type> mInputs;
std::vector<chip::app::Clusters::MediaInput::Structs::InputInfoStruct::Type> mInputs;
// Magic numbers are here on purpose, please allocate memory
char mCharDataBuffer[10][32];
};
4 changes: 2 additions & 2 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1744,14 +1744,14 @@ server cluster MediaInput = 1287 {
kNameUpdates = 0x1;
}

struct InputInfo {
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
char_string<32> name = 2;
char_string<32> description = 3;
}

readonly attribute InputInfo inputList[] = 0;
readonly attribute InputInfoStruct inputList[] = 0;
readonly attribute int8u currentInput = 1;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1816,14 +1816,14 @@ client cluster MediaInput = 1287 {
kNameUpdates = 0x1;
}

struct InputInfo {
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
char_string<32> name = 2;
char_string<32> description = 3;
}

readonly attribute InputInfo inputList[] = 0;
readonly attribute InputInfoStruct inputList[] = 0;
readonly attribute int16u clusterRevision = 65533;

request struct SelectInputRequest {
Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/media-input-server/media-input-delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace MediaInput {
class Delegate
{
public:
// no easy way to handle the return memory of app::Clusters::MediaInput::Structs::InputInfo::Type list, so encoder is used
// no easy way to handle the return memory of app::Clusters::MediaInput::Structs::InputInfoStruct::Type list, so encoder is used
virtual CHIP_ERROR HandleGetInputList(app::AttributeValueEncoder & aEncoder) = 0;
virtual uint8_t HandleGetCurrentInput() = 0;
virtual bool HandleSelectInput(const uint8_t index) = 0;
Expand Down
32 changes: 16 additions & 16 deletions src/app/tests/suites/TV_MediaInputCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ tests:
value:
[
{
index: 1,
inputType: 4,
name: "HDMI",
description: "High-Definition Multimedia Interface",
Index: 1,
InputType: 4,
Name: "HDMI",
Description: "High-Definition Multimedia Interface",
},
{
index: 2,
inputType: 4,
name: "HDMI",
description: "High-Definition Multimedia Interface",
Index: 2,
InputType: 4,
Name: "HDMI",
Description: "High-Definition Multimedia Interface",
},
]

Expand Down Expand Up @@ -83,15 +83,15 @@ tests:
value:
[
{
index: 1,
inputType: 4,
name: "HDMI Test",
description: "High-Definition Multimedia Interface",
Index: 1,
InputType: 4,
Name: "HDMI Test",
Description: "High-Definition Multimedia Interface",
},
{
index: 2,
inputType: 4,
name: "HDMI",
description: "High-Definition Multimedia Interface",
Index: 2,
InputType: 4,
Name: "HDMI",
Description: "High-Definition Multimedia Interface",
},
]
26 changes: 13 additions & 13 deletions src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ limitations under the License.
<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="InputInfo" 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="true">CurrentInput</attribute>
<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>

<command source="client" code="0x00" name="SelectInput" optional="false">
<description>Upon receipt, this SHALL change the input on the media device to the input at a specific index in the Input List.</description>
<arg name="index" type="INT8U"/>
<arg name="Index" type="INT8U"/>
</command>

<command source="client" code="0x01" name="ShowInputStatus" optional="false">
Expand All @@ -43,18 +43,18 @@ limitations under the License.

<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>
<arg name="index" type="INT8U"/>
<arg name="name" type="CHAR_STRING"/>
<arg name="Index" type="INT8U"/>
<arg name="Name" type="CHAR_STRING"/>
</command>

</cluster>

<struct name="InputInfo">
<struct name="InputInfoStruct">
<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="Index" type="INT8U"/>
<item name="InputType" type="InputTypeEnum"/>
<item name="Name" type="CHAR_STRING" length="32"/>
<item name="Description" type="CHAR_STRING" length="32"/>
</struct>

<enum name="InputTypeEnum" type="ENUM8">
Expand All @@ -63,13 +63,13 @@ limitations under the License.
<item name="Aux" value="0x01"/>
<item name="Coax" value="0x02"/>
<item name="Composite" value="0x03"/>
<item name="Hdmi" value="0x04"/>
<item name="HDMI" value="0x04"/>
<item name="Input" value="0x05"/>
<item name="Line" value="0x06"/>
<item name="Optical" value="0x07"/>
<item name="Video" value="0x08"/>
<item name="Scart" value="0x09"/>
<item name="Usb" value="0x0A"/>
<item name="SCART" value="0x09"/>
<item name="USB" value="0x0A"/>
<item name="Other" value="0x0B"/>
</enum>

Expand Down
4 changes: 2 additions & 2 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -3696,14 +3696,14 @@ client cluster MediaInput = 1287 {
kNameUpdates = 0x1;
}

struct InputInfo {
struct InputInfoStruct {
int8u index = 0;
InputTypeEnum inputType = 1;
char_string<32> name = 2;
char_string<32> description = 3;
}

readonly attribute InputInfo inputList[] = 0;
readonly attribute InputInfoStruct inputList[] = 0;
readonly attribute int8u currentInput = 1;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions src/controller/java/zap-generated/CHIPReadCallbacks.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/controller/java/zap-generated/CHIPReadCallbacks.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 916c189

Please sign in to comment.