From: Lars Op den Kamp Date: Wed, 20 Jun 2012 13:33:36 +0000 (+0200) Subject: cec: added a vendor command for panasonic that will enable routing of some more butto... X-Git-Tag: upstream/2.2.0~1^2~22^2^2~33 X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=commitdiff_plain;h=344cddb96b42d56a1a7a6f4e1022de0d898a96ea cec: added a vendor command for panasonic that will enable routing of some more buttons on the remote (guide, text, ...) --- diff --git a/src/lib/implementations/VLCommandHandler.cpp b/src/lib/implementations/VLCommandHandler.cpp index 65f6c15..aadf988 100644 --- a/src/lib/implementations/VLCommandHandler.cpp +++ b/src/lib/implementations/VLCommandHandler.cpp @@ -78,6 +78,11 @@ bool CVLCommandHandler::InitHandler(void) int CVLCommandHandler::HandleDeviceVendorCommandWithId(const cec_command &command) { + if (command.parameters[0] != 0x00 || + command.parameters[1] != 0x80 || + command.parameters[2] != 0x45) + return CEC_ABORT_REASON_INVALID_OPERAND; + if (command.initiator == CECDEVICE_TV && command.destination == CECDEVICE_BROADCAST && command.parameters.At(3) == VL_POWER_CHANGE) @@ -164,3 +169,25 @@ bool CVLCommandHandler::PowerUpEventReceived(void) m_bPowerUpEventReceived = (powerStatus == CEC_POWER_STATUS_ON); return m_bPowerUpEventReceived; } + +int CVLCommandHandler::HandleVendorCommand(const cec_command &command) +{ + // some vendor command voodoo that will enable more buttons on the remote + if (command.parameters.size == 3 && + command.parameters[0] == 0x10 && + command.parameters[1] == 0x01 && + command.parameters[2] == 0x05) + { + cec_command response; + cec_command::Format(response, command.destination, command.initiator, CEC_OPCODE_VENDOR_COMMAND); + uint8_t iResponseData[] = {0x10, 0x02, 0xFF, 0xFF, 0x00, 0x05, 0x05, 0x45, 0x55, 0x5c, 0x58, 0x32}; + response.PushArray(12, iResponseData); + + Transmit(response, true); + + return COMMAND_HANDLED; + } + + return CEC_ABORT_REASON_INVALID_OPERAND; +} + diff --git a/src/lib/implementations/VLCommandHandler.h b/src/lib/implementations/VLCommandHandler.h index 8939057..8b26741 100644 --- a/src/lib/implementations/VLCommandHandler.h +++ b/src/lib/implementations/VLCommandHandler.h @@ -47,6 +47,7 @@ namespace CEC bool TransmitActiveSource(const cec_logical_address iInitiator, uint16_t iPhysicalAddress); bool TransmitPendingActiveSourceCommands(void); + int HandleVendorCommand(const cec_command &command); bool PowerUpEventReceived(void); bool SupportsDeviceType(const cec_device_type type) const { return type != CEC_DEVICE_TYPE_RECORDING_DEVICE; }; cec_device_type GetReplacementDeviceType(const cec_device_type type) const { return type == CEC_DEVICE_TYPE_RECORDING_DEVICE ? CEC_DEVICE_TYPE_PLAYBACK_DEVICE : type; }