1.未初始化局部变量
typedef struct
{
//now
char cmd_id[20];
char img_id[20];
unsigned char lb_mac[6];
enum TypeWorkMode work_mode;
char bin_url[100];
uint8_t screen_type_value;
uint32_t bin_length;
uint32_t bin_crc32;
uint8_t room_num;
uint32_t light_starttime;
uint32_t light_endtime;
uint8_t light_color;
uint8_t light_freq;
//old
uint32_t timeout;
// uint32_t time_send;
char count; //for timeout
char err_count;
uint8_t light_on;
uint32_t light_currenttime;
// unsigned char mac[10];
// unsigned char mode[10];
}send_mac_t;
//先解析出待分配任务
send_mac_t candidate_task;
memset(&candidate_task, 0, sizeof(send_mac_t));
//如果为初始化
cJSON *pSubData = cJSON_GetArrayItem(pData, i);
//3.0:cmd_id
memcpy(&candidate_task.cmd_id, cmd_id, strlen(cmd_id));
打印出的cmdid 就会有乱码.