| | |
| | | extern void delay_ms(uint32_t nTimer) ; |
| | | extern uint8_t lora_sendfinal_rx_bag_flag; |
| | | uint8_t flag_lorainit=1; |
| | | uint8_t fengming_time,fengming_flag; |
| | | extern uint32_t lora_sendfinal_rx_time; |
| | | void Lora_Poll(void) |
| | | { |
| | | HIDO_UINT8 u8Byte = 0; |
| | |
| | | if(lora_recv_devid==dev_id) |
| | | { |
| | | if(lora_rxbuf[6]==0x01&&lora_rxbuf[7]==0x01&&lora_rxbuf[8]==0x00)//接收GPS回复的OK |
| | | { |
| | | { |
| | | lora_sendfinal_rx_time=0; |
| | | lora_sendfinalbag_flag=0; |
| | | lora_sendfinal_rx_bag_flag=0; |
| | | HIDO_Debug("收到GPS的OK\r\n"); |
| | |
| | | if(lora_rxbuf[6]==0x02)//接收下发修改GPS开关时间参数 |
| | | { |
| | | memcpy(&lora_recv_gpstime,&lora_rxbuf[7],2); |
| | | if(lora_recv_gpstime<=1800) |
| | | lora_recv_gpstime=1800; |
| | | if(lora_recv_gpstime<=60) |
| | | lora_recv_gpstime=60; |
| | | g_com_map[GPS_ONTIME]=lora_recv_gpstime; |
| | | save_com_map_to_flash(); |
| | | HIDO_Debug("收到修改GPS开关时间:%d\r\n",lora_recv_gpstime); |
| | |
| | | delay_ms(100); |
| | | NVIC_SystemReset(); |
| | | } |
| | | if(lora_rxbuf[6]==0x04)//接收下发蜂鸣 |
| | | { |
| | | memcpy(&lora_recv_gpstime,&lora_rxbuf[7],2); |
| | | if(lora_recv_gpstime<=10) |
| | | {lora_recv_gpstime=10;} |
| | | if(lora_recv_gpstime>100) |
| | | {lora_recv_gpstime=100;} |
| | | fengming_time=lora_recv_gpstime; |
| | | fengming_flag=1 ; |
| | | lora_sendfinalbag_flag=0; |
| | | lora_sendfinal_rx_bag_flag=0; |
| | | lora_sendfinal_rx_time=0; |
| | | memset(&lora_rxbuf,0,sizeof(lora_rxbuf)); |
| | | lora_rxbufnum=0; |
| | | } |
| | | } |
| | | |
| | | } |