/*
* This file is part of the libCEC(R) library.
*
- * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved.
* libCEC(R) is an original work, containing original code.
*
* libCEC(R) is a trademark of Pulse-Eight Limited.
thisMsgCode == MSGCODE_SET_HDMI_VERSION ||
thisMsgCode == MSGCODE_SET_OSD_NAME ||
thisMsgCode == MSGCODE_WRITE_EEPROM ||
- thisMsgCode == MSGCODE_TRANSMIT_IDLETIME)
+ thisMsgCode == MSGCODE_TRANSMIT_IDLETIME ||
+ thisMsgCode == MSGCODE_SET_ACTIVE_SOURCE)
return thisMsgCode == msgResponse;
if (!m_message->IsTranmission())
- {
- m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_WARNING, "FIXME! not a transmission");
return false;
- }
return ((msgCode == MSGCODE_COMMAND_ACCEPTED || msgCode == MSGCODE_COMMAND_REJECTED) &&
(msgResponse == MSGCODE_TRANSMIT_ACK_POLARITY || msgResponse == MSGCODE_TRANSMIT || msgResponse == MSGCODE_TRANSMIT_EOM)) ||
/* decrease by 1 */
m_iPacketsLeft--;
+#ifdef CEC_DEBUGGING
/* log this message */
CStdString strLog;
strLog.Format("%s - command accepted", ToString());
if (m_iPacketsLeft > 0)
strLog.AppendFormat(" - waiting for %d more", m_iPacketsLeft);
m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, strLog);
+#endif
/* no more packets left and not a transmission, so we're done */
if (!m_message->IsTranmission() && m_iPacketsLeft == 0)
if (m_iPacketsLeft == 0)
{
/* transmission succeeded, so we're done */
+#ifdef CEC_DEBUGGING
m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "%s - transmit succeeded", m_message->ToString().c_str());
+#endif
m_message->state = ADAPTER_MESSAGE_STATE_SENT_ACKED;
m_message->response = message.packet;
}
{
{
CLockObject lock(m_mutex);
+#ifdef CEC_DEBUGGING
m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "%s - received response - %s", ToString(), message.ToString().c_str());
+#else
+ if (message.IsError())
+ m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "%s - received response - %s", ToString(), message.ToString().c_str());
+#endif
m_message->response = message.packet;
if (m_message->IsTranmission())
m_message->state = message.Message() == MSGCODE_TRANSMIT_SUCCEEDED ? ADAPTER_MESSAGE_STATE_SENT_ACKED : ADAPTER_MESSAGE_STATE_SENT_NOT_ACKED;
CCECAdapterMessageQueue::~CCECAdapterMessageQueue(void)
{
+ StopThread(-1);
Clear();
- StopThread(0);
+ StopThread();
delete m_incomingAdapterMessage;
}
{
/* the message wasn't handled */
bool bIsError(m_com->HandlePoll(msg));
+#ifdef CEC_DEBUGGING
m_com->m_callback->GetLib()->AddLog(bIsError ? CEC_LOG_WARNING : CEC_LOG_DEBUG, msg.ToString().c_str());
+#else
+ if (bIsError)
+ m_com->m_callback->GetLib()->AddLog(CEC_LOG_WARNING, msg.ToString().c_str());
+#endif
/* push this message to the current frame */
if (!bIsError && msg.PushToCecCommand(m_currentCECFrame))
m_messages.erase(iEntryId);
}
- if (msg->ReplyIsError())
+ if (msg->ReplyIsError() && msg->state != ADAPTER_MESSAGE_STATE_SENT_NOT_ACKED)
msg->state = ADAPTER_MESSAGE_STATE_ERROR;
delete entry;