| | |
| | | extern uint16_t tag_frequency; |
| | | extern uint16_t disoffset; |
| | | static uint8_t frame_len,recpoll_len,current_syncid,new_tagid,seize_anchor,result,g_start_sync_flag; |
| | | extern uint8_t gps_power_state,motor_power_state,uwb_state,air780_power_state,gps_success_state,chaging_state,changed_state,air780_success_state; |
| | | extern uint8_t gps_power_state,motor_power_state,uwb_state,air780_power_state,gps_success_state,red_charge_state,green_charge_state,air780_success_state; |
| | | int poll_rx_num,resp_tx_num; |
| | | //resp函数 |
| | | void PushAnchorDataArray(uint16_t ancid,int16_t dist,uint8_t battary);//找到自己的id信息对应位置更新自己的交互信息 |
| | |
| | | uint16_t random_time; |
| | | //anchor |
| | | int32_t hist_dist; |
| | | int16_t temp_recdist_before_offset; |
| | | void PushAnchorDataArray(uint16_t ancid,int16_t dist,uint8_t battary) |
| | | { |
| | | uint8_t i; |
| | |
| | | anchordata_bat[i] = battary; |
| | | tagofflinetime[i]=0;//不断更新当前TAG对应离线时间 |
| | | // if(dist>0) |
| | | if(distance!=0x1ffff&&distance!=0) |
| | | if(temp_recdist_before_offset!=0x1ffff&&temp_recdist_before_offset!=0&&temp_recdist_before_offset!=0x7fff&&distance!=0x1ffff) |
| | | { |
| | | distance=dist*0.5+distance*0.5; |
| | | }else{ |
| | |
| | | for(i=0; i<rec_nearbase_num; i++) |
| | | { |
| | | if(rec_ancidlist[i] == dev_id) |
| | | { |
| | | { temp_recdist_before_offset=rec_ancdistlist[i]; |
| | | rec_ancdistlist[i]+=(int16_t)g_com_map[DIST_OFFSET]; |
| | | PushAnchorDataArray(tag_id_recv,rec_ancdistlist[i],battary); |
| | | } |
| | |
| | | LOG_INFO(TRACE_MODULE_APP,"标签ID:%X,距离: %d 信号强度:%d.\r\n",g_com_map[BIND_DEV_ID],distance,rssi); |
| | | break; |
| | | } |
| | | } else { |
| | | } |
| | | // else { |
| | | flag_temp2=uwb_rx(0, 0, range_timeout_us); |
| | | } |
| | | // } |
| | | } |
| | | delay_us(1); |
| | | uwb_rx_force_off(1); |
| | |
| | | { |
| | | if(rec_ancidlist[i] == dev_id) |
| | | { |
| | | temp_recdist_before_offset=rec_ancdistlist[i]; |
| | | rec_ancdistlist[i]+=(int16_t)g_com_map[DIST_OFFSET]; |
| | | PushAnchorDataArray(tag_id_recv,rec_ancdistlist[i],battary); |
| | | } |
| | | } |