aJson is the attempt to port a complete JSON implementation to Arduino. It is based on the cJSON implementation, reduced in size and removing one or two feature. The current mbed implementation only supports FILE* as input so you will have to use a temporary file for parsing your json input. https://github.com/interactive-matter/aJson

Dependents:   WIZwikiREST20

Files at this revision

API Documentation at this revision

Comitter:
mimil
Date:
Fri Sep 07 09:30:33 2012 +0000
Parent:
1:6df1d1f1b372
Commit message:
update to last git version

Changed in this revision

aJSON.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/aJSON.cpp	Tue Aug 28 08:16:29 2012 +0000
+++ b/aJSON.cpp	Fri Sep 07 09:30:33 2012 +0000
@@ -40,9 +40,7 @@
 #include "aJSON.h"
 #include "utility/streamhelper.h"
 #include "utility/stringbuffer.h"
-
 #include "compatibility.h"
-#include "stdio.h"
 
 /******************************************************************************
  * Definitions
@@ -53,11 +51,6 @@
 //how much digits after . for float
 #define FLOAT_PRECISION 5
 
-
-
-
-
-
 // Internal constructor.
 aJsonObject*
 aJsonClass::newItem()
@@ -124,7 +117,7 @@
         in = fgetc(stream);
       }
     while (in >= '0' && in <= '9'); // Number?
-  //end of integer part &#65533; or isn't it?
+  //end of integer part Ð or isn't it?
   if (!(in == '.' || in == 'e' || in == 'E'))
     {
       item->valueint = i * (int) sign;
@@ -772,6 +765,7 @@
         {
           return EOF;
         }
+      skip(stream);
       in = fgetc(stream);
     }
 
@@ -1198,4 +1192,4 @@
 
 //TODO conversion routines btw. float & int types?
 
-aJsonClass aJson;
+aJsonClass aJson;
\ No newline at end of file