From: Lars Op den Kamp Date: Thu, 15 Nov 2012 14:15:52 +0000 (+0100) Subject: transmit an abort message when the vendor id is requested for philips, instead of... X-Git-Tag: upstream/2.2.0~1^2~12^2~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=869ff0273152d0b8756a49992c6e51d1f15f2ebe;p=deb_libcec.git transmit an abort message when the vendor id is requested for philips, instead of returning philips's vendor id --- diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index b7b08c7..6703e87 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -748,7 +748,7 @@ bool CCECBusDevice::TransmitVendorID(const cec_logical_address destination, bool else { LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): vendor id %s (%x)", GetLogicalAddressName(), m_iLogicalAddress, ToString(destination), destination, ToString((cec_vendor_id)iVendorId), iVendorId); - bReturn = m_handler->TransmitVendorID(m_iLogicalAddress, iVendorId, bIsReply); + bReturn = m_handler->TransmitVendorID(m_iLogicalAddress, destination, iVendorId, bIsReply); } MarkReady(); return bReturn; diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 27e692e..7031f09 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -1034,7 +1034,7 @@ bool CCECCommandHandler::TransmitPowerState(const cec_logical_address iInitiator return Transmit(command, false, bIsReply); } -bool CCECCommandHandler::TransmitVendorID(const cec_logical_address iInitiator, uint64_t iVendorId, bool bIsReply) +bool CCECCommandHandler::TransmitVendorID(const cec_logical_address iInitiator, const cec_logical_address UNUSED(iDestination), uint64_t iVendorId, bool bIsReply) { cec_command command; cec_command::Format(command, iInitiator, CECDEVICE_BROADCAST, CEC_OPCODE_DEVICE_VENDOR_ID); diff --git a/src/lib/implementations/CECCommandHandler.h b/src/lib/implementations/CECCommandHandler.h index 7ea5485..61e7f22 100644 --- a/src/lib/implementations/CECCommandHandler.h +++ b/src/lib/implementations/CECCommandHandler.h @@ -83,7 +83,7 @@ namespace CEC virtual bool TransmitSetMenuLanguage(const cec_logical_address iInitiator, const char lang[3], bool bIsReply); virtual bool TransmitPoll(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bIsReply); virtual bool TransmitPowerState(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_power_status state, bool bIsReply); - virtual bool TransmitVendorID(const cec_logical_address iInitiator, uint64_t iVendorId, bool bIsReply); + virtual bool TransmitVendorID(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint64_t iVendorId, bool bIsReply); virtual bool TransmitAudioStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint8_t state, bool bIsReply); virtual bool TransmitSetSystemAudioMode(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_system_audio_status state, bool bIsReply); virtual bool TransmitSystemAudioModeStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_system_audio_status state, bool bIsReply); diff --git a/src/lib/implementations/PHCommandHandler.cpp b/src/lib/implementations/PHCommandHandler.cpp index a4e7129..b46f69e 100644 --- a/src/lib/implementations/PHCommandHandler.cpp +++ b/src/lib/implementations/PHCommandHandler.cpp @@ -151,9 +151,9 @@ int CPHCommandHandler::HandleDeviceVendorId(const cec_command& command) return CCECCommandHandler::HandleDeviceVendorId(command); } -int CPHCommandHandler::HandleGiveDeviceVendorId(const cec_command& command) +bool CPHCommandHandler::TransmitVendorID(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint64_t UNUSED(iVendorId), bool UNUSED(bIsReply)) { - LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): vendor id feature abort", ToString(command.destination), command.destination, ToString(command.initiator), command.initiator); - m_processor->TransmitAbort(command.destination, command.initiator, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID); - return COMMAND_HANDLED; + LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): vendor id feature abort", ToString(iInitiator), iInitiator, ToString(iDestination), iDestination); + m_processor->TransmitAbort(iInitiator, iDestination, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID); + return true; } diff --git a/src/lib/implementations/PHCommandHandler.h b/src/lib/implementations/PHCommandHandler.h index 8118d82..d1788c0 100644 --- a/src/lib/implementations/PHCommandHandler.h +++ b/src/lib/implementations/PHCommandHandler.h @@ -69,7 +69,7 @@ namespace CEC virtual bool ActivateSource(bool bTransmitDelayedCommandsOnly = false); virtual int HandleUserControlPressed(const cec_command& command); virtual int HandleUserControlRelease(const cec_command& command); - virtual int HandleGiveDeviceVendorId(const cec_command& command); + virtual bool TransmitVendorID(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint64_t iVendorId, bool bIsReply); virtual int HandleDeviceVendorId(const cec_command& command); uint8_t m_iLastKeyCode; CImageViewOnCheck* m_imageViewOnCheck; diff --git a/src/lib/implementations/SLCommandHandler.cpp b/src/lib/implementations/SLCommandHandler.cpp index 4671037..e686fdd 100644 --- a/src/lib/implementations/SLCommandHandler.cpp +++ b/src/lib/implementations/SLCommandHandler.cpp @@ -403,7 +403,7 @@ bool CSLCommandHandler::PowerOn(const cec_logical_address iInitiator, const cec_ cec_command command; if (!m_bSLEnabled) - TransmitVendorID(CECDEVICE_TV, CEC_VENDOR_LG, false); + TransmitVendorID(CECDEVICE_TV, iDestination, CEC_VENDOR_LG, false); cec_command::Format(command, CECDEVICE_TV, iDestination, CEC_OPCODE_VENDOR_COMMAND); command.PushBack(SL_COMMAND_POWER_ON);