+ CStdString strLog;
+ strLog.Format("<< requesting OSD name of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
+ AddLog(CEC_LOG_NOTICE, strLog);
+ cec_command command;
+ cec_command::Format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GIVE_OSD_NAME, m_iTransmitTimeout);
+ CLockObject lock(&m_transmitMutex);
+ if (m_processor->Transmit(command))
+ bReturn = m_condition.Wait(&m_transmitMutex, 1000);
+ }
+ return bReturn;
+}
+
+uint16_t CCECBusDevice::GetPhysicalAddress(bool bRefresh /* = true */)
+{
+ CLockObject lock(&m_mutex);
+ if (GetStatus() == CEC_DEVICE_STATUS_PRESENT &&
+ (m_iPhysicalAddress == 0xFFFF || bRefresh))
+ {
+ if (!RequestPhysicalAddress())
+ AddLog(CEC_LOG_ERROR, "failed to request the physical address");
+ }
+
+ return m_iPhysicalAddress;
+}
+
+bool CCECBusDevice::RequestPhysicalAddress(void)
+{
+ bool bReturn(false);
+ if (!MyLogicalAddressContains(m_iLogicalAddress))
+ {
+ CStdString strLog;
+ strLog.Format("<< requesting physical address of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
+ AddLog(CEC_LOG_NOTICE, strLog);
+ cec_command command;
+ cec_command::Format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GIVE_PHYSICAL_ADDRESS, m_iTransmitTimeout);
+ CLockObject lock(&m_transmitMutex);
+ if (m_processor->Transmit(command))
+ bReturn = m_condition.Wait(&m_transmitMutex, 1000);