X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FANCommandHandler.cpp;h=93e8c92147df584f2cf771c46b9e6629082c6dc3;hb=0ba92c2d4fb9088e52c9a0d80169fd86d48156b8;hp=92b4464b2fe82dd06325d0c8f723ec9e41b4b547;hpb=75362c3c044a252f4d596ed8b28cad8069c2e781;p=deb_libcec.git diff --git a/src/lib/implementations/ANCommandHandler.cpp b/src/lib/implementations/ANCommandHandler.cpp index 92b4464..93e8c92 100644 --- a/src/lib/implementations/ANCommandHandler.cpp +++ b/src/lib/implementations/ANCommandHandler.cpp @@ -1,7 +1,7 @@ /* * This file is part of the libCEC(R) library. * - * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. + * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. @@ -76,11 +76,6 @@ int CANCommandHandler::HandleVendorRemoteButtonDown(const cec_command &command) return COMMAND_HANDLED; } -int CANCommandHandler::HandleVendorRemoteButtonUp(const cec_command &command) -{ - return HandleUserControlRelease(command); -} - bool CANCommandHandler::PowerOn(const cec_logical_address iInitiator, const cec_logical_address iDestination) { if (iDestination == CECDEVICE_AUDIOSYSTEM) @@ -92,3 +87,42 @@ bool CANCommandHandler::PowerOn(const cec_logical_address iInitiator, const cec_ return CCECCommandHandler::PowerOn(iInitiator, iDestination); } + +int CANCommandHandler::HandleDeviceVendorCommandWithId(const cec_command &command) +{ + if (!m_processor->IsHandledByLibCEC(command.destination)) + return CEC_ABORT_REASON_INVALID_OPERAND; + + // samsung's vendor id + if (command.parameters[0] == 0x00 && command.parameters[1] == 0x00 && command.parameters[2] == 0xf0) + { + // unknown vendor command sent to devices + if (command.parameters[3] == 0x23) + { + cec_command response; + cec_command::Format(response, command.destination, command.initiator, CEC_OPCODE_VENDOR_COMMAND_WITH_ID); + + // samsung vendor id + response.parameters.PushBack(0x00); response.parameters.PushBack(0x00); response.parameters.PushBack(0xf0); + + // XXX see bugzid 2164. reply sent back by audio systems, we might have to send something different + response.parameters.PushBack(0x24); + response.parameters.PushBack(0x00); + response.parameters.PushBack(0x80); + + Transmit(response, false, true); + return COMMAND_HANDLED; + } + } + return CEC_ABORT_REASON_INVALID_OPERAND; +} + +int CANCommandHandler::HandleSetMenuLanguage(const cec_command &command) +{ + if (m_processor->CECInitialised() && command.initiator == CECDEVICE_TV && command.destination == CECDEVICE_BROADCAST) + { + m_processor->GetDevice(command.initiator)->SetPowerStatus(CEC_POWER_STATUS_ON); + } + + return CCECCommandHandler::HandleSetMenuLanguage(command); +}