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 HandleMenuRequest(command
);
96 case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS
:
97 HandleGiveDevicePowerStatus(command
);
99 case CEC_OPCODE_GET_CEC_VERSION
:
100 HandleGetCecVersion(command
);
102 case CEC_OPCODE_USER_CONTROL_PRESSED
:
103 HandleUserControlPressed(command
);
105 case CEC_OPCODE_USER_CONTROL_RELEASE
:
106 HandleUserControlRelease(command
);
108 case CEC_OPCODE_GIVE_AUDIO_STATUS
:
109 HandleGiveAudioStatus(command
);
111 case CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS
:
112 HandleGiveSystemAudioModeStatus(command
);
114 case CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST
:
115 HandleSetSystemAudioModeRequest(command
);
118 UnhandledCommand(command
);
119 /* pass to listeners */
120 m_busDevice
->GetProcessor()->AddCommand(command
);
125 else if (command
.destination
== CECDEVICE_BROADCAST
)
128 switch (command
.opcode
)
130 case CEC_OPCODE_SET_MENU_LANGUAGE
:
131 HandleSetMenuLanguage(command
);
132 /* pass to listeners */
133 m_busDevice
->GetProcessor()->AddCommand(command
);
135 case CEC_OPCODE_REQUEST_ACTIVE_SOURCE
:
136 HandleRequestActiveSource(command
);
138 case CEC_OPCODE_SET_STREAM_PATH
:
139 HandleSetStreamPath(command
);
141 case CEC_OPCODE_ROUTING_CHANGE
:
142 HandleRoutingChange(command
);
144 case CEC_OPCODE_DEVICE_VENDOR_ID
:
145 HandleDeviceVendorId(command
);
147 case CEC_OPCODE_VENDOR_COMMAND_WITH_ID
:
148 HandleDeviceVendorCommandWithId(command
);
150 case CEC_OPCODE_STANDBY
:
151 HandleStandby(command
);
152 /* pass to listeners */
153 m_busDevice
->GetProcessor()->AddCommand(command
);
155 case CEC_OPCODE_ACTIVE_SOURCE
:
156 HandleActiveSource(command
);
157 /* pass to listeners */
158 m_busDevice
->GetProcessor()->AddCommand(command
);
161 UnhandledCommand(command
);
162 /* pass to listeners */
163 m_busDevice
->GetProcessor()->AddCommand(command
);
171 strLog
.Format("ignoring frame: we're not at destination %x", command
.destination
);
172 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
179 bool CCECCommandHandler::HandleActiveSource(const cec_command
&command
)
181 if (command
.parameters
.size
== 2)
183 uint16_t iAddress
= ((uint16_t)command
.parameters
[0] << 8) | ((uint16_t)command
.parameters
[1]);
184 return m_busDevice
->GetProcessor()->SetStreamPath(iAddress
);
190 bool CCECCommandHandler::HandleDeckControl(const cec_command
&command
)
192 CCECBusDevice
*device
= GetDevice(command
.destination
);
193 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE
&& command
.parameters
.size
> 0)
195 ((CCECPlaybackDevice
*) device
)->SetDeckControlMode((cec_deck_control_mode
) command
.parameters
[0]);
202 bool CCECCommandHandler::HandleDeviceCecVersion(const cec_command
&command
)
204 if (command
.parameters
.size
== 1)
206 CCECBusDevice
*device
= GetDevice(command
.initiator
);
208 device
->SetCecVersion((cec_version
) command
.parameters
[0]);
214 bool CCECCommandHandler::HandleDeviceVendorCommandWithId(const cec_command
&command
)
216 SetVendorId(command
);
217 m_busDevice
->GetProcessor()->TransmitAbort(command
.initiator
, command
.opcode
, CEC_ABORT_REASON_REFUSED
);
221 bool CCECCommandHandler::HandleDeviceVendorId(const cec_command
&command
)
223 SetVendorId(command
);
227 bool CCECCommandHandler::HandleGetCecVersion(const cec_command
&command
)
229 CCECBusDevice
*device
= GetDevice(command
.destination
);
231 return device
->TransmitCECVersion(command
.initiator
);
236 bool CCECCommandHandler::HandleGiveAudioStatus(const cec_command
&command
)
238 CCECBusDevice
*device
= GetDevice(command
.destination
);
239 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM
)
240 return ((CCECAudioSystem
*) device
)->TransmitAudioStatus(command
.initiator
);
245 bool CCECCommandHandler::HandleGiveDeckStatus(const cec_command
&command
)
247 CCECBusDevice
*device
= GetDevice(command
.destination
);
248 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE
)
249 return ((CCECPlaybackDevice
*) device
)->TransmitDeckStatus(command
.initiator
);
254 bool CCECCommandHandler::HandleGiveDevicePowerStatus(const cec_command
&command
)
256 CCECBusDevice
*device
= GetDevice(command
.destination
);
258 return device
->TransmitPowerState(command
.initiator
);
263 bool CCECCommandHandler::HandleGiveDeviceVendorId(const cec_command
&command
)
265 CCECBusDevice
*device
= GetDevice(command
.destination
);
267 return device
->TransmitVendorID(command
.initiator
);
272 bool CCECCommandHandler::HandleGiveOSDName(const cec_command
&command
)
274 CCECBusDevice
*device
= GetDevice(command
.destination
);
276 return device
->TransmitOSDName(command
.initiator
);
281 bool CCECCommandHandler::HandleGivePhysicalAddress(const cec_command
&command
)
283 CCECBusDevice
*device
= GetDevice(command
.destination
);
285 return device
->TransmitPhysicalAddress();
290 bool CCECCommandHandler::HandleMenuRequest(const cec_command
&command
)
292 if (command
.parameters
[0] == CEC_MENU_REQUEST_TYPE_QUERY
)
294 CCECBusDevice
*device
= GetDevice(command
.destination
);
296 return device
->TransmitMenuState(command
.initiator
);
301 bool CCECCommandHandler::HandleReportPowerStatus(const cec_command
&command
)
303 if (command
.parameters
.size
== 1)
305 CCECBusDevice
*device
= GetDevice(command
.initiator
);
307 device
->SetPowerStatus((cec_power_status
) command
.parameters
[0]);
312 bool CCECCommandHandler::HandleRequestActiveSource(const cec_command
&command
)
315 strLog
.Format(">> %i requests active source", (uint8_t) command
.initiator
);
316 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
318 vector
<CCECBusDevice
*> devices
;
319 for (int iDevicePtr
= (int)GetMyDevices(devices
)-1; iDevicePtr
>=0; iDevicePtr
--)
320 devices
[iDevicePtr
]->TransmitActiveSource();
325 bool CCECCommandHandler::HandleRoutingChange(const cec_command
&command
)
327 if (command
.parameters
.size
== 4)
329 uint16_t iOldAddress
= ((uint16_t)command
.parameters
[0] << 8) | ((uint16_t)command
.parameters
[1]);
330 uint16_t iNewAddress
= ((uint16_t)command
.parameters
[2] << 8) | ((uint16_t)command
.parameters
[3]);
332 CCECBusDevice
*device
= GetDevice(command
.initiator
);
334 device
->SetStreamPath(iNewAddress
, iOldAddress
);
339 bool CCECCommandHandler::HandleSetMenuLanguage(const cec_command
&command
)
341 if (command
.parameters
.size
== 3)
343 CCECBusDevice
*device
= GetDevice(command
.initiator
);
346 cec_menu_language language
;
347 language
.device
= command
.initiator
;
348 for (uint8_t iPtr
= 0; iPtr
< 4; iPtr
++)
349 language
.language
[iPtr
] = command
.parameters
[iPtr
];
350 language
.language
[3] = 0;
351 device
->SetMenuLanguage(language
);
357 bool CCECCommandHandler::HandleSetStreamPath(const cec_command
&command
)
359 if (command
.parameters
.size
>= 2)
361 uint16_t iStreamAddress
= ((uint16_t)command
.parameters
[0] << 8) | ((uint16_t)command
.parameters
[1]);
363 strLog
.Format(">> %i sets stream path to physical address %04x", command
.initiator
, iStreamAddress
);
364 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
366 if (m_busDevice
->GetProcessor()->SetStreamPath(iStreamAddress
))
368 CCECBusDevice
*device
= GetDeviceByPhysicalAddress(iStreamAddress
);
371 return device
->TransmitActiveSource() &&
372 device
->TransmitMenuState(command
.initiator
);
380 bool CCECCommandHandler::HandleSetSystemAudioModeRequest(const cec_command
&command
)
382 if (command
.parameters
.size
>= 1)
384 CCECBusDevice
*device
= GetDevice(command
.destination
);
385 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM
)
386 return ((CCECAudioSystem
*) device
)->SetSystemAudioMode(command
);
391 bool CCECCommandHandler::HandleStandby(const cec_command
&command
)
393 CCECBusDevice
*device
= GetDevice(command
.initiator
);
395 device
->SetPowerStatus(CEC_POWER_STATUS_STANDBY
);
399 bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command
&command
)
401 CCECBusDevice
*device
= GetDevice(command
.destination
);
402 if (device
&& device
->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM
)
403 return ((CCECAudioSystem
*) device
)->TransmitSystemAudioModeStatus(command
.initiator
);
408 bool CCECCommandHandler::HandleUserControlPressed(const cec_command
&command
)
410 if (command
.parameters
.size
> 0)
412 m_busDevice
->GetProcessor()->AddKey();
414 if (command
.parameters
[0] <= CEC_USER_CONTROL_CODE_MAX
)
417 strLog
.Format("key pressed: %x", command
.parameters
[0]);
418 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
420 if (command
.parameters
[0] == CEC_USER_CONTROL_CODE_POWER
||
421 command
.parameters
[0] == CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION
)
423 CCECBusDevice
*device
= GetDevice(command
.destination
);
425 device
->SetPowerStatus(CEC_POWER_STATUS_ON
);
428 m_busDevice
->GetProcessor()->SetCurrentButton((cec_user_control_code
) command
.parameters
[0]);
434 bool CCECCommandHandler::HandleUserControlRelease(const cec_command
&command
)
436 m_busDevice
->GetProcessor()->AddKey();
440 void CCECCommandHandler::UnhandledCommand(const cec_command
&command
)
443 strLog
.Format("unhandled command with opcode %02x from address %d", command
.opcode
, command
.initiator
);
444 m_busDevice
->AddLog(CEC_LOG_DEBUG
, strLog
);
447 unsigned int CCECCommandHandler::GetMyDevices(vector
<CCECBusDevice
*> &devices
) const
449 unsigned int iReturn(0);
451 cec_logical_addresses addresses
= m_busDevice
->GetProcessor()->GetLogicalAddresses();
452 for (uint8_t iPtr
= 0; iPtr
< 16; iPtr
++)
456 devices
.push_back(GetDevice((cec_logical_address
) iPtr
));
464 CCECBusDevice
*CCECCommandHandler::GetDevice(cec_logical_address iLogicalAddress
) const
466 CCECBusDevice
*device
= NULL
;
468 if (iLogicalAddress
>= CECDEVICE_TV
&& iLogicalAddress
<= CECDEVICE_BROADCAST
)
469 device
= m_busDevice
->GetProcessor()->m_busDevices
[iLogicalAddress
];
474 CCECBusDevice
*CCECCommandHandler::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress
) const
476 return m_busDevice
->GetProcessor()->GetDeviceByPhysicalAddress(iPhysicalAddress
);
479 CCECBusDevice
*CCECCommandHandler::GetDeviceByType(cec_device_type type
) const
481 return m_busDevice
->GetProcessor()->GetDeviceByType(type
);
484 void CCECCommandHandler::SetVendorId(const cec_command
&command
)
486 if (command
.parameters
.size
< 3)
488 m_busDevice
->AddLog(CEC_LOG_WARNING
, "invalid vendor ID received");
492 uint64_t iVendorId
= ((uint64_t)command
.parameters
[0] << 16) +
493 ((uint64_t)command
.parameters
[1] << 8) +
494 (uint64_t)command
.parameters
[2];
496 CCECBusDevice
*device
= GetDevice((cec_logical_address
) command
.initiator
);
498 device
->SetVendorId(iVendorId
);
501 const char *CCECCommandHandler::ToString(const cec_menu_state state
)
505 case CEC_MENU_STATE_ACTIVATED
:
507 case CEC_MENU_STATE_DEACTIVATED
:
508 return "deactivated";
514 const char *CCECCommandHandler::ToString(const cec_version version
)
518 case CEC_VERSION_1_2
:
520 case CEC_VERSION_1_2A
:
522 case CEC_VERSION_1_3
:
524 case CEC_VERSION_1_3A
:
526 case CEC_VERSION_1_4
:
533 const char *CCECCommandHandler::ToString(const cec_power_status status
)
537 case CEC_POWER_STATUS_ON
:
539 case CEC_POWER_STATUS_STANDBY
:
541 case CEC_POWER_STATUS_IN_TRANSITION_ON_TO_STANDBY
:
542 return "in transition from on to standby";
543 case CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON
:
544 return "in transition from standby to on";
550 const char *CCECCommandHandler::ToString(const cec_logical_address address
)
554 case CECDEVICE_AUDIOSYSTEM
:
556 case CECDEVICE_BROADCAST
:
558 case CECDEVICE_FREEUSE
:
560 case CECDEVICE_PLAYBACKDEVICE1
:
562 case CECDEVICE_PLAYBACKDEVICE2
:
564 case CECDEVICE_PLAYBACKDEVICE3
:
566 case CECDEVICE_RECORDINGDEVICE1
:
568 case CECDEVICE_RECORDINGDEVICE2
:
570 case CECDEVICE_RECORDINGDEVICE3
:
572 case CECDEVICE_RESERVED1
:
574 case CECDEVICE_RESERVED2
:
576 case CECDEVICE_TUNER1
:
578 case CECDEVICE_TUNER2
:
580 case CECDEVICE_TUNER3
:
582 case CECDEVICE_TUNER4
:
591 const char *CCECCommandHandler::ToString(const cec_deck_control_mode mode
)
595 case CEC_DECK_CONTROL_MODE_SKIP_FORWARD_WIND
:
596 return "skip forward wind";
597 case CEC_DECK_CONTROL_MODE_EJECT
:
599 case CEC_DECK_CONTROL_MODE_SKIP_REVERSE_REWIND
:
600 return "reverse rewind";
601 case CEC_DECK_CONTROL_MODE_STOP
:
608 const char *CCECCommandHandler::ToString(const cec_deck_info status
)
612 case CEC_DECK_INFO_PLAY
:
614 case CEC_DECK_INFO_RECORD
:
616 case CEC_DECK_INFO_PLAY_REVERSE
:
617 return "play reverse";
618 case CEC_DECK_INFO_STILL
:
620 case CEC_DECK_INFO_SLOW
:
622 case CEC_DECK_INFO_SLOW_REVERSE
:
623 return "slow reverse";
624 case CEC_DECK_INFO_FAST_FORWARD
:
625 return "fast forward";
626 case CEC_DECK_INFO_FAST_REVERSE
:
627 return "fast reverse";
628 case CEC_DECK_INFO_NO_MEDIA
:
630 case CEC_DECK_INFO_STOP
:
632 case CEC_DECK_INFO_SKIP_FORWARD_WIND
:
633 return "info skip forward wind";
634 case CEC_DECK_INFO_SKIP_REVERSE_REWIND
:
635 return "info skip reverse rewind";
636 case CEC_DECK_INFO_INDEX_SEARCH_FORWARD
:
637 return "info index search forward";
638 case CEC_DECK_INFO_INDEX_SEARCH_REVERSE
:
639 return "info index search reverse";
640 case CEC_DECK_INFO_OTHER_STATUS
:
647 const char *CCECCommandHandler::ToString(const cec_opcode opcode
)
651 case CEC_OPCODE_ACTIVE_SOURCE
:
652 return "active source";
653 case CEC_OPCODE_IMAGE_VIEW_ON
:
654 return "image view on";
655 case CEC_OPCODE_TEXT_VIEW_ON
:
656 return "text view on";
657 case CEC_OPCODE_INACTIVE_SOURCE
:
658 return "inactive source";
659 case CEC_OPCODE_REQUEST_ACTIVE_SOURCE
:
660 return "request active source";
661 case CEC_OPCODE_ROUTING_CHANGE
:
662 return "routing change";
663 case CEC_OPCODE_ROUTING_INFORMATION
:
664 return "routing information";
665 case CEC_OPCODE_SET_STREAM_PATH
:
666 return "set stream path";
667 case CEC_OPCODE_STANDBY
:
669 case CEC_OPCODE_RECORD_OFF
:
671 case CEC_OPCODE_RECORD_ON
:
673 case CEC_OPCODE_RECORD_STATUS
:
674 return "record status";
675 case CEC_OPCODE_RECORD_TV_SCREEN
:
676 return "record tv screen";
677 case CEC_OPCODE_CLEAR_ANALOGUE_TIMER
:
678 return "clear analogue timer";
679 case CEC_OPCODE_CLEAR_DIGITAL_TIMER
:
680 return "clear digital timer";
681 case CEC_OPCODE_CLEAR_EXTERNAL_TIMER
:
682 return "clear external timer";
683 case CEC_OPCODE_SET_ANALOGUE_TIMER
:
684 return "set analogue timer";
685 case CEC_OPCODE_SET_DIGITAL_TIMER
:
686 return "set digital timer";
687 case CEC_OPCODE_SET_EXTERNAL_TIMER
:
688 return "set external timer";
689 case CEC_OPCODE_SET_TIMER_PROGRAM_TITLE
:
690 return "set timer program title";
691 case CEC_OPCODE_TIMER_CLEARED_STATUS
:
692 return "timer cleared status";
693 case CEC_OPCODE_TIMER_STATUS
:
694 return "timer status";
695 case CEC_OPCODE_CEC_VERSION
:
696 return "cec version";
697 case CEC_OPCODE_GET_CEC_VERSION
:
698 return "get cec version";
699 case CEC_OPCODE_GIVE_PHYSICAL_ADDRESS
:
700 return "give physical address";
701 case CEC_OPCODE_GET_MENU_LANGUAGE
:
702 return "get menu language";
703 case CEC_OPCODE_REPORT_PHYSICAL_ADDRESS
:
704 return "report physical address";
705 case CEC_OPCODE_SET_MENU_LANGUAGE
:
706 return "set menu language";
707 case CEC_OPCODE_DECK_CONTROL
:
708 return "deck control";
709 case CEC_OPCODE_DECK_STATUS
:
710 return "deck status";
711 case CEC_OPCODE_GIVE_DECK_STATUS
:
712 return "give deck status";
713 case CEC_OPCODE_PLAY
:
715 case CEC_OPCODE_GIVE_TUNER_DEVICE_STATUS
:
716 return "give tuner status";
717 case CEC_OPCODE_SELECT_ANALOGUE_SERVICE
:
718 return "select analogue service";
719 case CEC_OPCODE_SELECT_DIGITAL_SERVICE
:
720 return "set digital service";
721 case CEC_OPCODE_TUNER_DEVICE_STATUS
:
722 return "tuner device status";
723 case CEC_OPCODE_TUNER_STEP_DECREMENT
:
724 return "tuner step decrement";
725 case CEC_OPCODE_TUNER_STEP_INCREMENT
:
726 return "tuner step increment";
727 case CEC_OPCODE_DEVICE_VENDOR_ID
:
728 return "device vendor id";
729 case CEC_OPCODE_GIVE_DEVICE_VENDOR_ID
:
730 return "give device vendor id";
731 case CEC_OPCODE_VENDOR_COMMAND
:
732 return "vendor command";
733 case CEC_OPCODE_VENDOR_COMMAND_WITH_ID
:
734 return "vendor command with id";
735 case CEC_OPCODE_VENDOR_REMOTE_BUTTON_DOWN
:
736 return "vendor remote button down";
737 case CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP
:
738 return "vendor remote button up";
739 case CEC_OPCODE_SET_OSD_STRING
:
740 return "set osd string";
741 case CEC_OPCODE_GIVE_OSD_NAME
:
742 return "give osd name";
743 case CEC_OPCODE_SET_OSD_NAME
:
744 return "set osd name";
745 case CEC_OPCODE_MENU_REQUEST
:
746 return "menu request";
747 case CEC_OPCODE_MENU_STATUS
:
748 return "menu status";
749 case CEC_OPCODE_USER_CONTROL_PRESSED
:
750 return "user control pressed";
751 case CEC_OPCODE_USER_CONTROL_RELEASE
:
752 return "user control release";
753 case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS
:
754 return "give device power status";
755 case CEC_OPCODE_REPORT_POWER_STATUS
:
756 return "report power status";
757 case CEC_OPCODE_FEATURE_ABORT
:
758 return "feature abort";
759 case CEC_OPCODE_ABORT
:
761 case CEC_OPCODE_GIVE_AUDIO_STATUS
:
762 return "give audio status";
763 case CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS
:
764 return "give audio mode status";
765 case CEC_OPCODE_REPORT_AUDIO_STATUS
:
766 return "report audio status";
767 case CEC_OPCODE_SET_SYSTEM_AUDIO_MODE
:
768 return "set system audio mode";
769 case CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST
:
770 return "system audio mode request";
771 case CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS
:
772 return "system audio mode status";
773 case CEC_OPCODE_SET_AUDIO_RATE
:
774 return "set audio rate";
780 const char *CCECCommandHandler::ToString(const cec_system_audio_status mode
)
784 case CEC_SYSTEM_AUDIO_STATUS_ON
:
786 case CEC_SYSTEM_AUDIO_STATUS_OFF
:
793 const char *CCECCommandHandler::ToString(const cec_audio_status status
)
795 // TODO this is a mask
799 const char *CCECCommandHandler::ToString(const cec_vendor_id vendor
)
803 case CEC_VENDOR_SAMSUNG
:
807 case CEC_VENDOR_PANASONIC
:
809 case CEC_VENDOR_PIONEER
: