2021-07-14 06:27 AM
*My controller is :STM32F042G6
2021-07-14 07:00 AM
Hi,
JSON is more complex to parse than to construct. For constructing a fixed json string (which is what you need), snprintf() should work fine IMO.
If you need parsing, it's probably best to copy implementations like cJSON https://github.com/DaveGamble/cJSON.
Sebastiaan
2021-07-14 09:06 AM
Than you for your quick reply once i will check & update it.
2021-07-14 11:48 PM
Hi,
*My requirement is not parsing (incoming data) ,
*I want to use Json On Outgoing Data (From Controller)
2021-07-14 11:56 PM
int main()
{
char json[20] = {0};
char temp[] = "world";
snprintf(json, sizeof(json), "{\"hello\": \"%s\"}", temp);
printf("%s", json);
}
=> result is {"hello": "world"}
2021-07-15 12:14 AM
Understood thank you for your quick reply.