-bool CCECProcessor::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_busDevices[m_lastInitiator]->GetHandler()->HandlePoll(m_currentframe.initiator, m_currentframe.destination);
- }
- }
- break;
- case MSGCODE_RECEIVE_FAILED:
- {
- if (m_lastInitiator != CECDEVICE_UNKNOWN)
- bIsError = m_busDevices[m_lastInitiator]->GetHandler()->HandleReceiveFailed();
- }
- 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;
- }
-
- m_controller->AddLog(bIsError ? CEC_LOG_WARNING : CEC_LOG_DEBUG, msg.ToString());
- return bEom;
-}
-
-void CCECProcessor::ParseCommand(cec_command &command)