Simplified IPC code to use less different IPC messages. Share more code. More qork on MQTT code.
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <gwenhywfar/endpoint_tcpc.h>
|
||||
#include <gwenhywfar/debug.h>
|
||||
#include <gwenhywfar/timestamp.h>
|
||||
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
@@ -257,7 +258,21 @@ void Utils_PrintDataPoints(const uint64_t *dataPoints, uint32_t numValues, const
|
||||
|
||||
void Utils_PrintSingleDataPoint(uint64_t timestamp, double data, const char *valueUnits)
|
||||
{
|
||||
fprintf(stdout, "%lu\t%lf\t%s\n", (unsigned long int) timestamp, data, valueUnits?valueUnits:"");
|
||||
GWEN_TIMESTAMP *ts;
|
||||
|
||||
ts=GWEN_Timestamp_fromLocalTime((time_t) timestamp);
|
||||
if (ts)
|
||||
fprintf(stdout, "%04d/%02d/%02d-%02d:%02d:%02d\t%lf\t%s\n",
|
||||
GWEN_Timestamp_GetYear(ts),
|
||||
GWEN_Timestamp_GetMonth(ts),
|
||||
GWEN_Timestamp_GetDay(ts),
|
||||
GWEN_Timestamp_GetHour(ts),
|
||||
GWEN_Timestamp_GetMinute(ts),
|
||||
GWEN_Timestamp_GetSecond(ts),
|
||||
data, valueUnits?valueUnits:"");
|
||||
else
|
||||
fprintf(stdout, "\t%lf\t%s\n",
|
||||
data, valueUnits?valueUnits:"");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user