/** ********************************************************************************************************* * Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. ********************************************************************************************************* * @file gap_aox.h * @brief Head file for GAP AoA/AoD * @details * @author * @date 2020-06-18 * @version v0.8 * ********************************************************************************************************* */ /*============================================================================* * Define to prevent recursive inclusion *============================================================================*/ #ifndef GAP_AOX_H #define GAP_AOX_H #ifdef __cplusplus extern "C" { #endif /*============================================================================* * Header Files *============================================================================*/ #include "upperstack_config.h" #include "gap_le.h" #include "gap_le_types.h" #if F_BT_LE_5_1_AOA_AOD_SUPPORT /** @addtogroup GAP GAP Module * @{ */ /** @addtogroup GAP_LE GAP LE Module * @{ */ /** @addtogroup GAP_LE_AOX GAP LE AoA/AoD Module * @{ */ /*============================================================================* * Macros *============================================================================*/ /** @defgroup GAP_LE_AOX_Exported_Macros GAP LE AoX Exported Macros * @{ */ /** @defgroup GAP_LE_AOX_MSG_Types GAP LE AoX Msg Types * @{ */ #define GAP_MSG_LE_AOX_READ_ANTENNA_INFORMATION 0x01 /** Not send gap aox command messages to APP. * @arg Other -> Use application defined callback function. * @return void * * Example usage * \code{.c} void app_le_gap_init(void) { ...... le_register_aox_cb(app_gap_aox_callback); } T_APP_RESULT app_gap_aox_callback(uint8_t cb_type, void *p_cb_data) { T_APP_RESULT result = APP_RESULT_SUCCESS; T_LE_AOX_CB_DATA *p_data = (T_LE_AOX_CB_DATA *)p_cb_data; switch (cb_type) { case GAP_MSG_LE_AOX_READ_ANTENNA_INFORMATION: APP_PRINT_INFO5("GAP_MSG_LE_AOX_READ_ANTENNA_INFORMATION: cause 0x%x, supported_switching_sampling_rates 0x%x, num_antennae %d, max_switching_pattern_length %d, max_cte_length %d", p_data->p_le_aox_read_antenna_information_rsp->cause, p_data->p_le_aox_read_antenna_information_rsp->supported_switching_sampling_rates, p_data->p_le_aox_read_antenna_information_rsp->num_antennae, p_data->p_le_aox_read_antenna_information_rsp->max_switching_pattern_length, p_data->p_le_aox_read_antenna_information_rsp->max_cte_length ); break; ...... } ...... } \endcode */ void le_register_aox_cb(P_FUN_LE_AOX_CB aox_callback); /** * @brief Read antenna information. * Read the supported_switching_sampling_rates, num_antennae, max_switching_pattern_length, max_cte_length * of a transmitted Constant Tone Extension supported by the Controller. * Antenna information will be returned by @ref app_gap_aox_callback with cb_type @ref GAP_MSG_LE_AOX_READ_ANTENNA_INFORMATION. * * Application can only call this API after stack is ready. * Explanation: If stack is ready, Application will be notified by message @ref GAP_MSG_LE_DEV_STATE_CHANGE * with new_state about gap_init_state which is configured as @ref GAP_INIT_STATE_STACK_READY. * * @return Result of sending request. * @retval GAP_CAUSE_SUCCESS: Send request success. * @retval GAP_CAUSE_SEND_REQ_FAILED: Send request sent fail. * * Example usage * \code{.c} void test() { le_aox_read_antenna_information(); } T_APP_RESULT app_gap_aox_callback(uint8_t cb_type, void *p_cb_data) { T_APP_RESULT result = APP_RESULT_SUCCESS; T_LE_AOX_CB_DATA *p_data = (T_LE_AOX_CB_DATA *)p_cb_data; switch (cb_type) { ...... case GAP_MSG_LE_AOX_READ_ANTENNA_INFORMATION: APP_PRINT_INFO5("GAP_MSG_LE_AOX_READ_ANTENNA_INFORMATION: cause 0x%x, supported_switching_sampling_rates 0x%x, num_antennae %d, max_switching_pattern_length %d, max_cte_length %d", p_data->p_le_aox_read_antenna_information_rsp->cause, p_data->p_le_aox_read_antenna_information_rsp->supported_switching_sampling_rates, p_data->p_le_aox_read_antenna_information_rsp->num_antennae, p_data->p_le_aox_read_antenna_information_rsp->max_switching_pattern_length, p_data->p_le_aox_read_antenna_information_rsp->max_cte_length ); break; ...... } ...... } * \endcode */ T_GAP_CAUSE le_aox_read_antenna_information(void); /** End of GAP_LE_AOA_AOD_Exported_Functions * @} */ /** End of GAP_LE_AOA_AOD * @} */ /** End of GAP_LE * @} */ /** End of GAP * @} */ #endif #ifdef __cplusplus } #endif #endif /* GAP_AOX_H */