public:
CCECAdapterMessage(void) { clear(); }
CCECAdapterMessage(const cec_command &command);
+ CCECAdapterMessage &operator =(const CCECAdapterMessage &msg);
bool empty(void) const { return packet.empty(); }
uint8_t operator[](uint8_t pos) const { return packet[pos]; }
cec_adapter_message_state state;
CMutex mutex;
CCondition condition;
-
- private:
- CCECAdapterMessage &operator =(const CCECAdapterMessage &msg);
};
typedef boost::shared_ptr<CCECAdapterMessage> CCECAdapterMessagePtr;
{
CLockObject lock(&m_mutex);
- CCECAdapterMessagePtr msgPtr;
- if (m_frameBuffer.Pop(msgPtr))
- bParseFrame = ParseMessage(*msgPtr.get());
- else if (m_communication->IsOpen() && m_communication->Read(msg, 50))
- bParseFrame = ParseMessage(msg);
+ if (m_communication->IsOpen() && m_communication->Read(msg, 50))
+ bParseFrame = ParseMessage(msg) && !IsStopped();
- bParseFrame &= !IsStopped();
if (bParseFrame)
command = m_currentframe;
}
*bError = true;
break;
default:
- CCECAdapterMessagePtr msgPtr = CCECAdapterMessagePtr(new CCECAdapterMessage(msg));
- m_frameBuffer.Push(msgPtr);
+ CStdString strLog;
+ strLog.Format("received unexpected reply '%2x'", msg.message());
+ m_controller->AddLog(CEC_LOG_WARNING, strLog);
+ *bError = true;
break;
}
cec_command m_currentframe;
cec_logical_address m_iLogicalAddress;
- CecBuffer<CCECAdapterMessagePtr> m_frameBuffer;
std::string m_strDeviceName;
CMutex m_mutex;
CCondition m_startCondition;