X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fadapter%2FUSBCECAdapterCommands.cpp;h=5989bc9f49667db231ad704be123114b9b3272e3;hb=c04eaabcca1ce4b633427f6a146e0728c29a4343;hp=8f4d4c3d1f2d20d554025491023b3564c5786b55;hpb=a615784075997a8a0926e6f35491dfa999b7a9c6;p=deb_libcec.git diff --git a/src/lib/adapter/USBCECAdapterCommands.cpp b/src/lib/adapter/USBCECAdapterCommands.cpp index 8f4d4c3..5989bc9 100644 --- a/src/lib/adapter/USBCECAdapterCommands.cpp +++ b/src/lib/adapter/USBCECAdapterCommands.cpp @@ -43,7 +43,8 @@ CUSBCECAdapterCommands::CUSBCECAdapterCommands(CUSBCECAdapterCommunication *comm m_bSettingAutoEnabled(false), m_settingCecVersion(CEC_VERSION_UNKNOWN), m_iSettingLAMask(0), - m_bNeedsWrite(false) + m_bNeedsWrite(false), + m_iBuildDate(0) { m_persistedConfiguration.Clear(); } @@ -100,6 +101,7 @@ bool CUSBCECAdapterCommands::RequestSettingAutoEnabled(void) if (response.size == 1) { m_bSettingAutoEnabled = response[0] == 1; + CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted autonomous mode setting: '%s'", m_bSettingAutoEnabled ? "enabled" : "disabled"); return true; } return false; @@ -113,11 +115,25 @@ bool CUSBCECAdapterCommands::RequestSettingCECVersion(void) if (response.size == 1) { m_settingCecVersion = (cec_version)response[0]; + CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted CEC version setting: '%s'", CLibCEC::GetInstance()->ToString(m_settingCecVersion)); return true; } return false; } +uint32_t CUSBCECAdapterCommands::RequestBuildDate(void) +{ + if (m_iBuildDate == 0) + { + CLibCEC::AddLog(CEC_LOG_DEBUG, "requesting firmware build date"); + + cec_datapacket response = RequestSetting(MSGCODE_GET_BUILDDATE); + if (response.size == 4) + m_iBuildDate = (uint32_t)response[0] << 24 | (uint32_t)response[1] << 16 | (uint32_t)response[2] << 8 | (uint32_t)response[3]; + } + return m_iBuildDate; +} + bool CUSBCECAdapterCommands::RequestSettingDefaultLogicalAddress(void) { CLibCEC::AddLog(CEC_LOG_DEBUG, "requesting default logical address setting"); @@ -126,6 +142,7 @@ bool CUSBCECAdapterCommands::RequestSettingDefaultLogicalAddress(void) if (response.size == 1) { m_persistedConfiguration.logicalAddresses.primary = (cec_logical_address)response[0]; + CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted logical address setting: '%s'", CLibCEC::GetInstance()->ToString(m_persistedConfiguration.logicalAddresses.primary)); return true; } return false; @@ -140,7 +157,7 @@ bool CUSBCECAdapterCommands::RequestSettingDeviceType(void) if (response.size == 1) { m_persistedConfiguration.deviceTypes.Add((cec_device_type)response[0]); - CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted device type setting %s", CLibCEC::GetInstance()->ToString((cec_device_type)response[0])); + CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted device type setting: '%s'", CLibCEC::GetInstance()->ToString((cec_device_type)response[0])); return true; } CLibCEC::AddLog(CEC_LOG_DEBUG, "no persisted device type setting"); @@ -155,6 +172,7 @@ bool CUSBCECAdapterCommands::RequestSettingLogicalAddressMask(void) if (response.size == 2) { m_iSettingLAMask = ((uint16_t)response[0] << 8) | ((uint16_t)response[1]); + CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted logical address mask setting: '%x'", m_iSettingLAMask); return true; } return false; @@ -178,7 +196,7 @@ bool CUSBCECAdapterCommands::RequestSettingOSDName(void) buf[response.size] = 0; snprintf(m_persistedConfiguration.strDeviceName, 13, "%s", buf); - CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted device name setting %s", buf); + CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted device name setting: '%s'", buf); return true; } @@ -190,7 +208,7 @@ bool CUSBCECAdapterCommands::RequestSettingPhysicalAddress(void) if (response.size == 2) { m_persistedConfiguration.iPhysicalAddress = ((uint16_t)response[0] << 8) | ((uint16_t)response[1]); - CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted physical address setting %4x", m_persistedConfiguration.iPhysicalAddress); + CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted physical address setting: '%4x'", m_persistedConfiguration.iPhysicalAddress); return true; } CLibCEC::AddLog(CEC_LOG_DEBUG, "no persisted physical address setting");