cJSON *root; char *out_buf,*buf; uint32_t len = 0,len1 = 0; root=cJSON_CreateObject(); mult_build_sensor_data(root); printf("build root success!!!\n"); out_buf = cJSON_PrintUnformatted(root); if(out_buf == NULL)//out buf sometimes return NULL when add two array to "dat...
intParser_string(char*pCommData,char**outputStr,intrepCommandID){char* out =NULL;intoutLen =0; cJSON *pSUSICommDataItem =NULL;if(pCommData ==NULL|| outputStr ==NULL)returnoutLen; pSUSICommDataItem = cJSON_CreateObject();switch(repCommandID) {caseswm_set_mon_objs_rep: { cJSON_AddStri...
;cJSON_Delete(root);if(err<0) {sendUART("UDPs","Error occurred during sending",NULL);break; } } } } In this loop, I get the data and compare against the phrase searchPhrase. Next, I form a JSON packet and send it back.