ble_srv_disc_utils.h
Go to the documentation of this file.
1 /**
2 ******************************************************************************
3 *
4 * @file ble_srv_disc_utils.h
5 *
6 * @brief Service Discovery Utilities API
7 *
8 ******************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 /**
39 * @addtogroup BLE_SRV BLE Services
40 * @{
41 * @brief Definitions and prototypes for the BLE Service interface.
42 */
43
44 /**
45 * @defgroup BLE_SRV_DISC_UTILS Service Discovery Utilities
46 * @{
47 * @brief Definitions and prototypes for the Service Discovery Utilities interface.
48 *
49 */
50
51 #ifndef __BLE_SRV_DISC_UTILS_H__
52 #define __BLE_SRV_DISC_UTILS_H__
53
54 #include <stdint.h>
55
56 /**
57 * @defgroup DIS_C_MACRO Defines
58 * @{
59 */
60 #define BLE_SRV_DISC_PROC_MAX 6 /**< Maximum number of services discovery procedure in one application. */
61 /** @} */
62
63 /**
64 * @defgroup BLE_SRV_DISC_UTILS_ENUM Enumerations
65 * @{
66 */
67 /**@brief BLE Service Discovery Procedure State. */
68 typedef enum
69 {
70 BLE_SRV_DISC_NO_IMPLEMENT, /**< Service discovery procedure has not been implemented. */
71 BLE_SRV_DISC_UNDERWAY, /**< Service discovery procedure is underway. */
72 BLE_SRV_DISC_COMPLETELY, /**< Service discovery procedure has been completed. */
73 } ble_srv_disc_state_t;
74
75 /**@brief BLE Service Discovery Procedure ID. */
76 typedef enum
77 {
78 BLE_SRV_DISC_PROC_ID_0, /**< Service discovery procedure ID_0. */
79 BLE_SRV_DISC_PROC_ID_1, /**< Service discovery procedure ID_1. */
80 BLE_SRV_DISC_PROC_ID_2, /**< Service discovery procedure ID_2. */
81 BLE_SRV_DISC_PROC_ID_3, /**< Service discovery procedure ID_3. */
82 BLE_SRV_DISC_PROC_ID_4, /**< Service discovery procedure ID_4. */
83 BLE_SRV_DISC_PROC_ID_5, /**< Service discovery procedure ID_5. */
84 BLE_SRV_DISC_PROC_NB /**< Maximum number of services discovery procedure in one application. */
85 } ble_srv_disc_proc_t;
86 /** @} */
87
88 /**
89 * @defgroup BLE_SRV_DISC_UTILS_FUNCTION Functions
90 * @{
91 */
92
93 /**
94 *****************************************************************************************
95 * @brief Service discovery procedure state set.
96 *
97 * @param[in] srv_disc_proc_id: Service discovery procedure.
98 * @param[in] srv_disc_state: State of service discovery procedure.
99 *****************************************************************************************
100 */
101 void ble_srv_disc_proc_state_set(uint8_t srv_disc_proc_id, ble_srv_disc_state_t srv_disc_state);
102
103 /**
104 *****************************************************************************************
105 * @brief Get service discovery procedure state.
106 *
107 * @param[in] srv_disc_proc_id: Service discovery procedure.
108 *
109 * @return State of service discovery procedure.
110 *****************************************************************************************
111 */
112 ble_srv_disc_state_t ble_srv_disc_proc_state_get(uint8_t srv_disc_proc_id);
113 /** @} */
114
115 #endif
116 /** @} */
117 /** @} */
118
BLE_SRV_DISC_PROC_ID_5
@ BLE_SRV_DISC_PROC_ID_5
Service discovery procedure ID_5.
Definition: ble_srv_disc_utils.h:83
BLE_SRV_DISC_COMPLETELY
@ BLE_SRV_DISC_COMPLETELY
Service discovery procedure has been completed.
Definition: ble_srv_disc_utils.h:72
BLE_SRV_DISC_UNDERWAY
@ BLE_SRV_DISC_UNDERWAY
Service discovery procedure is underway.
Definition: ble_srv_disc_utils.h:71
BLE_SRV_DISC_PROC_ID_1
@ BLE_SRV_DISC_PROC_ID_1
Service discovery procedure ID_1.
Definition: ble_srv_disc_utils.h:79
BLE_SRV_DISC_PROC_ID_3
@ BLE_SRV_DISC_PROC_ID_3
Service discovery procedure ID_3.
Definition: ble_srv_disc_utils.h:81
ble_srv_disc_state_t
ble_srv_disc_state_t
BLE Service Discovery Procedure State.
Definition: ble_srv_disc_utils.h:69
BLE_SRV_DISC_PROC_ID_2
@ BLE_SRV_DISC_PROC_ID_2
Service discovery procedure ID_2.
Definition: ble_srv_disc_utils.h:80
ble_srv_disc_proc_state_set
void ble_srv_disc_proc_state_set(uint8_t srv_disc_proc_id, ble_srv_disc_state_t srv_disc_state)
Service discovery procedure state set.
BLE_SRV_DISC_PROC_ID_0
@ BLE_SRV_DISC_PROC_ID_0
Service discovery procedure ID_0.
Definition: ble_srv_disc_utils.h:78
ble_srv_disc_proc_state_get
ble_srv_disc_state_t ble_srv_disc_proc_state_get(uint8_t srv_disc_proc_id)
Get service discovery procedure state.
BLE_SRV_DISC_PROC_NB
@ BLE_SRV_DISC_PROC_NB
Maximum number of services discovery procedure in one application.
Definition: ble_srv_disc_utils.h:84
BLE_SRV_DISC_NO_IMPLEMENT
@ BLE_SRV_DISC_NO_IMPLEMENT
Service discovery procedure has not been implemented.
Definition: ble_srv_disc_utils.h:70
ble_srv_disc_proc_t
ble_srv_disc_proc_t
BLE Service Discovery Procedure ID.
Definition: ble_srv_disc_utils.h:77
BLE_SRV_DISC_PROC_ID_4
@ BLE_SRV_DISC_PROC_ID_4
Service discovery procedure ID_4.
Definition: ble_srv_disc_utils.h:82