void CCECProcessor::ParseCommand(const cec_command &command)
{
CStdString dataStr;
- dataStr.Format(">> %1x%1x:%02x", command.initiator, command.destination, command.opcode);
+ dataStr.Format(">> %1x%1x", command.initiator, command.destination);
+ if (command.opcode_set == 1)
+ dataStr.AppendFormat(":%02x", command.opcode);
for (uint8_t iPtr = 0; iPtr < command.parameters.size; iPtr++)
dataStr.AppendFormat(":%02x", (unsigned int)command.parameters[iPtr]);
CLibCEC::AddLog(CEC_LOG_TRAFFIC, dataStr.c_str());
}
if (m_currentframe.ack == 0x1)
{
- m_lastInitiator = m_currentframe.initiator;
- m_processor->HandlePoll(m_currentframe.initiator, m_currentframe.destination);
+ m_lastInitiator = m_currentframe.initiator;
+ m_currentframe.eom = 1;
+ bEom = true;
}
}
break;
}
CLibCEC::AddLog(bIsError ? CEC_LOG_WARNING : CEC_LOG_DEBUG, msg.ToString());
- return msg.IsEOM();
+ return msg.IsEOM() || bEom;
}
uint16_t CUSBCECAdapterCommunication::GetFirmwareVersion(void)
m_iLastActive = GetTimeMs();
/* don't call GetStatus() here, just read the value with the mutex locked */
- if (m_deviceStatus != CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC)
+ if (m_deviceStatus != CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC && command.opcode_set == 1)
m_deviceStatus = CEC_DEVICE_STATUS_PRESENT;
MarkBusy();
bool CCECCommandHandler::HandleCommand(const cec_command &command)
{
+ if (command.opcode_set == 0)
+ return HandlePoll(command);
+
bool bHandled(true);
CLibCEC::AddCommand(command);
return false;
}
+bool CCECCommandHandler::HandlePoll(const cec_command &command)
+{
+ m_busDevice->HandlePoll(command.initiator);
+ return true;
+}
+
bool CCECCommandHandler::HandleReportAudioStatus(const cec_command &command)
{
if (command.parameters.size == 1)
virtual bool HandleGiveSystemAudioModeStatus(const cec_command &command);
virtual bool HandleImageViewOn(const cec_command &command);
virtual bool HandleMenuRequest(const cec_command &command);
+ virtual bool HandlePoll(const cec_command &command);
virtual bool HandleReportAudioStatus(const cec_command &command);
virtual bool HandleReportPhysicalAddress(const cec_command &command);
virtual bool HandleReportPowerStatus(const cec_command &command);