| | |
| | | extern uint8_t group_id; |
| | | static uint16_t anc_id_recv,tag_id_recv; |
| | | static int16_t rec_antdelay; |
| | | extern uint32_t dev_id; |
| | | extern uint16_t dev_id; |
| | | static uint16_t taglist_pos,tmp_time; |
| | | extern uint16_t tag_frequency; |
| | | extern uint16_t disoffset; |
| | |
| | | uint32_t start_receive_count,end_receive_count,poll_timeout,current_count,temp_resp; |
| | | uint16_t anchordata_id[TAG_NUM_IN_SYS],anchordata_dist[TAG_NUM_IN_SYS]; |
| | | static uint8_t anchordata_bat[TAG_NUM_IN_SYS]; |
| | | static int8_t anchor_rssi[TAG_NUM_IN_SYS]; |
| | | uint8_t anchordata_num = 0; |
| | | static int16_t tagdist_list[TAG_NUM_IN_SYS]; |
| | | uint16_t random_time; |
| | |
| | | tagid_list[j]=tagid_list[i]; |
| | | tagdist_list[j] = tagdist_list[i]; |
| | | anchordata_bat[j]=anchordata_bat[i];//电量随之更新 |
| | | anchor_rssi[j]=anchor_rssi[i]; |
| | | tagofflinetime[j++]=tagofflinetime[i]; |
| | | } |
| | | } |
| | |
| | | { |
| | | uint16_t id,dist; |
| | | uint8_t bat; |
| | | int8_t rssi1; |
| | | id = tagid_list[j]; |
| | | dist = tagdist_list[j]; |
| | | bat = anchordata_bat[j]; |
| | | rssi1=anchor_rssi[j]; |
| | | tagid_list[j] = tagid_list[j+1]; |
| | | tagdist_list[j] = tagdist_list[j+1]; |
| | | anchordata_bat[j] = anchordata_bat[j+1]; |
| | | anchor_rssi[j] = anchor_rssi[j+1]; |
| | | tagid_list[j+1] = id; |
| | | tagdist_list[j+1] = dist; |
| | | anchordata_bat[j+1] = bat; |
| | | anchor_rssi[j+1] = rssi1; |
| | | } |
| | | } |
| | | |
| | |
| | | Anchor_RecNearPoll(i); |
| | | tagdist_list[taglist_pos]=rec_ancdistlist[i]; |
| | | anchordata_bat[taglist_pos] = battary;//保存该基站电量 |
| | | anchor_rssi[taglist_pos]=rssi; |
| | | if(taglist_pos==taglist_num)// taglist_pos==taglist_num 说明这个基站不在当前列表中 |
| | | { //tempid==dev_id 说明基站下发测距报文有这个标签的信息 |
| | | taglist_num++; //满足上述两种情况才会添加基站ID进入列表中,否则会出现标签不在基站列表中,标签也不响应的情况 |