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
);
90 /* pass to listeners */
91 m_busDevice
->GetProcessor()->AddCommand(command
);
93 case CEC_OPCODE_MENU_REQUEST
:
94 if (!HandleMenuRequest(command
))
96 /* pass to listeners */
97 m_busDevice
->GetProcessor()->AddCommand(command
);
100 case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS
:
101 HandleGiveDevicePowerStatus(command
);
103 case CEC_OPCODE_GET_CEC_VERSION
:
104 HandleGetCecVersion(command
);
106 case CEC_OPCODE_USER_CONTROL_PRESSED
:
107 HandleUserControlPressed(command
);
109 case CEC_OPCODE_USER_CONTROL_RELEASE
:
110 HandleUserControlRelease(command
);
112 case CEC_OPCODE_GIVE_AUDIO_STATUS
:
113 HandleGiveAudioStatus(command
);
115 case CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS
:
116 HandleGiveSystemAudioModeStatus(command
);
118 case CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST
:
119 HandleSetSystemAudioModeRequest(command
);
122 UnhandledCommand(command
);
123 /* pass to listeners */
124 m_busDevice
->GetProcessor()->AddCommand(command
);
129 else if (command
.destination
== CECDEVICE_BROADCAST
)
132 switch (command
.opcode
)
134 case CEC_OPCODE_SET_MENU_LANGUAGE
:
135 HandleSetMenuLanguage(command
);
136 /* pass to listeners */
137 m_busDevice
->GetProcessor()->AddCommand(command
);
139 case CEC_OPCODE_REQUEST_ACTIVE_SOURCE
:
140 HandleRequestActiveSource(command
);
142 case CEC_OPCODE_SET_STREAM_PATH
:
143 HandleSetStreamPath(command
);
145 case CEC_OPCODE_ROUTING_CHANGE
:
146 HandleRoutingChange(command
);
148 case CEC_OPCODE_DEVICE_VENDOR_ID
:
149 HandleDeviceVendorId(command
);
151 case CEC_OPCODE_VENDOR_COMMAND_WITH_ID
:
152 HandleDeviceVendorCommandWithId(command
);
154 case CEC_OPCODE_STANDBY
:
155 HandleStandby(command
);
156 /* pass to listeners */
157 m_busDevice
->GetProcessor()->AddCommand(command
);
159 case CEC_OPCODE_ACTIVE_SOURCE
:
160 HandleActiveSource(command
);
161 /* pass to listeners */
162 m_busDevice
->GetProcessor()->AddCommand(command
);
165 UnhandledCommand(command
);
166 /* pass to listeners */
167 m_busDevice
->GetProcessor()->AddCommand(command
);
175 strLog
.Format("ignoring frame: we're not at destination %x", command
.destination
);
176 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
183 bool CCECCommandHandler::HandleActiveSource(const cec_command
&command
)
185 if (command
.parameters
.size
== 2)
187 uint16_t iAddress
= ((uint16_t)command
.parameters
[0] << 8) | ((uint16_t)command
.parameters
[1]);
188 return m_busDevice
->GetProcessor()->SetStreamPath(iAddress
);
194 bool CCECCommandHandler::HandleDeckControl(const cec_command
&command
)
196 CCECBusDevice
*device
= GetDevice(command
.destination
);
197 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE
&& command
.parameters
.size
> 0)
199 ((CCECPlaybackDevice
*) device
)->SetDeckControlMode((cec_deck_control_mode
) command
.parameters
[0]);
206 bool CCECCommandHandler::HandleDeviceCecVersion(const cec_command
&command
)
208 if (command
.parameters
.size
== 1)
210 CCECBusDevice
*device
= GetDevice(command
.initiator
);
212 device
->SetCecVersion((cec_version
) command
.parameters
[0]);
218 bool CCECCommandHandler::HandleDeviceVendorCommandWithId(const cec_command
&command
)
220 SetVendorId(command
);
221 m_busDevice
->GetProcessor()->TransmitAbort(command
.initiator
, command
.opcode
, CEC_ABORT_REASON_REFUSED
);
225 bool CCECCommandHandler::HandleDeviceVendorId(const cec_command
&command
)
227 SetVendorId(command
);
231 bool CCECCommandHandler::HandleGetCecVersion(const cec_command
&command
)
233 CCECBusDevice
*device
= GetDevice(command
.destination
);
235 return device
->TransmitCECVersion(command
.initiator
);
240 bool CCECCommandHandler::HandleGiveAudioStatus(const cec_command
&command
)
242 CCECBusDevice
*device
= GetDevice(command
.destination
);
243 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM
)
244 return ((CCECAudioSystem
*) device
)->TransmitAudioStatus(command
.initiator
);
249 bool CCECCommandHandler::HandleGiveDeckStatus(const cec_command
&command
)
251 CCECBusDevice
*device
= GetDevice(command
.destination
);
252 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE
)
253 return ((CCECPlaybackDevice
*) device
)->TransmitDeckStatus(command
.initiator
);
258 bool CCECCommandHandler::HandleGiveDevicePowerStatus(const cec_command
&command
)
260 CCECBusDevice
*device
= GetDevice(command
.destination
);
262 return device
->TransmitPowerState(command
.initiator
);
267 bool CCECCommandHandler::HandleGiveDeviceVendorId(const cec_command
&command
)
269 CCECBusDevice
*device
= GetDevice(command
.destination
);
271 return device
->TransmitVendorID(command
.initiator
);
276 bool CCECCommandHandler::HandleGiveOSDName(const cec_command
&command
)
278 CCECBusDevice
*device
= GetDevice(command
.destination
);
280 return device
->TransmitOSDName(command
.initiator
);
285 bool CCECCommandHandler::HandleGivePhysicalAddress(const cec_command
&command
)
287 CCECBusDevice
*device
= GetDevice(command
.destination
);
289 return device
->TransmitPhysicalAddress();
294 bool CCECCommandHandler::HandleMenuRequest(const cec_command
&command
)
296 if (command
.parameters
[0] == CEC_MENU_REQUEST_TYPE_QUERY
)
298 CCECBusDevice
*device
= GetDevice(command
.destination
);
300 return device
->TransmitMenuState(command
.initiator
);
305 bool CCECCommandHandler::HandleReportPowerStatus(const cec_command
&command
)
307 if (command
.parameters
.size
== 1)
309 CCECBusDevice
*device
= GetDevice(command
.initiator
);
311 device
->SetPowerStatus((cec_power_status
) command
.parameters
[0]);
316 bool CCECCommandHandler::HandleRequestActiveSource(const cec_command
&command
)
319 strLog
.Format(">> %i requests active source", (uint8_t) command
.initiator
);
320 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
322 vector
<CCECBusDevice
*> devices
;
323 for (int iDevicePtr
= (int)GetMyDevices(devices
)-1; iDevicePtr
>=0; iDevicePtr
--)
324 devices
[iDevicePtr
]->TransmitActiveSource();
329 bool CCECCommandHandler::HandleRoutingChange(const cec_command
&command
)
331 if (command
.parameters
.size
== 4)
333 uint16_t iOldAddress
= ((uint16_t)command
.parameters
[0] << 8) | ((uint16_t)command
.parameters
[1]);
334 uint16_t iNewAddress
= ((uint16_t)command
.parameters
[2] << 8) | ((uint16_t)command
.parameters
[3]);
336 CCECBusDevice
*device
= GetDevice(command
.initiator
);
338 device
->SetStreamPath(iNewAddress
, iOldAddress
);
343 bool CCECCommandHandler::HandleSetMenuLanguage(const cec_command
&command
)
345 if (command
.parameters
.size
== 3)
347 CCECBusDevice
*device
= GetDevice(command
.initiator
);
350 cec_menu_language language
;
351 language
.device
= command
.initiator
;
352 for (uint8_t iPtr
= 0; iPtr
< 4; iPtr
++)
353 language
.language
[iPtr
] = command
.parameters
[iPtr
];
354 language
.language
[3] = 0;
355 device
->SetMenuLanguage(language
);
361 bool CCECCommandHandler::HandleSetStreamPath(const cec_command
&command
)
363 if (command
.parameters
.size
>= 2)
365 uint16_t iStreamAddress
= ((uint16_t)command
.parameters
[0] << 8) | ((uint16_t)command
.parameters
[1]);
367 strLog
.Format(">> %i sets stream path to physical address %04x", command
.initiator
, iStreamAddress
);
368 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
370 if (m_busDevice
->GetProcessor()->SetStreamPath(iStreamAddress
))
372 CCECBusDevice
*device
= GetDeviceByPhysicalAddress(iStreamAddress
);
375 return device
->TransmitActiveSource() &&
376 device
->TransmitMenuState(command
.initiator
);
384 bool CCECCommandHandler::HandleSetSystemAudioModeRequest(const cec_command
&command
)
386 if (command
.parameters
.size
>= 1)
388 CCECBusDevice
*device
= GetDevice(command
.destination
);
389 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM
)
390 return ((CCECAudioSystem
*) device
)->SetSystemAudioMode(command
);
395 bool CCECCommandHandler::HandleStandby(const cec_command
&command
)
397 CCECBusDevice
*device
= GetDevice(command
.initiator
);
399 device
->SetPowerStatus(CEC_POWER_STATUS_STANDBY
);
403 bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command
&command
)
405 CCECBusDevice
*device
= GetDevice(command
.destination
);
406 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM
)
407 return ((CCECAudioSystem
*) device
)->TransmitSystemAudioModeStatus(command
.initiator
);
412 bool CCECCommandHandler::HandleUserControlPressed(const cec_command
&command
)
414 if (command
.parameters
.size
> 0)
416 m_busDevice
->GetProcessor()->AddKey();
418 if (command
.parameters
[0] <= CEC_USER_CONTROL_CODE_MAX
)
421 strLog
.Format("key pressed: %x", command
.parameters
[0]);
422 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
424 if (command
.parameters
[0] == CEC_USER_CONTROL_CODE_POWER
||
425 command
.parameters
[0] == CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION
)
427 CCECBusDevice
*device
= GetDevice(command
.destination
);
429 device
->SetPowerStatus(CEC_POWER_STATUS_ON
);
432 m_busDevice
->GetProcessor()->SetCurrentButton((cec_user_control_code
) command
.parameters
[0]);
438 bool CCECCommandHandler::HandleUserControlRelease(const cec_command
&command
)
440 m_busDevice
->GetProcessor()->AddKey();
444 void CCECCommandHandler::UnhandledCommand(const cec_command
&command
)
447 strLog
.Format("unhandled command with opcode %02x from address %d", command
.opcode
, command
.initiator
);
448 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
);
451 unsigned int CCECCommandHandler::GetMyDevices(vector
<CCECBusDevice
*> &devices
) const
453 unsigned int iReturn(0);
455 cec_logical_addresses addresses
= m_busDevice
->GetProcessor()->GetLogicalAddresses();
456 for (uint8_t iPtr
= 0; iPtr
< 16; iPtr
++)
460 devices
.push_back(GetDevice((cec_logical_address
) iPtr
));
468 CCECBusDevice
*CCECCommandHandler::GetDevice(cec_logical_address iLogicalAddress
) const
470 CCECBusDevice
*device
= NULL
;
472 if (iLogicalAddress
>= CECDEVICE_TV
&& iLogicalAddress
<= CECDEVICE_BROADCAST
)
473 device
= m_busDevice
->GetProcessor()->m_busDevices
[iLogicalAddress
];
478 CCECBusDevice
*CCECCommandHandler::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress
) const
480 return m_busDevice
->GetProcessor()->GetDeviceByPhysicalAddress(iPhysicalAddress
);
483 CCECBusDevice
*CCECCommandHandler::GetDeviceByType(cec_device_type type
) const
485 return m_busDevice
->GetProcessor()->GetDeviceByType(type
);
488 void CCECCommandHandler::SetVendorId(const cec_command
&command
)
490 if (command
.parameters
.size
< 3)
492 m_busDevice
->AddLog(CEC_LOG_WARNING
, "invalid vendor ID received");
496 uint64_t iVendorId
= ((uint64_t)command
.parameters
[0] << 16) +
497 ((uint64_t)command
.parameters
[1] << 8) +
498 (uint64_t)command
.parameters
[2];
500 CCECBusDevice
*device
= GetDevice((cec_logical_address
) command
.initiator
);
502 device
->SetVendorId(iVendorId
);
505 const char *CCECCommandHandler::ToString(const cec_menu_state state
)
509 case CEC_MENU_STATE_ACTIVATED
:
511 case CEC_MENU_STATE_DEACTIVATED
:
512 return "deactivated";
518 const char *CCECCommandHandler::ToString(const cec_version version
)
522 case CEC_VERSION_1_2
:
524 case CEC_VERSION_1_2A
:
526 case CEC_VERSION_1_3
:
528 case CEC_VERSION_1_3A
:
530 case CEC_VERSION_1_4
:
537 const char *CCECCommandHandler::ToString(const cec_power_status status
)
541 case CEC_POWER_STATUS_ON
:
543 case CEC_POWER_STATUS_STANDBY
:
545 case CEC_POWER_STATUS_IN_TRANSITION_ON_TO_STANDBY
:
546 return "in transition from on to standby";
547 case CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON
:
548 return "in transition from standby to on";
554 const char *CCECCommandHandler::ToString(const cec_logical_address address
)
558 case CECDEVICE_AUDIOSYSTEM
:
560 case CECDEVICE_BROADCAST
:
562 case CECDEVICE_FREEUSE
:
564 case CECDEVICE_PLAYBACKDEVICE1
:
566 case CECDEVICE_PLAYBACKDEVICE2
:
568 case CECDEVICE_PLAYBACKDEVICE3
:
570 case CECDEVICE_RECORDINGDEVICE1
:
572 case CECDEVICE_RECORDINGDEVICE2
:
574 case CECDEVICE_RECORDINGDEVICE3
:
576 case CECDEVICE_RESERVED1
:
578 case CECDEVICE_RESERVED2
:
580 case CECDEVICE_TUNER1
:
582 case CECDEVICE_TUNER2
:
584 case CECDEVICE_TUNER3
:
586 case CECDEVICE_TUNER4
:
595 const char *CCECCommandHandler::ToString(const cec_deck_control_mode mode
)
599 case CEC_DECK_CONTROL_MODE_SKIP_FORWARD_WIND
:
600 return "skip forward wind";
601 case CEC_DECK_CONTROL_MODE_EJECT
:
603 case CEC_DECK_CONTROL_MODE_SKIP_REVERSE_REWIND
:
604 return "reverse rewind";
605 case CEC_DECK_CONTROL_MODE_STOP
:
612 const char *CCECCommandHandler::ToString(const cec_deck_info status
)
616 case CEC_DECK_INFO_PLAY
:
618 case CEC_DECK_INFO_RECORD
:
620 case CEC_DECK_INFO_PLAY_REVERSE
:
621 return "play reverse";
622 case CEC_DECK_INFO_STILL
:
624 case CEC_DECK_INFO_SLOW
:
626 case CEC_DECK_INFO_SLOW_REVERSE
:
627 return "slow reverse";
628 case CEC_DECK_INFO_FAST_FORWARD
:
629 return "fast forward";
630 case CEC_DECK_INFO_FAST_REVERSE
:
631 return "fast reverse";
632 case CEC_DECK_INFO_NO_MEDIA
:
634 case CEC_DECK_INFO_STOP
:
636 case CEC_DECK_INFO_SKIP_FORWARD_WIND
:
637 return "info skip forward wind";
638 case CEC_DECK_INFO_SKIP_REVERSE_REWIND
:
639 return "info skip reverse rewind";
640 case CEC_DECK_INFO_INDEX_SEARCH_FORWARD
:
641 return "info index search forward";
642 case CEC_DECK_INFO_INDEX_SEARCH_REVERSE
:
643 return "info index search reverse";
644 case CEC_DECK_INFO_OTHER_STATUS
:
651 const char *CCECCommandHandler::ToString(const cec_opcode opcode
)
655 case CEC_OPCODE_ACTIVE_SOURCE
:
656 return "active source";
657 case CEC_OPCODE_IMAGE_VIEW_ON
:
658 return "image view on";
659 case CEC_OPCODE_TEXT_VIEW_ON
:
660 return "text view on";
661 case CEC_OPCODE_INACTIVE_SOURCE
:
662 return "inactive source";
663 case CEC_OPCODE_REQUEST_ACTIVE_SOURCE
:
664 return "request active source";
665 case CEC_OPCODE_ROUTING_CHANGE
:
666 return "routing change";
667 case CEC_OPCODE_ROUTING_INFORMATION
:
668 return "routing information";
669 case CEC_OPCODE_SET_STREAM_PATH
:
670 return "set stream path";
671 case CEC_OPCODE_STANDBY
:
673 case CEC_OPCODE_RECORD_OFF
:
675 case CEC_OPCODE_RECORD_ON
:
677 case CEC_OPCODE_RECORD_STATUS
:
678 return "record status";
679 case CEC_OPCODE_RECORD_TV_SCREEN
:
680 return "record tv screen";
681 case CEC_OPCODE_CLEAR_ANALOGUE_TIMER
:
682 return "clear analogue timer";
683 case CEC_OPCODE_CLEAR_DIGITAL_TIMER
:
684 return "clear digital timer";
685 case CEC_OPCODE_CLEAR_EXTERNAL_TIMER
:
686 return "clear external timer";
687 case CEC_OPCODE_SET_ANALOGUE_TIMER
:
688 return "set analogue timer";
689 case CEC_OPCODE_SET_DIGITAL_TIMER
:
690 return "set digital timer";
691 case CEC_OPCODE_SET_EXTERNAL_TIMER
:
692 return "set external timer";
693 case CEC_OPCODE_SET_TIMER_PROGRAM_TITLE
:
694 return "set timer program title";
695 case CEC_OPCODE_TIMER_CLEARED_STATUS
:
696 return "timer cleared status";
697 case CEC_OPCODE_TIMER_STATUS
:
698 return "timer status";
699 case CEC_OPCODE_CEC_VERSION
:
700 return "cec version";
701 case CEC_OPCODE_GET_CEC_VERSION
:
702 return "get cec version";
703 case CEC_OPCODE_GIVE_PHYSICAL_ADDRESS
:
704 return "give physical address";
705 case CEC_OPCODE_GET_MENU_LANGUAGE
:
706 return "get menu language";
707 case CEC_OPCODE_REPORT_PHYSICAL_ADDRESS
:
708 return "report physical address";
709 case CEC_OPCODE_SET_MENU_LANGUAGE
:
710 return "set menu language";
711 case CEC_OPCODE_DECK_CONTROL
:
712 return "deck control";
713 case CEC_OPCODE_DECK_STATUS
:
714 return "deck status";
715 case CEC_OPCODE_GIVE_DECK_STATUS
:
716 return "give deck status";
717 case CEC_OPCODE_PLAY
:
719 case CEC_OPCODE_GIVE_TUNER_DEVICE_STATUS
:
720 return "give tuner status";
721 case CEC_OPCODE_SELECT_ANALOGUE_SERVICE
:
722 return "select analogue service";
723 case CEC_OPCODE_SELECT_DIGITAL_SERVICE
:
724 return "set digital service";
725 case CEC_OPCODE_TUNER_DEVICE_STATUS
:
726 return "tuner device status";
727 case CEC_OPCODE_TUNER_STEP_DECREMENT
:
728 return "tuner step decrement";
729 case CEC_OPCODE_TUNER_STEP_INCREMENT
:
730 return "tuner step increment";
731 case CEC_OPCODE_DEVICE_VENDOR_ID
:
732 return "device vendor id";
733 case CEC_OPCODE_GIVE_DEVICE_VENDOR_ID
:
734 return "give device vendor id";
735 case CEC_OPCODE_VENDOR_COMMAND
:
736 return "vendor command";
737 case CEC_OPCODE_VENDOR_COMMAND_WITH_ID
:
738 return "vendor command with id";
739 case CEC_OPCODE_VENDOR_REMOTE_BUTTON_DOWN
:
740 return "vendor remote button down";
741 case CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP
:
742 return "vendor remote button up";
743 case CEC_OPCODE_SET_OSD_STRING
:
744 return "set osd string";
745 case CEC_OPCODE_GIVE_OSD_NAME
:
746 return "give osd name";
747 case CEC_OPCODE_SET_OSD_NAME
:
748 return "set osd name";
749 case CEC_OPCODE_MENU_REQUEST
:
750 return "menu request";
751 case CEC_OPCODE_MENU_STATUS
:
752 return "menu status";
753 case CEC_OPCODE_USER_CONTROL_PRESSED
:
754 return "user control pressed";
755 case CEC_OPCODE_USER_CONTROL_RELEASE
:
756 return "user control release";
757 case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS
:
758 return "give device power status";
759 case CEC_OPCODE_REPORT_POWER_STATUS
:
760 return "report power status";
761 case CEC_OPCODE_FEATURE_ABORT
:
762 return "feature abort";
763 case CEC_OPCODE_ABORT
:
765 case CEC_OPCODE_GIVE_AUDIO_STATUS
:
766 return "give audio status";
767 case CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS
:
768 return "give audio mode status";
769 case CEC_OPCODE_REPORT_AUDIO_STATUS
:
770 return "report audio status";
771 case CEC_OPCODE_SET_SYSTEM_AUDIO_MODE
:
772 return "set system audio mode";
773 case CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST
:
774 return "system audio mode request";
775 case CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS
:
776 return "system audio mode status";
777 case CEC_OPCODE_SET_AUDIO_RATE
:
778 return "set audio rate";
784 const char *CCECCommandHandler::ToString(const cec_system_audio_status mode
)
788 case CEC_SYSTEM_AUDIO_STATUS_ON
:
790 case CEC_SYSTEM_AUDIO_STATUS_OFF
:
797 const char *CCECCommandHandler::ToString(const cec_audio_status status
)
799 // TODO this is a mask
803 const char *CCECCommandHandler::ToString(const cec_vendor_id vendor
)
807 case CEC_VENDOR_SAMSUNG
:
811 case CEC_VENDOR_PANASONIC
:
813 case CEC_VENDOR_PIONEER
: