/*
* 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.
cec_keypress key;
key.duration = CEC_BUTTON_TIMEOUT;
- key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN;
+ key.keycode = (cec_user_control_code)command.parameters[0];
- switch (command.parameters[0])
- {
- case CEC_USER_CONTROL_CODE_AN_RETURN:
- key.keycode = client && client->GetClientVersion() >= CEC_CLIENT_VERSION_1_5_0 ?
- CEC_USER_CONTROL_CODE_AN_RETURN :
- CEC_USER_CONTROL_CODE_EXIT;
- break;
- case CEC_USER_CONTROL_CODE_AN_CHANNELS_LIST:
- key.keycode = CEC_USER_CONTROL_CODE_AN_CHANNELS_LIST;
- break;
- default:
- break;
- }
-
- if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN && client)
+ if (client)
client->AddKey(key);
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)
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;
+}