{
CLockObject lock(&m_mutex);
- if (m_communication->IsOpen() && m_communication->Read(msg, 50))
+ if (m_frameBuffer.Pop(msg) ||
+ (m_communication->IsOpen() && m_communication->Read(msg, 50)))
bParseFrame = ParseMessage(msg);
bParseFrame &= !IsStopped();
bool CCECProcessor::SetLogicalAddress(cec_logical_address iLogicalAddress)
{
- CStdString strLog;
- strLog.Format("<< setting logical address to %1x", iLogicalAddress);
- m_controller->AddLog(CEC_LOG_NOTICE, strLog.c_str());
+ if (m_iLogicalAddress != iLogicalAddress)
+ {
+ CStdString strLog;
+ strLog.Format("<< setting logical address to %1x", iLogicalAddress);
+ m_controller->AddLog(CEC_LOG_NOTICE, strLog.c_str());
+
+ m_iLogicalAddress = iLogicalAddress;
+ return m_communication && m_communication->SetAckMask(0x1 << (uint8_t)m_iLogicalAddress);
+ }
- m_iLogicalAddress = iLogicalAddress;
- return m_communication && m_communication->SetAckMask(0x1 << (uint8_t)m_iLogicalAddress);
+ return true;
}
bool CCECProcessor::SetPhysicalAddress(uint16_t iPhysicalAddress)
bool bReturn(false);
LogOutput(data);
- CCECAdapterMessage output(data);
+ CCECAdapterMessagePtr output(new CCECAdapterMessage(data));
CLockObject lock(&m_mutex);
if (!m_communication || !m_communication->Write(output))
if (bWaitForAck)
{
bool bError(false);
- if ((bReturn = WaitForAck(&bError, output.size(), 1000)) == false)
+ if ((bReturn = WaitForAck(&bError, output->size(), 1000)) == false)
m_controller->AddLog(CEC_LOG_ERROR, "did not receive ack");
}
else