CCECBusDevice *primary = GetPrimaryDevice();
// poll the destination, with the primary as source
if (primary)
- return primary->TransmitPoll(iAddress, false);
+ return primary->TransmitPoll(iAddress, true);
return m_processor ? m_processor->PollDevice(iAddress) : false;
}
CCECBusDevice *primary = GetPrimaryDevice();
// poll the destination, with the primary as source
if (primary)
- return primary->TransmitPoll(iAddress, false);
+ return primary->TransmitPoll(iAddress, true);
CCECBusDevice *device = m_busDevices->At(CECDEVICE_UNREGISTERED);
if (device)
- return device->TransmitPoll(iAddress, false);
+ return device->TransmitPoll(iAddress, true);
return false;
}
CLockObject lock(m_mutex);
status = m_deviceStatus;
bNeedsPoll = !bSuppressPoll &&
- (bForcePoll || m_deviceStatus == CEC_DEVICE_STATUS_UNKNOWN);
+ (bForcePoll || m_deviceStatus == CEC_DEVICE_STATUS_UNKNOWN) &&
+ m_deviceStatus != CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC;
}
if (bNeedsPoll)
if (m_deviceStatus != newStatus)
LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): device status changed into 'present'", GetLogicalAddressName(), m_iLogicalAddress);
m_deviceStatus = newStatus;
+ m_iLastActive = GetTimeMs();
break;
case CEC_DEVICE_STATUS_NOT_PRESENT:
if (m_deviceStatus != newStatus)
m_deviceStatus = CEC_DEVICE_STATUS_UNKNOWN;
}
-bool CCECBusDevice::TransmitPoll(const cec_logical_address dest, bool bIsReply)
+bool CCECBusDevice::TransmitPoll(const cec_logical_address dest, bool bUpdateDeviceStatus)
{
bool bReturn(false);
cec_logical_address destination(dest);
MarkBusy();
LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): POLL", GetLogicalAddressName(), m_iLogicalAddress, ToString(dest), dest);
- bReturn = m_handler->TransmitPoll(m_iLogicalAddress, destination, bIsReply);
+ bReturn = m_handler->TransmitPoll(m_iLogicalAddress, destination, false);
LIB_CEC->AddLog(CEC_LOG_DEBUG, bReturn ? ">> POLL sent" : ">> POLL not sent");
- CLockObject lock(m_mutex);
- if (bReturn)
- {
- m_iLastActive = GetTimeMs();
- SetDeviceStatus(CEC_DEVICE_STATUS_PRESENT);
- }
- else
- SetDeviceStatus(CEC_DEVICE_STATUS_NOT_PRESENT);
+ if (bUpdateDeviceStatus)
+ destDevice->SetDeviceStatus(bReturn ? CEC_DEVICE_STATUS_PRESENT : CEC_DEVICE_STATUS_NOT_PRESENT);
MarkReady();
return bReturn;
virtual cec_bus_device_status GetStatus(bool bForcePoll = false, bool bSuppressPoll = false);
virtual void SetDeviceStatus(const cec_bus_device_status newStatus, cec_version libCECSpecVersion = CEC_VERSION_1_4);
virtual void ResetDeviceStatus(void);
- virtual bool TransmitPoll(const cec_logical_address destination, bool bIsReply);
+ virtual bool TransmitPoll(const cec_logical_address destination, bool bUpdateDeviceStatus);
virtual void HandlePoll(const cec_logical_address destination);
virtual void HandlePollFrom(const cec_logical_address initiator);
virtual bool HandleReceiveFailed(void);