From d7d8276924fc752e8c09ebc40d6d0fb1b79b230f Mon Sep 17 00:00:00 2001 From: Zilog80 Date: Sun, 24 Jan 2021 10:43:29 +0100 Subject: [PATCH] iMet-54 v0.2.1: basic json w/ day_sec counter --- demod/mod/imet54mod.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demod/mod/imet54mod.c b/demod/mod/imet54mod.c index 7298899..b6e596c 100644 --- a/demod/mod/imet54mod.c +++ b/demod/mod/imet54mod.c @@ -299,8 +299,10 @@ static int print_position(gpx_t *gpx, int ecc, int ecc_gps) { } if (gpx->option.jsn && ecc >= 0) { // ecc_gps >= 0 not reliable? + unsigned long count_day = (unsigned long)(gpx->std*3600 + gpx->min*60 + gpx->sek+0.5); // (gpx->timems/1e3+0.5) has gaps fprintf(stdout, "{ \"type\": \"%s\"", "IMET5"); - fprintf(stdout, ", \"id\": \"%u\", \"datetime\": \"%02d:%02d:%06.3fZ\", \"lat\": %.5f, \"lon\": %.5f, \"alt\": %.5f", + fprintf(stdout, ", \"frame\": %lu", count_day); + fprintf(stdout, ", \"id\": \"IMET54-%u\", \"datetime\": \"%02d:%02d:%06.3fZ\", \"lat\": %.5f, \"lon\": %.5f, \"alt\": %.5f", gpx->SNu32, gpx->std, gpx->min, gpx->sek, gpx->lat, gpx->lon, gpx->alt); //fprintf(stdout, ", \"subtype\": \"%s\"", "IMET54"); if (gpx->jsn_freq > 0) {