From 0ecbcd4dd338a4e0e7dcf0400274cebf6744ff4e Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Wed, 7 Dec 2011 00:59:13 +0100 Subject: [PATCH] cec: handle LG reconnect --- src/lib/implementations/SLCommandHandler.cpp | 15 +++++++++------ src/lib/implementations/SLCommandHandler.h | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/lib/implementations/SLCommandHandler.cpp b/src/lib/implementations/SLCommandHandler.cpp index b1f1644..fbc6b52 100644 --- a/src/lib/implementations/SLCommandHandler.cpp +++ b/src/lib/implementations/SLCommandHandler.cpp @@ -53,6 +53,7 @@ CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice) : m_bSLEnabled(false), m_bVendorIdSent(false) { + /* TODO set to powered off until we fixed the connect on start loop issue */ m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary]->m_powerStatus = CEC_POWER_STATUS_STANDBY; } @@ -67,19 +68,19 @@ bool CSLCommandHandler::HandleVendorCommand(const cec_command &command) else if (command.parameters.size == 2 && command.parameters[0] == SL_COMMAND_POWER_ON) { - HandleVendorCommand03(command); + HandleVendorCommandPowerOn(command); return true; } else if (command.parameters.size == 2 && command.parameters[0] == SL_COMMAND_CONNECT_REQUEST) { - HandleVendorCommand04(command); + HandleVendorCommandSLConnect(command); return true; } else if (command.parameters.size == 1 && command.parameters[0] == SL_COMMAND_REQUEST_POWER_STATUS) { - HandleVendorCommandA0(command); + HandleVendorCommandPowerOnStatus(command); return true; } @@ -128,7 +129,7 @@ void CSLCommandHandler::TransmitVendorCommand04(const cec_logical_address iSourc Transmit(response); } -void CSLCommandHandler::HandleVendorCommand03(const cec_command &command) +void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command) { CCECBusDevice *device = m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary]; if (device) @@ -141,14 +142,16 @@ void CSLCommandHandler::HandleVendorCommand03(const cec_command &command) } } -void CSLCommandHandler::HandleVendorCommand04(const cec_command &command) +void CSLCommandHandler::HandleVendorCommandSLConnect(const cec_command &command) { m_bSLEnabled = true; + m_processor->m_busDevices[command.destination]->TransmitActiveSource(); + m_processor->SetStreamPath(m_processor->m_busDevices[command.destination]->GetPhysicalAddress(false)); TransmitVendorCommand04(command.destination, command.initiator); TransmitDeckStatus(command.initiator); } -void CSLCommandHandler::HandleVendorCommandA0(const cec_command &command) +void CSLCommandHandler::HandleVendorCommandPowerOnStatus(const cec_command &command) { if (command.destination != CECDEVICE_BROADCAST) { diff --git a/src/lib/implementations/SLCommandHandler.h b/src/lib/implementations/SLCommandHandler.h index d00f2cd..7d43c9a 100644 --- a/src/lib/implementations/SLCommandHandler.h +++ b/src/lib/implementations/SLCommandHandler.h @@ -51,9 +51,9 @@ namespace CEC protected: virtual void HandleVendorCommand01(const cec_command &command); - virtual void HandleVendorCommand03(const cec_command &command); - virtual void HandleVendorCommand04(const cec_command &command); - virtual void HandleVendorCommandA0(const cec_command &command); + virtual void HandleVendorCommandPowerOn(const cec_command &command); + virtual void HandleVendorCommandSLConnect(const cec_command &command); + virtual void HandleVendorCommandPowerOnStatus(const cec_command &command); virtual void TransmitVendorCommand0205(const cec_logical_address iSource, const cec_logical_address iDestination); virtual void TransmitVendorCommand04(const cec_logical_address iSource, const cec_logical_address iDestination); -- 2.34.1