return bReturn;
}
-uint16_t CCECBusDevice::GetPhysicalAddress(bool bUpdate /* = false */, bool bSuppressPoll /* = false */)
+uint16_t CCECBusDevice::GetPhysicalAddress(bool bSuppressUpdate /* = true */)
{
- bool bIsPresent(GetStatus(false, bSuppressPoll) == CEC_DEVICE_STATUS_PRESENT);
- bool bRequestUpdate(false);
+ if (!bSuppressUpdate)
{
- CLockObject lock(m_mutex);
- bRequestUpdate = bIsPresent &&
- (m_iPhysicalAddress == 0xFFFF || bUpdate);
- }
+ bool bIsPresent(GetStatus() == CEC_DEVICE_STATUS_PRESENT);
+ bool bRequestUpdate(false);
+ {
+ CLockObject lock(m_mutex);
+ bRequestUpdate = bIsPresent && m_iPhysicalAddress == 0xFFFF;
+ }
- if (bRequestUpdate)
- {
- CheckVendorIdRequested();
- if (!RequestPhysicalAddress())
- CLibCEC::AddLog(CEC_LOG_ERROR, "failed to request the physical address");
+ if (bRequestUpdate)
+ {
+ CheckVendorIdRequested();
+ if (!RequestPhysicalAddress())
+ CLibCEC::AddLog(CEC_LOG_ERROR, "failed to request the physical address");
+ }
}
CLockObject lock(m_mutex);
m_iStreamPath = iNewAddress;
// suppress polls when searching for a device
- CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iNewAddress, false, true);
+ CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iNewAddress);
if (device)
{
// if a device is found with the new physical address, mark it as active, which will automatically mark all other devices as inactive
else
{
// try to find the device with the old address, and mark it as inactive when found
- device = m_processor->GetDeviceByPhysicalAddress(iOldAddress, false, true);
+ device = m_processor->GetDeviceByPhysicalAddress(iOldAddress);
if (device)
device->SetInactiveSource();
}