| | |
| | | //} |
| | | } |
| | | float temp1,temp2; |
| | | uint8_t aoa_fom[TAG_NUM_IN_SYS]; |
| | | static void angle_result_filter(uint8_t *mac_addr, int16_t *angle, uint8_t type) |
| | | { |
| | | if (angle == NULL) |
| | |
| | | angle_result_filter(&mac_addr,&elevation, KF_DATA_TYPE_ELEVATION); |
| | | angle_azimuth[taglist_pos]=(uint16_t)mk_q7_to_s16(azimuth); |
| | | angle_elevation[taglist_pos]=(uint16_t)mk_q7_to_s16(elevation); |
| | | aoa_fom[taglist_pos]=fom; |
| | | //buffer_message_send(); |
| | | //int16_t azimth=mk_q7_to_s16(azimuth),elevate=mk_q7_to_s16(elevation); |
| | | |
| | | // // filter process |
| | | |
| | | LOG_INFO(TRACE_MODULE_APP, "PDoA 0x%04x Azimuth %d Elevation %d FoM %u area%#x\r\n",tag_id_recv, mk_q7_to_s16(azimuth), |
| | | mk_q7_to_s16(elevation), fom,show_location[taglist_pos]); |
| | | LOG_INFO(TRACE_MODULE_APP, "PDoA 0x%04x Azimuth %d Elevation %d FoM %u \r\n",tag_id_recv, mk_q7_to_s16(azimuth), |
| | | mk_q7_to_s16(elevation), fom); |
| | | allow_flag=0; |
| | | } |
| | | } |
| | |
| | | static uint8_t anchordata_bat[TAG_NUM_IN_SYS]; |
| | | uint8_t anchordata_num = 0; |
| | | static int16_t tagdist_list[TAG_NUM_IN_SYS]; |
| | | uint8_t rssi_quality[TAG_NUM_IN_SYS]; |
| | | |
| | | uint16_t state_button[TAG_NUM_IN_SYS]; |
| | | uint16_t pressure[TAG_NUM_IN_SYS]; |
| | | uint16_t random_time; |
| | |
| | | uint8_t rssi_temp=tag_rssi[j]; |
| | | tag_rssi[j]=tag_rssi[j+1]; |
| | | tag_rssi[j+1]=rssi_temp; |
| | | //信号质量交换 |
| | | uint8_t temp_quality=rssi_quality[j]; |
| | | rssi_quality[j]=rssi_quality[j+1]; |
| | | rssi_quality[j+1]=temp_quality; |
| | | //角度置信度交换 |
| | | uint8_t temp_fom=aoa_fom[j]; |
| | | aoa_fom[j]=aoa_fom[j+1]; |
| | | aoa_fom[j+1]=temp_fom; |
| | | //设备状态交换 |
| | | uint16_t temp_state=state_button[j]; |
| | | state_button[j]=state_button[j+1]; |
| | |
| | | } |
| | | taglist_num=j; |
| | | sort_tag_lists();//增加距离小的排到前面逻辑 |
| | | update_show_buffer();//根据角度和距离判断区域位置 |
| | | gpio_pin_set(CHANGE_UART_PIN);//;拉高打印输出 |
| | | buffer_message_send();//发送测距报文信息 |
| | | // //delay_ms(10); |
| | | buffer_485_send(show_location);//发送显示信息 |
| | | while(uart_tx_in_progress(UART_ID0)); |
| | | gpio_pin_clr(CHANGE_UART_PIN);//;拉低变接收 |
| | | //update_show_buffer();//根据角度和距离判断区域位置 |
| | | // gpio_pin_set(CHANGE_UART_PIN);//;拉高打印输出 |
| | | //buffer_message_send();//发送测距报文信息 |
| | | //buffer_485_send(show_location);//发送显示信息 |
| | | // while(uart_tx_in_progress(UART_ID0)); |
| | | // gpio_pin_clr(CHANGE_UART_PIN);//;拉低变接收 |
| | | } |
| | | |
| | | uint8_t position; |
| | |
| | | memcpy(&usart0_send[11+i*16],&angle_azimuth[i],2);//angle_azithum |
| | | memcpy(&usart0_send[13+i*16],&angle_elevation[i],2);//angle_elevation |
| | | memcpy(&usart0_send[15+i*16],&tag_rssi[i],1); //信号强度 |
| | | memcpy(&usart0_send[16+i*16],&rssi_quality[i],1); //信号质量预留 |
| | | memcpy(&usart0_send[16+i*16],&aoa_fom[i],1); //信号质量预留 |
| | | usart0_send[17+i*16]=anchordata_bat[i];//标签电量 |
| | | memcpy(&usart0_send[18+i*16],&state_button[i],2); //设备状态 |
| | | memcpy(&usart0_send[20+i*16],&pressure[i],2); //气压 |
| | |
| | | memcpy(&usart0_send[6+taglist_num*16],&yuliu,4); //预留位4位 |
| | | checksum = Checksum_u16(&usart0_send[2],8+16*taglist_num); |
| | | memcpy(&usart0_send[10+16*taglist_num], &checksum, 2); |
| | | gpio_pin_set(CHANGE_UART_PIN);//;拉高打印输出 |
| | | uart_send(UART_ID0, usart0_send,12+16*taglist_num, NULL); |
| | | while(uart_tx_in_progress(UART_ID0)); |
| | | gpio_pin_clr(CHANGE_UART_PIN);//;拉低变接收 |
| | | } |
| | | int Anchor_App(void) |
| | | { |