Tool/software: Code Composer Studio
hi :
i am searching a tools to encode the data to json format ? jsmn is a good tool to parse the json .
but that is not enough .i want to encode data to json format .
char line[130] = {0};
char now[20] = {0};
cJSON *data=NULL;
root = cJSON_CreateObject();
cJSON_AddNumberToObject(root, "error", 200);
// cJSON_AddStringToObject(root, "error", "200");
cJSON_AddItemToObject(root,"data",data = cJSON_CreateObject());
get_zone_time_now(now); cJSON_AddStringToObject(data,"now", now);
get_zone_time_inline(line); cJSON_AddStringToObject(data,"inline", line);
cJSON_AddStringToObject(root,"from","device"); sent_zone_time_flag = SentZoneTimeOK;
msg.event = MQTT_SEND_APP_MESSAGE;
goto cmd_exit;
it is ok when you encode a string type to json format .but if you want to encode a number type to json ,that will be awalys zero .it is OK when you use ATMEL1284P ,
but in the CC3200 ,the error will show .
is there any orther tool like this to encode json data ,some suggestion will be helpful.
thanks.