Fixed JSON syntax
authorFrancoisGrondin <francois.grondin2@usherbrooke.ca>
Wed, 16 Aug 2017 15:52:00 +0000 (11:52 -0400)
committerFrancoisGrondin <francois.grondin2@usherbrooke.ca>
Wed, 16 Aug 2017 15:52:00 +0000 (11:52 -0400)
src/sink/snk_pots.c

index 150d0a3410dacc4f4319bad06398916f029ba5c9..4de81896137c1f45c9621d105532c19224b13daf 100644 (file)
@@ -17,7 +17,7 @@
 
         switch (obj->format->type) {
             
-            case format_float: break;
+            case format_json: break;
             default:
 
                 printf("Invalid format.\n");
 
             switch(obj->format->type) {
 
-                case format_float:
+                case format_json:
 
                     obj->smessage[0] = 0x00;
 
 
                     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)) {