From: Lars Op den Kamp Date: Mon, 8 Oct 2012 11:50:33 +0000 (+0200) Subject: cosmetics: format physical address as %x.%x.%x.%x instead of %04x X-Git-Tag: upstream/2.2.0~1^2~17^2^2~7 X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=commitdiff_plain;h=c4483d6f83059251d529c8be45510734877477be cosmetics: format physical address as %x.%x.%x.%x instead of %04x --- diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp index ed3f47e..0d75b6e 100644 --- a/src/lib/CECClient.cpp +++ b/src/lib/CECClient.cpp @@ -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()); diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index beafe8a..d170bfa 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -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);