|
|
@@ -322,7 +322,7 @@ int dtu_data_play(void)
|
|
|
dtu_thread_entry_send,RT_NULL,
|
|
|
DTU_THREAD_STACK_SIZE,
|
|
|
3, //优先级高是为了保证数据上传的频率的精确度
|
|
|
- DTU_THREAD_TIMESLICE
|
|
|
+ 20 //时间片
|
|
|
);
|
|
|
/* 创建线程-指令接收解析*/
|
|
|
dtu_recv_data = rt_thread_create("DTU_Uart_thread_recv",
|
|
|
@@ -468,7 +468,7 @@ char * makeJson()
|
|
|
if(device_status.gps==NULL)
|
|
|
rt_sprintf(device_status.gps, "0");
|
|
|
//如果设备工作并且电流小于500,并且不是上电启动灯管异常
|
|
|
- if(atoi(device_status.power)<400&&device_status.work_status==1&&makejson_sta!=0)
|
|
|
+ if(atoi(device_status.power)<400&&atoi(device_status.power)!=0&&device_status.work_status==1&&makejson_sta!=0)
|
|
|
{
|
|
|
#if LAMP_EN == 0
|
|
|
LOG_I("Current is:%d",atoi(device_status.power));
|
|
|
@@ -1053,6 +1053,8 @@ int parseDtu(char *json_string)
|
|
|
mqttcfg1 = cJSON_GetObjectItem(item_ext,"mqttcfg1");
|
|
|
mqttcfg2 = cJSON_GetObjectItem(item_ext,"mqttcfg2");
|
|
|
link_sta = cJSON_GetObjectItem(item_ext,"link_sta");
|
|
|
+ cJSON *gps_inuse = cJSON_GetObjectItem(item_ext,"gps_inuse");
|
|
|
+ cJSON *gps_view = cJSON_GetObjectItem(item_ext,"gps_view");
|
|
|
//如果DTU的IMEI和FLash中的不一样,保存到FLASH
|
|
|
value_commn = cJSON_GetObjectItem(item_ext,"photo_sta");
|
|
|
if(value_commn!=RT_NULL)
|
|
|
@@ -1165,6 +1167,17 @@ int parseDtu(char *json_string)
|
|
|
rt_sprintf(device_status.gps,"%s",gps->valuestring);
|
|
|
if(atoi(gps->valuestring)!=0)
|
|
|
{
|
|
|
+ #if BOOTERR == 1
|
|
|
+ if(atoi(gps->valuestring)==1)
|
|
|
+ rt_sprintf(device_status.gps_state, "%s","GPS+BD");
|
|
|
+
|
|
|
+ if(gps_inuse!=NULL){
|
|
|
+ device_status.gps_inuse = atoi(gps_inuse->valuestring);
|
|
|
+ }
|
|
|
+ if(gps_view!=NULL){
|
|
|
+ device_status.gps_view = atoi(gps_view->valuestring);
|
|
|
+ }
|
|
|
+ #endif
|
|
|
if(strstr(device_status.lat,lat->valuestring)==NULL)
|
|
|
{
|
|
|
memset(device_status.lat,0,sizeof(device_status.lat));
|
|
|
@@ -1192,8 +1205,8 @@ int parseDtu(char *json_string)
|
|
|
memset(device_status.lng,0,sizeof(device_status.lng));
|
|
|
if(sizeof(device_status.lat)<3)
|
|
|
{
|
|
|
- sprintf(device_status.lat,"%s","34.8088073");
|
|
|
- sprintf(device_status.lng,"%s","113.6624298");
|
|
|
+ sprintf(device_status.lat,"%s","0");
|
|
|
+ sprintf(device_status.lng,"%s","0");
|
|
|
}
|
|
|
else {
|
|
|
sprintf(device_status.lat,"%s",lat->valuestring);
|