*/
virtual cec_power_status GetDevicePowerStatus(cec_logical_address iAddress) = 0;
+ /*!
+ * @brief Get the physical address of the device with the given logical address.
+ * @param iLogicalAddress The device to get the vendor id for.
+ * @return The physical address or 0 if it wasn't found.
+ */
+ virtual uint16_t GetDevicePhysicalAddress(cec_logical_address iAddress) = 0;
+
/*!
* @brief Sends a POLL message to a device.
* @param iAddress The device to send the message to.
extern DECLSPEC uint64_t cec_get_device_vendor_id(cec_logical_address iLogicalAddress);
#endif
+#ifdef __cplusplus
+extern DECLSPEC uint16_t cec_get_device_physical_address(CEC::cec_logical_address iLogicalAddress);
+#else
+extern DECLSPEC uint16_t cec_get_device_physical_address(cec_logical_address iLogicalAddress);
+#endif
+
#ifdef __cplusplus
extern DECLSPEC CEC::cec_power_status cec_get_device_power_status(CEC::cec_logical_address iLogicalAddress);
#else
for (uint8_t iPtr = 0; iPtr < 15; iPtr++)
if (m_logicalAddresses[iPtr])
{
+ m_busDevices[iPtr]->SetInactiveDevice();
m_busDevices[iPtr]->SetPhysicalAddress(iPhysicalAddress);
m_busDevices[iPtr]->TransmitPhysicalAddress();
}
return false;
}
+uint16_t CCECProcessor::GetDevicePhysicalAddress(cec_logical_address iAddress)
+{
+ if (m_busDevices[iAddress])
+ return m_busDevices[iAddress]->GetPhysicalAddress(false);
+ return false;
+}
+
cec_power_status CCECProcessor::GetDevicePowerStatus(cec_logical_address iAddress)
{
if (m_busDevices[iAddress])
virtual cec_logical_address GetLogicalAddress(void) const { return m_logicalAddresses.primary; }
virtual cec_logical_addresses GetLogicalAddresses(void) const { return m_logicalAddresses; }
virtual cec_logical_addresses GetActiveDevices(void);
+ virtual uint16_t GetDevicePhysicalAddress(cec_logical_address iAddress);
virtual bool HasLogicalAddress(cec_logical_address address) const { return m_logicalAddresses.IsSet(address); }
virtual bool IsActiveDevice(cec_logical_address address);
virtual bool IsActiveDeviceType(cec_device_type type);
return 0;
}
+uint16_t CLibCEC::GetDevicePhysicalAddress(cec_logical_address iAddress)
+{
+ if (m_cec && iAddress >= CECDEVICE_TV && iAddress < CECDEVICE_BROADCAST)
+ return m_cec->GetDevicePhysicalAddress(iAddress);
+ return 0;
+}
+
cec_power_status CLibCEC::GetDevicePowerStatus(cec_logical_address iAddress)
{
if (m_cec && iAddress >= CECDEVICE_TV && iAddress < CECDEVICE_BROADCAST)
virtual cec_version GetDeviceCecVersion(cec_logical_address iAddress);
virtual bool GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language);
virtual uint64_t GetDeviceVendorId(cec_logical_address iAddress);
+ virtual uint16_t GetDevicePhysicalAddress(cec_logical_address iAddress);
virtual cec_power_status GetDevicePowerStatus(cec_logical_address iAddress);
virtual bool PollDevice(cec_logical_address iAddress);
virtual cec_logical_addresses GetActiveDevices(void);
return 0;
}
+uint16_t cec_get_device_physical_address(cec_logical_address iLogicalAddress)
+{
+ if (cec_parser)
+ return cec_parser->GetDevicePhysicalAddress(iLogicalAddress);
+ return 0;
+}
+
cec_power_status cec_get_device_power_status(cec_logical_address iLogicalAddress)
{
if (cec_parser)
{
if (addresses[iPtr])
{
- uint64_t iVendorId = parser->GetDeviceVendorId((cec_logical_address)iPtr);
- cec_version iCecVersion = parser->GetDeviceCecVersion((cec_logical_address)iPtr);
- cec_power_status power = parser->GetDevicePowerStatus((cec_logical_address)iPtr);
- cec_osd_name osdName = parser->GetOSDName((cec_logical_address)iPtr);
+ uint16_t iPhysicalAddress = parser->GetDevicePhysicalAddress((cec_logical_address)iPtr);
+ uint64_t iVendorId = parser->GetDeviceVendorId((cec_logical_address)iPtr);
+ cec_version iCecVersion = parser->GetDeviceCecVersion((cec_logical_address)iPtr);
+ cec_power_status power = parser->GetDevicePowerStatus((cec_logical_address)iPtr);
+ cec_osd_name osdName = parser->GetOSDName((cec_logical_address)iPtr);
+ CStdString strAddr;
+ strAddr.Format("%04x", iPhysicalAddress);
cec_menu_language lang;
lang.device = CECDEVICE_UNKNOWN;
parser->GetDeviceMenuLanguage((cec_logical_address)iPtr, &lang);
cout << "device #" << (int)iPtr << ": " << parser->ToString((cec_logical_address)iPtr) << endl;
+ cout << "address: " << strAddr.c_str() << endl;
cout << "vendor: " << parser->ToString((cec_vendor_id)iVendorId) << endl;
cout << "osd string: " << osdName.name << endl;
cout << "CEC version: " << parser->ToString(iCecVersion) << endl;