Skip to content

Commit

Permalink
Align naming in Audio Output cluster XML with the spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Jan 20, 2023
1 parent 8517156 commit e5e1795
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

using chip::app::AttributeValueEncoder;
using AudioOutputDelegate = chip::app::Clusters::AudioOutput::Delegate;
using OutputInfoType = chip::app::Clusters::AudioOutput::Structs::OutputInfo::Type;
using OutputInfoType = chip::app::Clusters::AudioOutput::Structs::OutputInfoStruct::Type;

class AudioOutputManager : public AudioOutputDelegate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

using chip::app::AttributeValueEncoder;
using AudioOutputDelegate = chip::app::Clusters::AudioOutput::Delegate;
using OutputInfoType = chip::app::Clusters::AudioOutput::Structs::OutputInfo::Type;
using OutputInfoType = chip::app::Clusters::AudioOutput::Structs::OutputInfoStruct::Type;

class AudioOutputManager : public AudioOutputDelegate
{
Expand Down
12 changes: 6 additions & 6 deletions src/app/tests/suites/TV_AudioOutputCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ tests:
response:
value:
[
{ index: 1, outputType: 0, name: "HDMI" },
{ index: 2, outputType: 0, name: "HDMI" },
{ index: 3, outputType: 0, name: "HDMI" },
{ Index: 1, OutputType: 0, Name: "HDMI" },
{ Index: 2, OutputType: 0, Name: "HDMI" },
{ Index: 3, OutputType: 0, Name: "HDMI" },
]

- label: "Read attribute current audio output"
Expand Down Expand Up @@ -67,7 +67,7 @@ tests:
response:
value:
[
{ index: 1, outputType: 0, name: "HDMI Test" },
{ index: 2, outputType: 0, name: "HDMI" },
{ index: 3, outputType: 0, name: "HDMI" },
{ Index: 1, OutputType: 0, Name: "HDMI Test" },
{ Index: 2, OutputType: 0, Name: "HDMI" },
{ Index: 3, OutputType: 0, Name: "HDMI" },
]
22 changes: 11 additions & 11 deletions src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,33 @@ limitations under the License.
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
<description>This cluster provides an interface for controlling the Output on a media device such as a TV.</description>
<attribute side="server" code="0x0000" define="AUDIO_OUTPUT_LIST" type="ARRAY" entryType="OutputInfo" length="254" writable="false" optional="false">OutputList</attribute>
<attribute side="server" code="0x0001" define="AUDIO_OUTPUT_CURRENT_OUTPUT" type="INT8U" default="0x00" min="0x00" max="0xFF" writable="false" optional="true">CurrentOutput</attribute>
<attribute side="server" code="0x0000" define="AUDIO_OUTPUT_LIST" type="ARRAY" entryType="OutputInfoStruct" length="254" writable="false" optional="false">OutputList</attribute>
<attribute side="server" code="0x0001" define="AUDIO_OUTPUT_CURRENT_OUTPUT" type="INT8U" default="0x00" min="0x00" max="0xFF" writable="false" optional="true">CurrentOutput</attribute>

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

<command source="client" code="0x01" name="RenameOutput" optional="true">
<description>Upon receipt, this SHALL rename the output at a specific index in the Output List. Updates to the output 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="OutputInfo">
<struct name="OutputInfoStruct">
<cluster code="0x050b"/>
<item name="index" type="INT8U"/>
<item name="outputType" type="OutputTypeEnum"/>
<item name="name" type="CHAR_STRING" length="32"/>
<item name="Index" type="INT8U"/>
<item name="OutputType" type="OutputTypeEnum"/>
<item name="Name" type="CHAR_STRING" length="32"/>
</struct>

<enum name="OutputTypeEnum" type="ENUM8">
<cluster code="0x050b"/>
<item name="Hdmi" value="0x00"/>
<item name="Bt" value="0x01"/>
<item name="HDMI" value="0x00"/>
<item name="BT" value="0x01"/>
<item name="Optical" value="0x02"/>
<item name="Headphone" value="0x03"/>
<item name="Internal" value="0x04"/>
Expand Down
23 changes: 23 additions & 0 deletions src/darwin/Framework/CHIP/templates/availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5056,6 +5056,8 @@
- TargetInfoStruct
MediaInput:
- InputInfoStruct
AudioOutput:
- OutputInfoStruct
struct fields:
UnitTesting:
SimpleStruct:
Expand Down Expand Up @@ -5181,6 +5183,11 @@
- inputType
- name
- descriptionString
AudioOutput:
OutputInfoStruct:
- index
- outputType
- name
events:
OTASoftwareUpdateRequestor:
- StateTransition
Expand Down Expand Up @@ -5506,6 +5513,10 @@
- HDMI
- SCART
- USB
AudioOutput:
OutputTypeEnum:
- HDMI
- BT
bitmaps:
UnitTesting:
- Bitmap8MaskMap
Expand Down Expand Up @@ -5671,6 +5682,8 @@
- TargetInfo
MediaInput:
- InputInfo
AudioOutput:
- OutputInfo
struct fields:
Descriptor:
DeviceTypeStruct:
Expand Down Expand Up @@ -5753,6 +5766,10 @@
- Hdmi
- Scart
- Usb
AudioOutput:
OutputTypeEnum:
- Hdmi
- Bt
bitmaps:
DoorLock:
- DlDaysMaskMap
Expand Down Expand Up @@ -5930,6 +5947,8 @@
TargetInfoStruct: TargetInfo
MediaInput:
InputInfoStruct: InputInfo
AudioOutput:
OutputInfoStruct: OutputInfo
struct fields:
Descriptor:
DeviceTypeStruct:
Expand Down Expand Up @@ -6025,6 +6044,10 @@
HDMI: Hdmi
SCART: Scart
USB: Usb
AudioOutput:
OutputTypeEnum:
HDMI: Hdmi
BT: Bt
bitmaps:
DoorLock:
DaysMaskMap: DlDaysMaskMap
Expand Down

0 comments on commit e5e1795

Please sign in to comment.