CLockObject lock(data->mutex);
data->state = ADAPTER_MESSAGE_STATE_WAITING_TO_BE_SENT;
m_outBuffer.Push(data);
- data->condition.Wait(data->mutex, data->transmit_timeout);
+ data->condition.Wait(data->mutex);
if ((data->expectControllerAck && data->state != ADAPTER_MESSAGE_STATE_SENT_ACKED) ||
(!data->expectControllerAck && data->state != ADAPTER_MESSAGE_STATE_SENT))
return m_handler->ActivateSource();
}
-void CCECBusDevice::HandlePoll(cec_logical_address destination)
+void CCECBusDevice::HandlePoll(cec_logical_address iDestination)
{
- CLockObject lock(m_handlerMutex);
- m_handler->HandlePoll(m_iLogicalAddress, destination);
+ CLockObject lock(m_mutex);
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "<< POLL: %s (%x) -> %s (%x)", ToString(m_iLogicalAddress), m_iLogicalAddress, ToString(iDestination), iDestination);
+ m_bAwaitingReceiveFailed = true;
}
bool CCECBusDevice::HandleReceiveFailed(void)
{
CLockObject lock(m_handlerMutex);
- return m_handler->HandleReceiveFailed();
+ bool bReturn = m_bAwaitingReceiveFailed;
+ m_bAwaitingReceiveFailed = false;
+ return bReturn;
}
//@}
std::set<cec_opcode> m_unsupportedFeatures;
PLATFORM::CMutex m_mutex;
PLATFORM::CMutex m_handlerMutex;
+ bool m_bAwaitingReceiveFailed;
};
};
}
}
-void CCECCommandHandler::HandlePoll(const cec_logical_address iInitiator, const cec_logical_address iDestination)
-{
- CLibCEC::AddLog(CEC_LOG_DEBUG, "<< POLL: %s (%x) -> %s (%x)", m_processor->ToString(iInitiator), iInitiator, m_processor->ToString(iDestination), iDestination);
-}
-
-bool CCECCommandHandler::HandleReceiveFailed(void)
-{
- /* default = error */
- return true;
-}
-
bool CCECCommandHandler::TransmitImageViewOn(const cec_logical_address iInitiator, const cec_logical_address iDestination)
{
cec_command command;
virtual bool HandleCommand(const cec_command &command);
virtual cec_vendor_id GetVendorId(void) { return m_vendorId; };
virtual void SetVendorId(cec_vendor_id vendorId) { m_vendorId = vendorId; }
- virtual void HandlePoll(const cec_logical_address iInitiator, const cec_logical_address iDestination);
- virtual bool HandleReceiveFailed(void);
static bool HasSpecificHandler(cec_vendor_id vendorId) { return vendorId == CEC_VENDOR_LG || vendorId == CEC_VENDOR_SAMSUNG || vendorId == CEC_VENDOR_PANASONIC;}
virtual bool InitHandler(void) { return true; }
CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice) :
CCECCommandHandler(busDevice),
- m_bAwaitingReceiveFailed(false),
m_bSLEnabled(false),
m_bPowerStateReset(false)
{
CCECBusDevice *primary = m_processor->GetPrimaryDevice();
/* imitate LG devices */
- if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
+ if (primary && m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
primary->SetVendorId(CEC_VENDOR_LG);
SetLGDeckStatus();
m_busDevice->SetMenuLanguage(lang);
}
-
-void CSLCommandHandler::HandlePoll(const cec_logical_address iInitiator, const cec_logical_address iDestination)
-{
- CCECCommandHandler::HandlePoll(iInitiator, iDestination);
- m_bAwaitingReceiveFailed = true;
-}
-
-bool CSLCommandHandler::HandleReceiveFailed(void)
-{
- if (m_bAwaitingReceiveFailed)
- {
- m_bAwaitingReceiveFailed = false;
- return false;
- }
-
- return true;
-}
-
bool CSLCommandHandler::InitHandler(void)
{
if (m_bHandlerInited)
CSLCommandHandler(CCECBusDevice *busDevice);
virtual ~CSLCommandHandler(void) {};
- virtual void HandlePoll(const cec_logical_address iInitiator, const cec_logical_address iDestination);
- virtual bool HandleReceiveFailed(void);
-
virtual bool InitHandler(void);
virtual bool ActivateSource(void);
virtual void SetLGDeckStatus(void);
- bool m_bAwaitingReceiveFailed;
bool m_bSLEnabled;
bool m_bPowerStateReset;
};