- if (debug_raw_data)
- printf("== %s id=%d val=%.3f unit=%s q=%d\n", tbuf, id, val, unit, q);
+static void cooked_point(time_t t, int id, double val, char *unit, int q)
+{
+ char namebuf[16];
+ snprintf(namebuf, sizeof(namebuf), "%d", id);
+ const char *name = namebuf;
+
+ double val2 = correct_point(id, val, &name);
+
+ if (debug_raw_data) {
+ struct tm tm;
+ localtime_r(&t, &tm);
+ char tbuf[64];
+ strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", &tm);
+ printf("== %s id=%d name=%s val=%.3f val2=%.3f unit=%s q=%d\n", tbuf, id, name, val, val2, unit, q);
+ }