cosmetics: format physical address as %x.%x.%x.%x instead of %04x
authorLars Op den Kamp <lars@opdenkamp.eu>
Mon, 8 Oct 2012 11:50:33 +0000 (13:50 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Mon, 8 Oct 2012 11:50:47 +0000 (13:50 +0200)
src/lib/CECClient.cpp
src/testclient/main.cpp

index ed3f47eecc23e04976bd3ed560184f3ea8155908..0d75b6e046c235eab88e2d85de7be1b84aec56ef 100644 (file)
@@ -1092,8 +1092,8 @@ std::string CCECClient::GetConnectionInfo(void)
 
   if (!CLibCEC::IsValidPhysicalAddress(m_configuration.iPhysicalAddress))
     strLog.AppendFormat(", base device: %s (%X), HDMI port number: %d", ToString(m_configuration.baseDevice), m_configuration.baseDevice, m_configuration.iHDMIPort);
-  else
-    strLog.AppendFormat(", physical address: %04x", m_configuration.iPhysicalAddress);
+  uint16_t iPhysicalAddress = GetPrimaryDevice()->GetPhysicalAddress(GetLogicalAddresses().primary, false);
+  strLog.AppendFormat(", physical address: %x.%x.%x.%x", (iPhysicalAddress >> 12) & 0xF, (iPhysicalAddress >> 8) & 0xF, (iPhysicalAddress >> 4) & 0xF, iPhysicalAddress & 0xF);
 
   strLog.AppendFormat(", %s", LIB_CEC->GetLibInfo());
 
index beafe8a0bcb281f57e14d4639ed0c7baee8b1b76..d170bfa44a791be7606384ef6f2bc8cbfb7d5c8b 100644 (file)
@@ -857,7 +857,7 @@ bool ProcessCommandSCAN(ICECAdapter *parser, const string &command, string & UNU
         cec_power_status power    = parser->GetDevicePowerStatus((cec_logical_address)iPtr);
         cec_osd_name osdName      = parser->GetDeviceOSDName((cec_logical_address)iPtr);
         CStdString strAddr;
-        strAddr.Format("%04x", iPhysicalAddress);
+        strAddr.Format("%x.%x.%x.%x", (iPhysicalAddress >> 12) & 0xF, (iPhysicalAddress >> 8) & 0xF, (iPhysicalAddress >> 4) & 0xF, iPhysicalAddress & 0xF);
         cec_menu_language lang;
         lang.device = CECDEVICE_UNKNOWN;
         parser->GetDeviceMenuLanguage((cec_logical_address)iPtr, &lang);