+bool CUSBCECAdapterCommunication::ParseMessage(const CCECAdapterMessage &msg)
+{
+ bool bEom(false);
+ bool bIsError(msg.IsError());
+
+ if (msg.IsEmpty())
+ return bEom;
+
+ switch(msg.Message())
+ {
+ case MSGCODE_FRAME_START:
+ {
+ m_currentframe.Clear();
+ if (msg.Size() >= 2)
+ {
+ m_currentframe.initiator = msg.Initiator();
+ m_currentframe.destination = msg.Destination();
+ m_currentframe.ack = msg.IsACK();
+ m_currentframe.eom = msg.IsEOM();
+ }
+ if (m_currentframe.ack == 0x1)
+ {
+ m_lastInitiator = m_currentframe.initiator;
+ m_processor->HandlePoll(m_currentframe.initiator, m_currentframe.destination);
+ }
+ }
+ break;
+ case MSGCODE_RECEIVE_FAILED:
+ {
+ m_currentframe.Clear();
+ if (m_lastInitiator != CECDEVICE_UNKNOWN)
+ bIsError = m_processor->HandleReceiveFailed(m_lastInitiator);
+ }
+ break;
+ case MSGCODE_FRAME_DATA:
+ {
+ if (msg.Size() >= 2)
+ {
+ m_currentframe.PushBack(msg[1]);
+ m_currentframe.eom = msg.IsEOM();
+ }
+ bEom = msg.IsEOM();
+ }
+ break;
+ default:
+ break;
+ }
+
+ CLibCEC::AddLog(bIsError ? CEC_LOG_WARNING : CEC_LOG_DEBUG, msg.ToString());
+ return bEom;
+}
+
+uint16_t CUSBCECAdapterCommunication::GetFirmwareVersion(void)