{
bool bReturn(false);
- if (!MyLogicalAddressContains(m_iLogicalAddress))
+ if (!MyLogicalAddressContains(m_iLogicalAddress) &&
+ !IsUnsupportedFeature(CEC_OPCODE_GET_CEC_VERSION))
{
MarkBusy();
CLibCEC::AddLog(CEC_LOG_NOTICE, "<< requesting CEC version of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
bool CCECBusDevice::TransmitOSDString(cec_logical_address dest, cec_display_control duration, const char *strMessage)
{
bool bReturn(false);
- if (!IsUnsupportedFeature(CEC_OPCODE_SET_OSD_STRING))
+ if (!m_processor->m_busDevices[dest]->IsUnsupportedFeature(CEC_OPCODE_SET_OSD_STRING))
{
CLibCEC::AddLog(CEC_LOG_NOTICE, "<< %s (%X) -> %s (%X): display OSD message '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(dest), dest, strMessage);
MarkBusy();
bool CCECBusDevice::IsUnsupportedFeature(cec_opcode opcode) const
{
- return m_unsupportedFeatures.find(opcode) != m_unsupportedFeatures.end();
+ bool bUnsupported = (m_unsupportedFeatures.find(opcode) != m_unsupportedFeatures.end());
+ if (bUnsupported)
+ CLibCEC::AddLog(CEC_LOG_NOTICE, "'%s' is marked as unsupported feature for device '%s'", ToString(opcode), GetLogicalAddressName());
+ return bUnsupported;
}
void CCECBusDevice::SetUnsupportedFeature(cec_opcode opcode)
{
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "marking opcode '%s' as unsupported feature for device '%s'", ToString(opcode), GetLogicalAddressName());
m_unsupportedFeatures.insert(opcode);
}
m_iTransmitRetries(CEC_DEFAULT_TRANSMIT_RETRIES),
m_bHandlerInited(false),
m_expectedResponse(CEC_OPCODE_NONE),
+ m_lastCommandSent(CEC_OPCODE_NONE),
m_bOPTSendDeckStatusUpdateOnActiveSource(false),
m_vendorId(CEC_VENDOR_UNKNOWN),
m_bRcvSignal(false)
{
CLockObject lock(m_receiveMutex);
if (m_expectedResponse == CEC_OPCODE_NONE ||
- m_expectedResponse == command.opcode)
+ m_expectedResponse == command.opcode ||
+ (command.opcode == CEC_OPCODE_FEATURE_ABORT && command.parameters.size > 0 && command.parameters[0] == m_lastCommandSent))
{
m_bRcvSignal = true;
m_condition.Signal();
bool CCECCommandHandler::HandleFeatureAbort(const cec_command &command)
{
- if (command.parameters.size == 2)
- {
+ if (command.parameters.size == 2 && command.parameters[1] == CEC_ABORT_REASON_UNRECOGNIZED_OPCODE)
m_processor->m_busDevices[command.initiator]->SetUnsupportedFeature((cec_opcode)command.parameters[0]);
- }
return true;
}
while (!bReturn && ++iTries <= iMaxTries)
{
m_expectedResponse = expectedResponse;
+ m_lastCommandSent = command.opcode;
+ m_bRcvSignal = false;
if ((bReturn = m_processor->Transmit(command)) == true)
{
CLibCEC::AddLog(CEC_LOG_DEBUG, "command transmitted");
if (bExpectResponse)
bReturn = m_condition.Wait(m_receiveMutex, m_bRcvSignal, m_iTransmitWait);
- m_bRcvSignal = false;
CLibCEC::AddLog(CEC_LOG_DEBUG, bReturn ? "expected response received" : "expected response not received");
}
}
int8_t m_iTransmitRetries;
bool m_bHandlerInited;
cec_opcode m_expectedResponse;
+ cec_opcode m_lastCommandSent;
bool m_bOPTSendDeckStatusUpdateOnActiveSource;
cec_vendor_id m_vendorId;
PLATFORM::CMutex m_receiveMutex;