Set timestampCreation on created devices, show that in aqhome-tool.
This commit is contained in:
@@ -298,5 +298,31 @@ void Utils_PrintMeanData(const uint64_t *dataPoints, uint32_t numValues, const c
|
||||
|
||||
|
||||
|
||||
void Utils_PrintDevice(const AQH_DEVICE *device)
|
||||
{
|
||||
GWEN_TIMESTAMP *ts;
|
||||
uint64_t deviceId;
|
||||
const char *deviceName;
|
||||
uint64_t timestamp;
|
||||
|
||||
deviceId=AQH_Device_GetId(device);
|
||||
deviceName=AQH_Device_GetNameForSystem(device);
|
||||
timestamp=AQH_Device_GetTimestampCreation(device);
|
||||
ts=timestamp?GWEN_Timestamp_fromLocalTime((time_t) timestamp):NULL;
|
||||
if (ts)
|
||||
fprintf(stdout, "%lu\t%s\t%04d/%02d/%02d-%02d:%02d:%02d\n",
|
||||
deviceId,
|
||||
deviceName,
|
||||
GWEN_Timestamp_GetYear(ts),
|
||||
GWEN_Timestamp_GetMonth(ts),
|
||||
GWEN_Timestamp_GetDay(ts),
|
||||
GWEN_Timestamp_GetHour(ts),
|
||||
GWEN_Timestamp_GetMinute(ts),
|
||||
GWEN_Timestamp_GetSecond(ts));
|
||||
else
|
||||
fprintf(stdout, "%lu\t%s\t\n",
|
||||
deviceId,
|
||||
deviceName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user