1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

update to edgeflex format

This commit is contained in:
Manuel Pitz 2021-10-04 22:13:15 +02:00
parent 36baf113c6
commit 5119aba2b4

View file

@ -53,14 +53,12 @@ int JsonEdgeflexFormat::packSample(json_t **json_smp, const struct sample *smp)
json_array_append_new(json_data, json_value);
}
if (smp->flags & (int) SampleFlags::HAS_TS_ORIGIN) {
json_created = json_integer(time_to_double(&smp->ts.origin) * 1e3);
json_object_set_new(json_value, "created", json_created);
}
json_root = json_pack_ex(&err, 0, "{ s: o }",
"measurement", json_data
json_created = json_integer(time_to_double(&smp->ts.origin) * 1e3);
json_root = json_pack_ex(&err, 0, "{ s: o, s : o }",
"measurement", json_data,
"created", json_created
);
if (json_root == nullptr)
return -1;