Skip to content

Commit 344cddb

Browse files
committed
cec: added a vendor command for panasonic that will enable routing of some more buttons on the remote (guide, text, ...)
1 parent 2257901 commit 344cddb

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/lib/implementations/VLCommandHandler.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ bool CVLCommandHandler::InitHandler(void)
7878

7979
int CVLCommandHandler::HandleDeviceVendorCommandWithId(const cec_command &command)
8080
{
81+
if (command.parameters[0] != 0x00 ||
82+
command.parameters[1] != 0x80 ||
83+
command.parameters[2] != 0x45)
84+
return CEC_ABORT_REASON_INVALID_OPERAND;
85+
8186
if (command.initiator == CECDEVICE_TV &&
8287
command.destination == CECDEVICE_BROADCAST &&
8388
command.parameters.At(3) == VL_POWER_CHANGE)
@@ -164,3 +169,25 @@ bool CVLCommandHandler::PowerUpEventReceived(void)
164169
m_bPowerUpEventReceived = (powerStatus == CEC_POWER_STATUS_ON);
165170
return m_bPowerUpEventReceived;
166171
}
172+
173+
int CVLCommandHandler::HandleVendorCommand(const cec_command &command)
174+
{
175+
// some vendor command voodoo that will enable more buttons on the remote
176+
if (command.parameters.size == 3 &&
177+
command.parameters[0] == 0x10 &&
178+
command.parameters[1] == 0x01 &&
179+
command.parameters[2] == 0x05)
180+
{
181+
cec_command response;
182+
cec_command::Format(response, command.destination, command.initiator, CEC_OPCODE_VENDOR_COMMAND);
183+
uint8_t iResponseData[] = {0x10, 0x02, 0xFF, 0xFF, 0x00, 0x05, 0x05, 0x45, 0x55, 0x5c, 0x58, 0x32};
184+
response.PushArray(12, iResponseData);
185+
186+
Transmit(response, true);
187+
188+
return COMMAND_HANDLED;
189+
}
190+
191+
return CEC_ABORT_REASON_INVALID_OPERAND;
192+
}
193+

src/lib/implementations/VLCommandHandler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ namespace CEC
4747
bool TransmitActiveSource(const cec_logical_address iInitiator, uint16_t iPhysicalAddress);
4848
bool TransmitPendingActiveSourceCommands(void);
4949

50+
int HandleVendorCommand(const cec_command &command);
5051
bool PowerUpEventReceived(void);
5152
bool SupportsDeviceType(const cec_device_type type) const { return type != CEC_DEVICE_TYPE_RECORDING_DEVICE; };
5253
cec_device_type GetReplacementDeviceType(const cec_device_type type) const { return type == CEC_DEVICE_TYPE_RECORDING_DEVICE ? CEC_DEVICE_TYPE_PLAYBACK_DEVICE : type; }

0 commit comments

Comments
 (0)