MCPcopy Create free account
hub / github.com/Pulse-Eight/libcec / GetConnectionInfo

Method GetConnectionInfo

src/libcec/CECClient.cpp:1258–1292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1256}
1257
1258std::string CCECClient::GetConnectionInfo(void)
1259{
1260 std::string strLog;
1261 strLog = StringUtils::Format("libCEC version = %s, client version = %s, firmware version = %d",
1262 CCECTypeUtils::VersionToString(m_configuration.serverVersion).c_str(),
1263 CCECTypeUtils::VersionToString(m_configuration.clientVersion).c_str(),
1264 m_configuration.iFirmwareVersion);
1265 if (m_configuration.iFirmwareBuildDate != CEC_FW_BUILD_UNKNOWN)
1266 {
1267 time_t buildTime = (time_t)m_configuration.iFirmwareBuildDate;
1268 strLog += StringUtils::Format(", firmware build date: %s", asctime(gmtime(&buildTime)));
1269 strLog = strLog.substr(0, strLog.length() > 0 ? (size_t)(strLog.length() - 1) : 0); // strip \n added by asctime
1270 strLog.append(" +0000");
1271 }
1272
1273 // log the addresses that are being used
1274 if (!m_configuration.logicalAddresses.IsEmpty())
1275 {
1276 strLog.append(", logical address(es) = ");
1277 CECDEVICEVEC devices;
1278 m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
1279 for (CECDEVICEVEC::iterator it = devices.begin(); it != devices.end(); it++)
1280 strLog += StringUtils::Format("%s (%X) ", (*it)->GetLogicalAddressName(), (*it)->GetLogicalAddress());
1281 }
1282
1283 if (!CLibCEC::IsValidPhysicalAddress(m_configuration.iPhysicalAddress))
1284 strLog += StringUtils::Format(", base device: %s (%X), HDMI port number: %d", ToString(m_configuration.baseDevice), m_configuration.baseDevice, m_configuration.iHDMIPort);
1285 uint16_t iPhysicalAddress = GetPrimaryDevice()->GetPhysicalAddress(GetLogicalAddresses().primary, false);
1286 strLog += StringUtils::Format(", physical address: %x.%x.%x.%x", (iPhysicalAddress >> 12) & 0xF, (iPhysicalAddress >> 8) & 0xF, (iPhysicalAddress >> 4) & 0xF, iPhysicalAddress & 0xF);
1287
1288 strLog += StringUtils::Format(", %s", LIB_CEC->GetLibInfo());
1289
1290 std::string strReturn(strLog.c_str());
1291 return strReturn;
1292}
1293
1294void CCECClient::SetTVVendorOverride(const cec_vendor_id id)
1295{

Callers 2

RegisterClientMethod · 0.80
UnregisterClientMethod · 0.80

Calls 8

ToStringFunction · 0.85
GetByLogicalAddressesMethod · 0.80
GetDevicesMethod · 0.80
GetLogicalAddressNameMethod · 0.80
GetLibInfoMethod · 0.80
IsEmptyMethod · 0.45
GetLogicalAddressMethod · 0.45
GetPhysicalAddressMethod · 0.45

Tested by

no test coverage detected