X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FSLCommandHandler.cpp;h=b9103ec5f59da75a037aee61f68a68c9986bde46;hb=5daed059e1d5bca3ddfa0787679ef4e7b349e382;hp=3e79fd1e433511622c25ddeb6943e889492b293a;hpb=60383b11a744aae1352f84d1a93aef163b0a17a0;p=deb_libcec.git diff --git a/src/lib/implementations/SLCommandHandler.cpp b/src/lib/implementations/SLCommandHandler.cpp index 3e79fd1..b9103ec 100644 --- a/src/lib/implementations/SLCommandHandler.cpp +++ b/src/lib/implementations/SLCommandHandler.cpp @@ -68,9 +68,8 @@ CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice) : primary->ReplaceHandler(false); } - /* LG TVs don't always reply to CEC version requests, so just set it to 1.3a */ - if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV) - m_busDevice->SetCecVersion(CEC_VERSION_1_3A); + /* LG devices don't always reply to CEC version requests, so just set it to 1.3a */ + m_busDevice->SetCecVersion(CEC_VERSION_1_3A); /* LG devices always return "korean" as language */ cec_menu_language lang; @@ -128,7 +127,7 @@ bool CSLCommandHandler::HandleActiveSource(const cec_command &command) { uint16_t iAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); CCECBusDevice *primary = m_processor->GetPrimaryDevice(); - bool bSendPowerOffState(iAddress != primary->GetPhysicalAddress(false) && primary->IsActiveSource()); + bool bSendPowerOffState(iAddress != primary->GetPhysicalAddress() && primary->IsActiveSource()); m_processor->SetActiveSource(iAddress); if (bSendPowerOffState) @@ -158,18 +157,6 @@ bool CSLCommandHandler::HandleDeviceVendorId(const cec_command &command) return true; } -bool CSLCommandHandler::HandleGivePhysicalAddress(const cec_command &command) -{ - if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination)) - { - CCECBusDevice *device = GetDevice(command.destination); - if (device) - return device->TransmitPhysicalAddress(); // only the physical address, don't send image view on - } - - return false; -} - bool CSLCommandHandler::HandleVendorCommand(const cec_command &command) { if (!m_busDevice->MyLogicalAddressContains(command.destination)) @@ -216,7 +203,7 @@ void CSLCommandHandler::TransmitVendorCommand0205(const cec_logical_address iSou response.PushBack(SL_COMMAND_UNKNOWN_02); response.PushBack(SL_COMMAND_TYPE_HDDRECORDER); - Transmit(response, false); + Transmit(response); } void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command) @@ -267,7 +254,7 @@ void CSLCommandHandler::TransmitVendorCommandSetDeviceMode(const cec_logical_add cec_command::Format(response, iSource, iDestination, CEC_OPCODE_VENDOR_COMMAND); response.PushBack(SL_COMMAND_SET_DEVICE_MODE); response.PushBack((uint8_t)type); - Transmit(response, false); + Transmit(response); } bool CSLCommandHandler::HandleGiveDeckStatus(const cec_command &command) @@ -279,7 +266,7 @@ bool CSLCommandHandler::HandleGiveDeckStatus(const cec_command &command) { if (command.parameters.size > 0) { - ((CCECPlaybackDevice *) device)->SetDeckStatus(!device->IsActiveSource() || !ActiveSourceSent() ? CEC_DECK_INFO_OTHER_STATUS : CEC_DECK_INFO_OTHER_STATUS_LG); + ((CCECPlaybackDevice *) device)->SetDeckStatus(!device->IsActiveSource() ? CEC_DECK_INFO_OTHER_STATUS : CEC_DECK_INFO_OTHER_STATUS_LG); if (command.parameters[0] == CEC_STATUS_REQUEST_ON) { bool bReturn = ((CCECPlaybackDevice *) device)->TransmitDeckStatus(command.initiator); @@ -412,6 +399,10 @@ bool CSLCommandHandler::PowerOn(const cec_logical_address iInitiator, const cec_ { /* LG devices only allow themselves to be woken up by the TV with a vendor command */ cec_command command; + + if (!m_bSLEnabled) + TransmitVendorID(CECDEVICE_TV, CEC_VENDOR_LG); + cec_command::Format(command, CECDEVICE_TV, iDestination, CEC_OPCODE_VENDOR_COMMAND); command.PushBack(SL_COMMAND_POWER_ON); command.PushBack(0);