2 * This file is part of the libCEC(R) library.
4 * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved.
5 * libCEC(R) is an original work, containing original code.
7 * libCEC(R) is a trademark of Pulse-Eight Limited.
9 * This program is dual-licensed; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * Alternatively, you can license this library under a commercial license,
25 * please contact Pulse-Eight Licensing for more information.
27 * For more information contact:
28 * Pulse-Eight Licensing <license@pulse-eight.com>
29 * http://www.pulse-eight.com/
30 * http://www.pulse-eight.net/
33 #include "CECCommandHandler.h"
34 #include "../devices/CECBusDevice.h"
35 #include "../devices/CECAudioSystem.h"
36 #include "../devices/CECPlaybackDevice.h"
37 #include "../CECProcessor.h"
42 CCECCommandHandler::CCECCommandHandler(CCECBusDevice
*busDevice
)
44 m_busDevice
= busDevice
;
47 bool CCECCommandHandler::HandleCommand(const cec_command
&command
)
52 strLog
.Format(">> %s (%X) -> %s (%X): %s (%2X)", ToString(command
.initiator
), command
.initiator
, ToString(command
.destination
), command
.destination
, ToString(command
.opcode
), command
.opcode
);
53 m_busDevice
->AddLog(CEC_LOG_NOTICE
, strLog
);
55 if (m_busDevice
->MyLogicalAddressContains(command
.destination
))
57 switch(command
.opcode
)
59 case CEC_OPCODE_REPORT_POWER_STATUS
:
60 HandleReportPowerStatus(command
);
62 case CEC_OPCODE_CEC_VERSION
:
63 HandleDeviceCecVersion(command
);
65 case CEC_OPCODE_SET_MENU_LANGUAGE
:
66 HandleSetMenuLanguage(command
);
67 /* pass to listeners */
68 m_busDevice
->GetProcessor()->AddCommand(command
);
70 case CEC_OPCODE_GIVE_PHYSICAL_ADDRESS
:
71 HandleGivePhysicalAddress(command
);
73 case CEC_OPCODE_GIVE_OSD_NAME
:
74 HandleGiveOSDName(command
);
76 case CEC_OPCODE_GIVE_DEVICE_VENDOR_ID
:
77 HandleGiveDeviceVendorId(command
);
79 case CEC_OPCODE_DEVICE_VENDOR_ID
:
80 HandleDeviceVendorId(command
);
82 case CEC_OPCODE_VENDOR_COMMAND_WITH_ID
:
83 HandleDeviceVendorCommandWithId(command
);
85 case CEC_OPCODE_GIVE_DECK_STATUS
:
86 HandleGiveDeckStatus(command
);
88 case CEC_OPCODE_DECK_CONTROL
:
89 HandleDeckControl(command
);
91 case CEC_OPCODE_MENU_REQUEST
:
92 HandleMenuRequest(command
);
94 case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS
:
95 HandleGiveDevicePowerStatus(command
);
97 case CEC_OPCODE_GET_CEC_VERSION
:
98 HandleGetCecVersion(command
);
100 case CEC_OPCODE_USER_CONTROL_PRESSED
:
101 HandleUserControlPressed(command
);
103 case CEC_OPCODE_USER_CONTROL_RELEASE
:
104 HandleUserControlRelease(command
);
106 case CEC_OPCODE_GIVE_AUDIO_STATUS
:
107 HandleGiveAudioStatus(command
);
109 case CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS
:
110 HandleGiveSystemAudioModeStatus(command
);
112 case CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST
:
113 HandleSetSystemAudioModeRequest(command
);
116 UnhandledCommand(command
);
117 /* pass to listeners */
118 m_busDevice
->GetProcessor()->AddCommand(command
);
123 else if (command
.destination
== CECDEVICE_BROADCAST
)
126 switch (command
.opcode
)
128 case CEC_OPCODE_SET_MENU_LANGUAGE
:
129 HandleSetMenuLanguage(command
);
130 /* pass to listeners */
131 m_busDevice
->GetProcessor()->AddCommand(command
);
133 case CEC_OPCODE_REQUEST_ACTIVE_SOURCE
:
134 HandleRequestActiveSource(command
);
136 case CEC_OPCODE_SET_STREAM_PATH
:
137 HandleSetStreamPath(command
);
139 case CEC_OPCODE_ROUTING_CHANGE
:
140 HandleRoutingChange(command
);
142 case CEC_OPCODE_DEVICE_VENDOR_ID
:
143 HandleDeviceVendorId(command
);
145 case CEC_OPCODE_VENDOR_COMMAND_WITH_ID
:
146 HandleDeviceVendorCommandWithId(command
);
148 case CEC_OPCODE_STANDBY
:
149 HandleStandby(command
);
150 /* pass to listeners */
151 m_busDevice
->GetProcessor()->AddCommand(command
);
153 case CEC_OPCODE_ACTIVE_SOURCE
:
154 HandleActiveSource(command
);
155 /* pass to listeners */
156 m_busDevice
->GetProcessor()->AddCommand(command
);
159 UnhandledCommand(command
);
160 /* pass to listeners */
161 m_busDevice
->GetProcessor()->AddCommand(command
);
169 strLog
.Format("ignoring frame: we're not at destination %x", command
.destination
);
170 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
177 bool CCECCommandHandler::HandleActiveSource(const cec_command
&command
)
179 if (command
.parameters
.size
== 2)
181 uint16_t iAddress
= ((uint16_t)command
.parameters
[0] << 8) | ((uint16_t)command
.parameters
[1]);
182 return m_busDevice
->GetProcessor()->SetStreamPath(iAddress
);
188 bool CCECCommandHandler::HandleDeckControl(const cec_command
&command
)
190 CCECBusDevice
*device
= GetDevice(command
.destination
);
191 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE
&& command
.parameters
.size
> 0)
193 ((CCECPlaybackDevice
*) device
)->SetDeckControlMode((cec_deck_control_mode
) command
.parameters
[0]);
200 bool CCECCommandHandler::HandleDeviceCecVersion(const cec_command
&command
)
202 if (command
.parameters
.size
== 1)
204 CCECBusDevice
*device
= GetDevice(command
.initiator
);
206 device
->SetCecVersion((cec_version
) command
.parameters
[0]);
212 bool CCECCommandHandler::HandleDeviceVendorCommandWithId(const cec_command
&command
)
214 SetVendorId(command
);
218 bool CCECCommandHandler::HandleDeviceVendorId(const cec_command
&command
)
220 SetVendorId(command
);
224 bool CCECCommandHandler::HandleGetCecVersion(const cec_command
&command
)
226 CCECBusDevice
*device
= GetDevice(command
.destination
);
228 return device
->TransmitCECVersion(command
.initiator
);
233 bool CCECCommandHandler::HandleGiveAudioStatus(const cec_command
&command
)
235 CCECBusDevice
*device
= GetDevice(command
.destination
);
236 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM
)
237 return ((CCECAudioSystem
*) device
)->TransmitAudioStatus(command
.initiator
);
242 bool CCECCommandHandler::HandleGiveDeckStatus(const cec_command
&command
)
244 CCECBusDevice
*device
= GetDevice(command
.destination
);
245 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE
)
246 return ((CCECPlaybackDevice
*) device
)->TransmitDeckStatus(command
.initiator
);
251 bool CCECCommandHandler::HandleGiveDevicePowerStatus(const cec_command
&command
)
253 CCECBusDevice
*device
= GetDevice(command
.destination
);
255 return device
->TransmitPowerState(command
.initiator
);
260 bool CCECCommandHandler::HandleGiveDeviceVendorId(const cec_command
&command
)
262 CCECBusDevice
*device
= GetDevice(command
.destination
);
264 return device
->TransmitVendorID(command
.initiator
);
269 bool CCECCommandHandler::HandleGiveOSDName(const cec_command
&command
)
271 CCECBusDevice
*device
= GetDevice(command
.destination
);
273 return device
->TransmitOSDName(command
.initiator
);
278 bool CCECCommandHandler::HandleGivePhysicalAddress(const cec_command
&command
)
280 CCECBusDevice
*device
= GetDevice(command
.destination
);
282 return device
->TransmitPhysicalAddress();
287 bool CCECCommandHandler::HandleMenuRequest(const cec_command
&command
)
289 if (command
.parameters
[0] == CEC_MENU_REQUEST_TYPE_QUERY
)
291 CCECBusDevice
*device
= GetDevice(command
.destination
);
293 return device
->TransmitMenuState(command
.initiator
);
298 bool CCECCommandHandler::HandleReportPowerStatus(const cec_command
&command
)
300 if (command
.parameters
.size
== 1)
302 CCECBusDevice
*device
= GetDevice(command
.initiator
);
304 device
->SetPowerStatus((cec_power_status
) command
.parameters
[0]);
309 bool CCECCommandHandler::HandleRequestActiveSource(const cec_command
&command
)
312 strLog
.Format(">> %i requests active source", (uint8_t) command
.initiator
);
313 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
315 vector
<CCECBusDevice
*> devices
;
316 for (int iDevicePtr
= (int)GetMyDevices(devices
)-1; iDevicePtr
>=0; iDevicePtr
--)
317 devices
[iDevicePtr
]->TransmitActiveSource();
321 bool CCECCommandHandler::HandleRoutingChange(const cec_command
&command
)
323 if (command
.parameters
.size
== 4)
325 uint16_t iOldAddress
= ((uint16_t)command
.parameters
[0] << 8) | ((uint16_t)command
.parameters
[1]);
326 uint16_t iNewAddress
= ((uint16_t)command
.parameters
[2] << 8) | ((uint16_t)command
.parameters
[3]);
328 CCECBusDevice
*device
= GetDevice(command
.initiator
);
330 device
->SetStreamPath(iNewAddress
, iOldAddress
);
335 bool CCECCommandHandler::HandleSetMenuLanguage(const cec_command
&command
)
337 if (command
.parameters
.size
== 3)
339 CCECBusDevice
*device
= GetDevice(command
.initiator
);
342 cec_menu_language language
;
343 language
.device
= command
.initiator
;
344 for (uint8_t iPtr
= 0; iPtr
< 4; iPtr
++)
345 language
.language
[iPtr
] = command
.parameters
[iPtr
];
346 language
.language
[3] = 0;
347 device
->SetMenuLanguage(language
);
353 bool CCECCommandHandler::HandleSetStreamPath(const cec_command
&command
)
355 if (command
.parameters
.size
>= 2)
357 uint16_t streamaddr
= ((uint16_t)command
.parameters
[0] << 8) | ((uint16_t)command
.parameters
[1]);
359 strLog
.Format(">> %i sets stream path to physical address %04x", command
.initiator
, streamaddr
);
360 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
362 return m_busDevice
->GetProcessor()->SetStreamPath(streamaddr
);
367 bool CCECCommandHandler::HandleSetSystemAudioModeRequest(const cec_command
&command
)
369 if (command
.parameters
.size
>= 1)
371 CCECBusDevice
*device
= GetDevice(command
.destination
);
372 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM
)
373 return ((CCECAudioSystem
*) device
)->SetSystemAudioMode(command
);
378 bool CCECCommandHandler::HandleStandby(const cec_command
&command
)
380 CCECBusDevice
*device
= GetDevice(command
.initiator
);
382 device
->SetPowerStatus(CEC_POWER_STATUS_STANDBY
);
386 bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command
&command
)
388 CCECBusDevice
*device
= GetDevice(command
.destination
);
389 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM
)
390 return ((CCECAudioSystem
*) device
)->TransmitSystemAudioModeStatus(command
.initiator
);
395 bool CCECCommandHandler::HandleUserControlPressed(const cec_command
&command
)
397 if (command
.parameters
.size
> 0)
399 m_busDevice
->GetProcessor()->AddKey();
401 if (command
.parameters
[0] <= CEC_USER_CONTROL_CODE_MAX
)
404 strLog
.Format("key pressed: %x", command
.parameters
[0]);
405 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
407 if (command
.parameters
[0] == CEC_USER_CONTROL_CODE_POWER
||
408 command
.parameters
[0] == CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION
)
410 CCECBusDevice
*device
= GetDevice(command
.destination
);
412 device
->SetPowerStatus(CEC_POWER_STATUS_ON
);
415 m_busDevice
->GetProcessor()->SetCurrentButton((cec_user_control_code
) command
.parameters
[0]);
421 bool CCECCommandHandler::HandleUserControlRelease(const cec_command
&command
)
423 m_busDevice
->GetProcessor()->AddKey();
427 void CCECCommandHandler::UnhandledCommand(const cec_command
&command
)
430 strLog
.Format("unhandled command with opcode %02x from address %d", command
.opcode
, command
.initiator
);
431 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
);
434 unsigned int CCECCommandHandler::GetMyDevices(vector
<CCECBusDevice
*> &devices
) const
436 unsigned int iReturn(0);
438 cec_logical_addresses addresses
= m_busDevice
->GetProcessor()->GetLogicalAddresses();
439 for (uint8_t iPtr
= 0; iPtr
< 16; iPtr
++)
443 devices
.push_back(GetDevice((cec_logical_address
) iPtr
));
451 CCECBusDevice
*CCECCommandHandler::GetDevice(cec_logical_address iLogicalAddress
) const
453 CCECBusDevice
*device
= NULL
;
455 if (iLogicalAddress
>= CECDEVICE_TV
&& iLogicalAddress
<= CECDEVICE_BROADCAST
)
456 device
= m_busDevice
->GetProcessor()->m_busDevices
[iLogicalAddress
];
461 CCECBusDevice
*CCECCommandHandler::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress
) const
463 return m_busDevice
->GetProcessor()->GetDeviceByPhysicalAddress(iPhysicalAddress
);
466 void CCECCommandHandler::SetVendorId(const cec_command
&command
)
468 if (command
.parameters
.size
< 3)
470 m_busDevice
->AddLog(CEC_LOG_WARNING
, "invalid vendor ID received");
474 uint64_t iVendorId
= ((uint64_t)command
.parameters
[0] << 16) +
475 ((uint64_t)command
.parameters
[1] << 8) +
476 (uint64_t)command
.parameters
[2];
478 CCECBusDevice
*device
= GetDevice((cec_logical_address
) command
.initiator
);
480 device
->SetVendorId(iVendorId
, command
.parameters
.size
> 3 ? command
.parameters
[3] : 0);
483 const char *CCECCommandHandler::ToString(const cec_version version
)
487 case CEC_VERSION_1_2
:
489 case CEC_VERSION_1_2A
:
491 case CEC_VERSION_1_3
:
493 case CEC_VERSION_1_3A
:
500 const char *CCECCommandHandler::ToString(const cec_power_status status
)
504 case CEC_POWER_STATUS_ON
:
506 case CEC_POWER_STATUS_STANDBY
:
508 case CEC_POWER_STATUS_IN_TRANSITION_ON_TO_STANDBY
:
509 return "in transition from on to standby";
510 case CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON
:
511 return "in transition from standby to on";
517 const char *CCECCommandHandler::ToString(const cec_logical_address address
)
521 case CECDEVICE_AUDIOSYSTEM
:
523 case CECDEVICE_BROADCAST
:
525 case CECDEVICE_FREEUSE
:
527 case CECDEVICE_PLAYBACKDEVICE1
:
529 case CECDEVICE_PLAYBACKDEVICE2
:
531 case CECDEVICE_PLAYBACKDEVICE3
:
533 case CECDEVICE_RECORDINGDEVICE1
:
535 case CECDEVICE_RECORDINGDEVICE2
:
537 case CECDEVICE_RECORDINGDEVICE3
:
539 case CECDEVICE_RESERVED1
:
541 case CECDEVICE_RESERVED2
:
543 case CECDEVICE_TUNER1
:
545 case CECDEVICE_TUNER2
:
547 case CECDEVICE_TUNER3
:
549 case CECDEVICE_TUNER4
:
558 const char *CCECCommandHandler::ToString(const cec_deck_control_mode mode
)
562 case CEC_DECK_CONTROL_MODE_SKIP_FORWARD_WIND
:
563 return "skip forward wind";
564 case CEC_DECK_CONTROL_MODE_EJECT
:
566 case CEC_DECK_CONTROL_MODE_SKIP_REVERSE_REWIND
:
567 return "reverse rewind";
568 case CEC_DECK_CONTROL_MODE_STOP
:
575 const char *CCECCommandHandler::ToString(const cec_deck_info status
)
579 case CEC_DECK_INFO_PLAY
:
581 case CEC_DECK_INFO_RECORD
:
583 case CEC_DECK_INFO_PLAY_REVERSE
:
584 return "play reverse";
585 case CEC_DECK_INFO_STILL
:
587 case CEC_DECK_INFO_SLOW
:
589 case CEC_DECK_INFO_SLOW_REVERSE
:
590 return "slow reverse";
591 case CEC_DECK_INFO_FAST_FORWARD
:
592 return "fast forward";
593 case CEC_DECK_INFO_FAST_REVERSE
:
594 return "fast reverse";
595 case CEC_DECK_INFO_NO_MEDIA
:
597 case CEC_DECK_INFO_STOP
:
599 case CEC_DECK_INFO_SKIP_FORWARD_WIND
:
600 return "info skip forward wind";
601 case CEC_DECK_INFO_SKIP_REVERSE_REWIND
:
602 return "info skip reverse rewind";
603 case CEC_DECK_INFO_INDEX_SEARCH_FORWARD
:
604 return "info index search forward";
605 case CEC_DECK_INFO_INDEX_SEARCH_REVERSE
:
606 return "info index search reverse";
607 case CEC_DECK_INFO_OTHER_STATUS
:
614 const char *CCECCommandHandler::ToString(const cec_opcode opcode
)
618 case CEC_OPCODE_ACTIVE_SOURCE
:
619 return "active source";
620 case CEC_OPCODE_IMAGE_VIEW_ON
:
621 return "image view on";
622 case CEC_OPCODE_TEXT_VIEW_ON
:
623 return "text view on";
624 case CEC_OPCODE_INACTIVE_SOURCE
:
625 return "inactive source";
626 case CEC_OPCODE_REQUEST_ACTIVE_SOURCE
:
627 return "request active source";
628 case CEC_OPCODE_ROUTING_CHANGE
:
629 return "routing change";
630 case CEC_OPCODE_ROUTING_INFORMATION
:
631 return "routing information";
632 case CEC_OPCODE_SET_STREAM_PATH
:
633 return "set stream path";
634 case CEC_OPCODE_STANDBY
:
636 case CEC_OPCODE_RECORD_OFF
:
638 case CEC_OPCODE_RECORD_ON
:
640 case CEC_OPCODE_RECORD_STATUS
:
641 return "record status";
642 case CEC_OPCODE_RECORD_TV_SCREEN
:
643 return "record tv screen";
644 case CEC_OPCODE_CLEAR_ANALOGUE_TIMER
:
645 return "clear analogue timer";
646 case CEC_OPCODE_CLEAR_DIGITAL_TIMER
:
647 return "clear digital timer";
648 case CEC_OPCODE_CLEAR_EXTERNAL_TIMER
:
649 return "clear external timer";
650 case CEC_OPCODE_SET_ANALOGUE_TIMER
:
651 return "set analogue timer";
652 case CEC_OPCODE_SET_DIGITAL_TIMER
:
653 return "set digital timer";
654 case CEC_OPCODE_SET_EXTERNAL_TIMER
:
655 return "set external timer";
656 case CEC_OPCODE_SET_TIMER_PROGRAM_TITLE
:
657 return "set timer program title";
658 case CEC_OPCODE_TIMER_CLEARED_STATUS
:
659 return "timer cleared status";
660 case CEC_OPCODE_TIMER_STATUS
:
661 return "timer status";
662 case CEC_OPCODE_CEC_VERSION
:
663 return "cec version";
664 case CEC_OPCODE_GET_CEC_VERSION
:
665 return "get cec version";
666 case CEC_OPCODE_GIVE_PHYSICAL_ADDRESS
:
667 return "give physical address";
668 case CEC_OPCODE_GET_MENU_LANGUAGE
:
669 return "get menu language";
670 case CEC_OPCODE_REPORT_PHYSICAL_ADDRESS
:
671 return "report physical address";
672 case CEC_OPCODE_SET_MENU_LANGUAGE
:
673 return "set menu language";
674 case CEC_OPCODE_DECK_CONTROL
:
675 return "deck control";
676 case CEC_OPCODE_DECK_STATUS
:
677 return "deck status";
678 case CEC_OPCODE_GIVE_DECK_STATUS
:
679 return "give deck status";
680 case CEC_OPCODE_PLAY
:
682 case CEC_OPCODE_GIVE_TUNER_DEVICE_STATUS
:
683 return "give tuner status";
684 case CEC_OPCODE_SELECT_ANALOGUE_SERVICE
:
685 return "select analogue service";
686 case CEC_OPCODE_SELECT_DIGITAL_SERVICE
:
687 return "set digital service";
688 case CEC_OPCODE_TUNER_DEVICE_STATUS
:
689 return "tuner device status";
690 case CEC_OPCODE_TUNER_STEP_DECREMENT
:
691 return "tuner step decrement";
692 case CEC_OPCODE_TUNER_STEP_INCREMENT
:
693 return "tuner step increment";
694 case CEC_OPCODE_DEVICE_VENDOR_ID
:
695 return "device vendor id";
696 case CEC_OPCODE_GIVE_DEVICE_VENDOR_ID
:
697 return "give device vendor id";
698 case CEC_OPCODE_VENDOR_COMMAND
:
699 return "vendor command";
700 case CEC_OPCODE_VENDOR_COMMAND_WITH_ID
:
701 return "vendor command with id";
702 case CEC_OPCODE_VENDOR_REMOTE_BUTTON_DOWN
:
703 return "vendor remote button down";
704 case CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP
:
705 return "vendor remote button up";
706 case CEC_OPCODE_SET_OSD_STRING
:
707 return "set osd string";
708 case CEC_OPCODE_GIVE_OSD_NAME
:
709 return "give osd name";
710 case CEC_OPCODE_SET_OSD_NAME
:
711 return "set osd name";
712 case CEC_OPCODE_MENU_REQUEST
:
713 return "menu request";
714 case CEC_OPCODE_MENU_STATUS
:
715 return "menu status";
716 case CEC_OPCODE_USER_CONTROL_PRESSED
:
717 return "user control pressed";
718 case CEC_OPCODE_USER_CONTROL_RELEASE
:
719 return "user control release";
720 case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS
:
721 return "give device power status";
722 case CEC_OPCODE_REPORT_POWER_STATUS
:
723 return "report power status";
724 case CEC_OPCODE_FEATURE_ABORT
:
725 return "feature abort";
726 case CEC_OPCODE_ABORT
:
728 case CEC_OPCODE_GIVE_AUDIO_STATUS
:
729 return "give audio status";
730 case CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS
:
731 return "give audio mode status";
732 case CEC_OPCODE_REPORT_AUDIO_STATUS
:
733 return "report audio status";
734 case CEC_OPCODE_SET_SYSTEM_AUDIO_MODE
:
735 return "set system audio mode";
736 case CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST
:
737 return "system audio mode request";
738 case CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS
:
739 return "system audio mode status";
740 case CEC_OPCODE_SET_AUDIO_RATE
:
741 return "set audio rate";