1 Reply Latest reply on Jan 4, 2017 4:18 AM by rash

    How to add a JSON object ?

    GasparLin

      Hi

      I only see JSON parser API in SDK (ver 4.0.1) without add JSON object related APIs.

      Is there any APIs can help to add(create) a JSON object?  I think if yes that will be easier to programming

       

      Thanks,

        • 1. Re: How to add a JSON object ?
          rash

          Hello GasparLin,

          There is no direct API to create JSON_OBJECT. You can use the following structure for preparing the object

          static wiced_json_object_t json_object =

          {

              .object_string        = NULL,

              .object_string_length = 0,

              .value_type           = UNKNOWN_JSON_TYPE,

              .value                = NULL,

              .value_length         = 0,

              .parent_object        = NULL

          };

           

          Please refer to JSON.C file in the SDK.

           

          Best Regards,

          Ramesh Mylavarapu

          1 of 1 people found this helpful