diff options
Diffstat (limited to 'src/sample/ble_central/central_app.h')
-rw-r--r-- | src/sample/ble_central/central_app.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/sample/ble_central/central_app.h b/src/sample/ble_central/central_app.h new file mode 100644 index 0000000..c7f8779 --- /dev/null +++ b/src/sample/ble_central/central_app.h @@ -0,0 +1,69 @@ +/** +***************************************************************************************** +* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. +***************************************************************************************** + * @file central_app.h + * @brief This file handles BLE central application routines. + * @author jane + * @date 2017-06-06 + * @version v1.0 + ************************************************************************************** + * @attention + * <h2><center>© COPYRIGHT 2017 Realtek Semiconductor Corporation</center></h2> + ************************************************************************************** + */ + +#ifndef _CENTRAL_APP_H_ +#define _CENTRAL_APP_H_ + +#ifdef __cplusplus +extern "C" { +#endif +/*============================================================================* + * Header Files + *============================================================================*/ +#include <profile_client.h> +#include <app_msg.h> + +/*============================================================================* + * Variables + *============================================================================*/ +extern T_CLIENT_ID gaps_client_id; /**< Simple ble service client id*/ +extern T_CLIENT_ID simple_ble_client_id; /**< gap service client id*/ +extern T_CLIENT_ID bas_client_id; /**< battery service client id*/ + +/*============================================================================* + * Functions + *============================================================================*/ + +/** + * @brief All the application messages are pre-handled in this function + * @note All the IO MSGs are sent to this function, then the event handling + * function shall be called according to the MSG type. + * @param[in] io_msg IO message data + * @return void + */ +void app_handle_io_msg(T_IO_MSG io_msg); +/** + * @brief Callback for gap le to notify app + * @param[in] cb_type callback msy type @ref GAP_LE_MSG_Types. + * @param[in] p_cb_data point to callback data @ref T_LE_CB_DATA. + * @retval result @ref T_APP_RESULT + */ +T_APP_RESULT app_gap_callback(uint8_t cb_type, void *p_cb_data); + +/** + * @brief Callback will be called when data sent from profile client layer. + * @param client_id the ID distinguish which module sent the data. + * @param conn_id connection ID. + * @param p_data pointer to data. + * @retval result @ref T_APP_RESULT + */ +T_APP_RESULT app_client_callback(T_CLIENT_ID client_id, uint8_t conn_id, void *p_data); + +#ifdef __cplusplus +} +#endif + +#endif + |