- PrintToStdOut("device: %d\npath: %s\ncom port: %s\n", iDevicePtr + 1, devices[iDevicePtr].path, 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);
+
+ if (config.iFirmwareBuildDate != CEC_FW_BUILD_UNKNOWN)
+ {
+ time_t buildTime = (time_t)config.iFirmwareBuildDate;
+ strDeviceInfo.AppendFormat("firmware build date: %s", asctime(gmtime(&buildTime)));
+ strDeviceInfo = strDeviceInfo.Left(strDeviceInfo.length() > 1 ? (unsigned)(strDeviceInfo.length() - 1) : 0); // strip \n added by asctime
+ strDeviceInfo.append(" +0000");
+ }
+ }
+ strDeviceInfo.append("\n");
+ }
+ PrintToStdOut(strDeviceInfo.c_str());