diff options
author | reparo_liu <reparo_liu@realsil.com.cn> | 2023-05-18 11:23:40 +0800 |
---|---|---|
committer | reparo_liu <reparo_liu@realsil.com.cn> | 2023-05-19 09:18:25 +0800 |
commit | 64889cda2e397915ee6c3800d4acafb1c34e2ef3 (patch) | |
tree | f9d61cfc074d3297dff0d97ff1443617bc330bd2 /src/sample/ble_peripheral/peripheral_app.h | |
parent | 151cf392d25c5de46a4cdaaa78dfc46448a1f8c3 (diff) | |
download | realtek-64889cda2e397915ee6c3800d4acafb1c34e2ef3.tar.gz |
upload project and readme file
BYPASS_INCLUSIVE_LANGUAGE_REASON=false positive
bug:
Change-Id: Ibc24ce136cb2c838214643d90017530996589b37
test: manual
Diffstat (limited to 'src/sample/ble_peripheral/peripheral_app.h')
-rw-r--r-- | src/sample/ble_peripheral/peripheral_app.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/sample/ble_peripheral/peripheral_app.h b/src/sample/ble_peripheral/peripheral_app.h new file mode 100644 index 0000000..62c07e9 --- /dev/null +++ b/src/sample/ble_peripheral/peripheral_app.h @@ -0,0 +1,85 @@ +/** +***************************************************************************************** +* Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved. +***************************************************************************************** + * @file peripheral_app.h + * @brief This file handles BLE peripheral application routines. + * @author jane + * @date 2017-06-06 + * @version v1.0 + ************************************************************************************** + * @attention + * <h2><center>© COPYRIGHT 2017 Realtek Semiconductor Corporation</center></h2> + ************************************************************************************** + */ + +#ifndef _PERIPHERAL_APP__ +#define _PERIPHERAL_APP__ + +#ifdef __cplusplus +extern "C" { +#endif +/*============================================================================* + * Header Files + *============================================================================*/ +#include <app_msg.h> +#include <gap_le.h> +#include <profile_server.h> + + +/** @defgroup PERIPH_APP Peripheral Application + * @brief Peripheral Application + * @{ + */ + + +/*============================================================================* + * Variables + *============================================================================*/ +extern T_SERVER_ID simp_srv_id; /**< Simple ble service id*/ +extern T_SERVER_ID bas_srv_id; /**< Battery service 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 All the BT Profile service callback events are handled in this function + * @note Then the event handling function shall be called according to the + * service_id. + * @param[in] service_id Profile service ID + * @param[in] p_data Pointer to callback data + * @return Indicates the function call is successful or not + * @retval result @ref T_APP_RESULT + */ +T_APP_RESULT app_profile_callback(T_SERVER_ID service_id, void *p_data); + +/** + * @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); + + +/** End of PERIPH_APP +* @} +*/ + + +#ifdef __cplusplus +} +#endif + +#endif + |