3 Replies Latest reply on Jan 7, 2016 8:34 AM by Avirup171

    How to parse the data received from Azure Mobile Service?

    Avirup171

      I am accessing the data from azure mobile service using an Edison. The data is a json string. How can I parse the data to get the appropriate value? I have used the ArduinoJson library but I got multiple errors, when I compile it. Basically, how to use the ArduinoJson library in Edison?

       

      The error is shown below

       

       

      C:\Users\Avirup\Documents\Arduino\libraries\ArduinoJson\src\JsonVariant.cpp: In member function 'T ArduinoJson::JsonVariant::as() const [with T = String]':

      C:\Users\Avirup\Documents\Arduino\libraries\ArduinoJson\src\JsonVariant.cpp:67:46: error: call of overloaded 'String(const double&, uint8_t&)' is ambiguous

           return String(_content.asDouble, decimals);

                                                    ^

      C:\Users\Avirup\Documents\Arduino\libraries\ArduinoJson\src\JsonVariant.cpp:67:46: note: candidates are:

      In file included from C:\Users\Avirup\AppData\Roaming\Arduino15\packages\Intel\hardware\i686\1.6.2+1.0\cores\arduino/Print.h:26:0,

                       from C:\Users\Avirup\Documents\Arduino\libraries\ArduinoJson\src\../include/ArduinoJson/Internals/../Arduino/Print.hpp:29,

                       from C:\Users\Avirup\Documents\Arduino\libraries\ArduinoJson\src\../include/ArduinoJson/Internals/DummyPrint.hpp:9,

                       from C:\Users\Avirup\Documents\Arduino\libraries\ArduinoJson\src\../include/ArduinoJson/Internals/JsonPrintable.hpp:9,

                       from C:\Users\Avirup\Documents\Arduino\libraries\ArduinoJson\src\../include/ArduinoJson/JsonVariant.hpp:12,

                       from C:\Users\Avirup\Documents\Arduino\libraries\ArduinoJson\src\JsonVariant.cpp:7:

      C:\Users\Avirup\AppData\Roaming\Arduino15\packages\Intel\hardware\i686\1.6.2+1.0\cores\arduino/WString.h:73:11: note: String::String(long unsigned int, unsigned char)

        explicit String(unsigned long, unsigned char base=10);

                 ^

      C:\Users\Avirup\AppData\Roaming\Arduino15\packages\Intel\hardware\i686\1.6.2+1.0\cores\arduino/WString.h:72:11: note: String::String(long int, unsigned char)

        explicit String(long, unsigned char base=10);

                 ^

      C:\Users\Avirup\AppData\Roaming\Arduino15\packages\Intel\hardware\i686\1.6.2+1.0\cores\arduino/WString.h:71:11: note: String::String(unsigned int, unsigned char)

        explicit String(unsigned int, unsigned char base=10);

                 ^

      C:\Users\Avirup\AppData\Roaming\Arduino15\packages\Intel\hardware\i686\1.6.2+1.0\cores\arduino/WString.h:70:11: note: String::String(int, unsigned char)

        explicit String(int, unsigned char base=10);

                 ^

      C:\Users\Avirup\AppData\Roaming\Arduino15\packages\Intel\hardware\i686\1.6.2+1.0\cores\arduino/WString.h:69:11: note: String::String(unsigned char, unsigned char)

        explicit String(unsigned char, unsigned char base=10);

                 ^

      Error compiling.