m_configuration.iFirmwareBuildDate = m_communication->GetFirmwareBuildDate();
CStdString strLog;
strLog.Format("connected to the CEC adapter. libCEC version = %s, client version = %s, firmware version = %d", ToString((cec_server_version)m_configuration.serverVersion), ToString((cec_client_version)m_configuration.clientVersion), m_configuration.iFirmwareVersion);
- if (m_configuration.iFirmwareBuildDate > 0)
+ if (m_configuration.iFirmwareBuildDate != CEC_DEFAULT_FIRMWARE_BUILD_DATE)
{
time_t buildTime = (time_t)m_configuration.iFirmwareBuildDate;
strLog.AppendFormat(", firmware build date: %s", asctime(gmtime(&buildTime)));
if (!OpenConnection(strPort, CEC_SERIAL_DEFAULT_BAUDRATE, iTimeoutMs, false))
return false;
- config->iFirmwareVersion = m_communication->GetFirmwareVersion();
- config->iPhysicalAddress = m_communication->GetPhysicalAddress();
+ config->iFirmwareVersion = m_communication->GetFirmwareVersion();
+ config->iPhysicalAddress = m_communication->GetPhysicalAddress();
+ config->iFirmwareBuildDate = m_communication->GetFirmwareBuildDate();
- delete m_communication;
- m_communication = NULL;
return true;
}
for (int8_t iDevicePtr = 0; iDevicePtr < iDevicesFound; iDevicePtr++)
{
- strDeviceInfo.AppendFormat("device: %d\ncom port: %s\n", iDevicePtr + 1, devices[iDevicePtr].comm);
+ strDeviceInfo.AppendFormat("device: %d\ncom port: %s\n", iDevicePtr + 1, devices[iDevicePtr].comm);
libcec_configuration config;
config.Clear();
if (!parser->GetDeviceInformation(devices[iDevicePtr].comm, &config))
PrintToStdOut("WARNING: unable to open the device on port %s", devices[iDevicePtr].comm);
else
- strDeviceInfo.AppendFormat("firmware version: %d\n", config.iFirmwareVersion);
+ {
+ strDeviceInfo.AppendFormat("firmware version: %d\n", config.iFirmwareVersion);
+
+ if (config.iFirmwareBuildDate != CEC_DEFAULT_FIRMWARE_BUILD_DATE)
+ {
+ time_t buildTime = (time_t)config.iFirmwareBuildDate;
+ strDeviceInfo.AppendFormat("firmware build date: %s", asctime(gmtime(&buildTime)));
+ strDeviceInfo = strDeviceInfo.Left((int)strDeviceInfo.length() - 1); // strip \n added by asctime
+ strDeviceInfo.append(" +0000");
+ }
+ }
strDeviceInfo.append("\n");
}
PrintToStdOut(strDeviceInfo.c_str());