|
|
@@ -4648,11 +4648,13 @@ char* communication_4G_ack_to_json(CellInfo_t* _CellularManagerTemp,int nWSType)
|
|
|
//创建数据
|
|
|
memset(temp, 0, sizeof(temp));
|
|
|
|
|
|
- cJSON* sdata_filed = cJSON_CreateObject();
|
|
|
+ cJSON* sdata_filed = NULL;
|
|
|
+
|
|
|
// 创建数据
|
|
|
cJSON *data_root_array = cJSON_CreateObject();
|
|
|
if (nWSType)
|
|
|
{
|
|
|
+ sdata_filed = cJSON_CreateObject();
|
|
|
cJSON_AddNumberToObject(sdata_filed, "code", 200);
|
|
|
}
|
|
|
else
|
|
|
@@ -4689,30 +4691,32 @@ char* communication_4G_ack_to_json(CellInfo_t* _CellularManagerTemp,int nWSType)
|
|
|
sprintf(temp, "%d dBm", _CellularManagerTemp->Signal_strength);
|
|
|
cJSON_AddStringToObject(data_root_array, "xhqd", temp);
|
|
|
|
|
|
- int idx=0;
|
|
|
- cJSON* array=NULL;
|
|
|
- for(int i=0; i<MAIL_RECV_MAX; i++) {
|
|
|
- if(1) {
|
|
|
- cJSON* tmp = cJSON_CreateObject();
|
|
|
- if(strlen(_CellularManagerTemp->sms_recv[i].account)>0) {
|
|
|
- cJSON_AddStringToObject(tmp,"receiveAccount",_CellularManagerTemp->sms_recv[i].account);
|
|
|
- cJSON_AddNumberToObject(tmp,"idx", idx++);
|
|
|
+ int idx = 0;
|
|
|
+ cJSON *array = NULL;
|
|
|
+ for (int i = 0; i < MAIL_RECV_MAX; i++)
|
|
|
+ {
|
|
|
+ if (strlen(_CellularManagerTemp->sms_recv[i].account) > 0)
|
|
|
+ {
|
|
|
+ cJSON *tmp = cJSON_CreateObject();
|
|
|
+ cJSON_AddStringToObject(tmp, "receiveAccount", _CellularManagerTemp->sms_recv[i].account);
|
|
|
+ cJSON_AddNumberToObject(tmp, "idx", idx++);
|
|
|
|
|
|
- if(array==NULL) {
|
|
|
- array = cJSON_CreateArray();
|
|
|
- }
|
|
|
+ if (array == NULL)
|
|
|
+ {
|
|
|
+ array = cJSON_CreateArray();
|
|
|
+ }
|
|
|
|
|
|
- if(array) {
|
|
|
- cJSON_AddItemToArray(array, tmp);
|
|
|
- }
|
|
|
+ if (array)
|
|
|
+ {
|
|
|
+ cJSON_AddItemToArray(array, tmp);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(array) {
|
|
|
+ if (array)
|
|
|
+ {
|
|
|
cJSON_AddItemToObject(data_root_array, "receiveAccountList", array);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if (nWSType)
|
|
|
{
|
|
|
// 添加汇总
|
|
|
@@ -4752,11 +4756,12 @@ char* communication_WIFI_ack_to_json(WIFIInfo_t* _WIFIManagertemp,int nWSType)
|
|
|
//创建数据
|
|
|
memset(temp, 0, sizeof(temp));
|
|
|
|
|
|
- cJSON *sdata_filed = cJSON_CreateObject();
|
|
|
+ cJSON *sdata_filed = NULL;
|
|
|
// 创建数据
|
|
|
cJSON *data_root_array = cJSON_CreateObject();
|
|
|
if (nWSType)
|
|
|
{
|
|
|
+ sdata_filed = cJSON_CreateObject();
|
|
|
cJSON_AddNumberToObject(sdata_filed, "code", 200);
|
|
|
}
|
|
|
else
|