-
Notifications
You must be signed in to change notification settings - Fork 0
/
peripheral_app.h
61 lines (51 loc) · 2.18 KB
/
peripheral_app.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// based on the ble_peripheral example in RTL8762C-sdk-gcc-v0.0.5.zip
// <https://www.realmcu.com/en/Home/Product/93cc0582-3a3f-4ea8-82ea-76c6504e478a>
// modified by wuwbobo2021 <https://github.com/wuwbobo2021>, <[email protected]>
#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>
/*============================================================================*
* Variables
*============================================================================*/
extern T_SERVER_ID simp_srv_id; /**< Simple ble service id*/
extern volatile bool app_allowed_enter_dlps;
/*============================================================================*
* 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);
#ifdef __cplusplus
}
#endif
#endif