- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have just started using the ultralight cJSON files from Dave Gamble's git ().
GitHub - DaveGamble/cJSON: Ultralightweight JSON parser in ANSI C
I have no issue serializing and parsing strings but there is some issue with the adding numbers to the object. Has anyone else had this issue and know what is happening?
In my code I create several string value pairs no issue like this
cJSON *payload_json = CJSON_CreateObject();
CJSON_AddNumberToObject(payload_json, "range",n);
I have tried numeric variable and fixed number. The object ends up with blank instead of number like { "range": }
If I use say CJSON_AddStringToObject(payload_json,"result","ok"); I get correct packet {"result":"ok"}
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi DaHu_285096,
I have not used the JSON parser that you are referring to. But I found these issues created in the repo that might help you -
Hope this helps,
Thanks and Regards,
Rakshith
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi DaHu_285096,
I have not used the JSON parser that you are referring to. But I found these issues created in the repo that might help you -
Hope this helps,
Thanks and Regards,
Rakshith
Rakshith M B