| | |
| | | fenli_alarm_count = 0; |
| | | _4GAlarmUpload(2); |
| | | } |
| | | } else { |
| | | } |
| | | } |
| | | if(distance>g_com_map[ALARM_DISTANCE1]||anchordata_num==0) |
| | | { |
| | | if(fenli_alarm_count++>20) |
| | | { |
| | | if(!flag_fenli_alarm) |
| | | { |
| | | flag_fenli_alarm = 1; |
| | | _4GAlarmUpload(1); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(distance<g_com_map[ALARM_DISTANCE1]) { //小于预警距离 |
| | | if(flag_alam_state) |
| | | { |
| | |
| | | gps_uwb_flag=1;//开启gps测距流程 |
| | | need_open_gps_count=0; |
| | | } |
| | | } |
| | | } else if(anchordata_num==0) { |
| | | |
| | | } |
| | | if(anchordata_num==0) { |
| | | if(!flag_alam_state) |
| | | { |
| | | flag_alam_state = 1; |
| | |
| | | need_open_gps_count=0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | void MinuteTask(void) |
| | | { |
| | | adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adc采样 |
| | |
| | | ip2 = (g_com_map[TCP_IP_2]>>12&0xf)*1000+(g_com_map[TCP_IP_2]>>8&0xf)*100+(g_com_map[TCP_IP_2]>>4&0xf)*10+(g_com_map[TCP_IP_2]&0xf); |
| | | ip3 = (g_com_map[TCP_IP_3]>>12&0xf)*1000+(g_com_map[TCP_IP_3]>>8&0xf)*100+(g_com_map[TCP_IP_3]>>4&0xf)*10+(g_com_map[TCP_IP_3]&0xf); |
| | | port = g_com_map[TCP_PORT]; |
| | | g_com_map[VERSION] = (1<<8)|8; |
| | | g_com_map[VERSION] = (1<<8)|9; |
| | | LOG_INFO(TRACE_MODULE_APP,"设备ID: %x .\r\n",dev_id); |
| | | LOG_INFO(TRACE_MODULE_APP,"固件版本:UWB-4G车载手环 V%d.%d. \r\n",g_com_map[VERSION]>>8,g_com_map[VERSION]&0xff); |
| | | LOG_INFO(TRACE_MODULE_APP,"服务器地址: %d.%d.%d.%d:%d.\r\n",ip0,ip1,ip2,ip3,port); |