From: FrancoisGrondin Date: Wed, 16 Aug 2017 15:52:00 +0000 (-0400) Subject: Fixed JSON syntax X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=8f979250f0082006e034f4ef33bfe784abe2d856;p=yn%2Fyn-odas.git Fixed JSON syntax --- diff --git a/src/sink/snk_pots.c b/src/sink/snk_pots.c index 150d0a3..4de8189 100644 --- a/src/sink/snk_pots.c +++ b/src/sink/snk_pots.c @@ -17,7 +17,7 @@ switch (obj->format->type) { - case format_float: break; + case format_json: break; default: printf("Invalid format.\n"); @@ -192,7 +192,7 @@ switch(obj->format->type) { - case format_float: + case format_json: obj->smessage[0] = 0x00; @@ -202,7 +202,7 @@ for (iPot = 0; iPot < obj->nPots; iPot++) { - sprintf(obj->smessage,"%s { x = %+1.3f, y = %+1.3f, z = %+1.3f, E = %+1.3f }", obj->smessage, + sprintf(obj->smessage,"%s { \"x\": %1.3f, \"y\": %1.3f, \"z\": %1.3f, \"E\": %1.3f }", obj->smessage, obj->in->pots->array[iPot*4+0], obj->in->pots->array[iPot*4+1], obj->in->pots->array[iPot*4+2], obj->in->pots->array[iPot*4+3]); if (iPot != (obj->nPots - 1)) {