| | |
| | | /* |
| | | * Copyright (c) 2019-2023 Beijing Hanwei Innovation Technology Ltd. Co. and |
| | | * Copyright (c) 2019-2025 Beijing Hanwei Innovation Technology Ltd. Co. and |
| | | * its subsidiaries and affiliates (collectly called MKSEMI). |
| | | * |
| | | * All rights reserved. |
| | |
| | | #ifndef RANGING_FIRA_H_ |
| | | #define RANGING_FIRA_H_ |
| | | #include "lib_fira.h" |
| | | #include "wsf_timer.h" |
| | | #include "mk_timer_list.h" |
| | | #include "ranging_fira_task.h" |
| | | |
| | | #ifndef PDOA_3D_EN |
| | | #define PDOA_3D_EN (0) |
| | | #endif |
| | | |
| | | #ifndef RANGING_FOM_FILTER_EN |
| | | #define RANGING_FOM_FILTER_EN (0) |
| | | #endif |
| | | |
| | | /* Main control block of the ranging task */ |
| | |
| | | { |
| | | wsfQueue_t msg_queue; |
| | | wsfHandlerId_t handle_id; |
| | | wsfTimer_t daemon_timer; |
| | | mk_timer_t daemon_timer; |
| | | }; |
| | | |
| | | #if MCTT_TEST_EN |
| | | /** Ranging round print payload indication */ |
| | | struct RANGING_ROUND_PRINT_IND_T |
| | | { |
| | | wsfMsgHdr_t hdr; |
| | | }; |
| | | #endif |
| | | |
| | | #ifdef __cplusplus |
| | | extern "C" { |
| | |
| | | * This API will be called by ranging stop |
| | | */ |
| | | void ranging_monitor_stop(void); |
| | | |
| | | /** |
| | | * @brief Filter distance result. |
| | | * |
| | | * @param [in] mac_addr Pointer of device MAC address |
| | | * @param [inout] distance Pointer of ranging distance result |
| | | */ |
| | | void distance_result_filter(uint8_t *mac_addr, uint16_t *distance); |
| | | |
| | | /** |
| | | * @brief Filter angle result. |
| | | * |
| | | * @param [in] mac_addr Pointer of device MAC address |
| | | * @param [inout] angle Pointer of angle result |
| | | * @param [in] type azimuth or elevation |
| | | */ |
| | | void angle_result_filter(uint8_t *mac_addr, int16_t *angle, uint8_t type); |
| | | |
| | | /** |
| | | * @brief Filter ranging result. |
| | | * |
| | | * @param [in] mac_addr Pointer of device MAC address |
| | | * @param [inout] distance Pointer of ranging distance result |
| | | * @param [inout] azimuth Pointer of azimuth result |
| | | * @param [inout] elevation Pointer of elevation result |
| | | */ |
| | | void ranging_result_filter(uint8_t *mac_addr, uint16_t *distance, int16_t *azimuth, int16_t *elevation); |
| | | |
| | | /** |
| | | * @brief Ranging procedure complete handler, to calculate distance. |