Mistake on this page?
Report an issue in GitHub or email us
common/blecommon.h
1 /* mbed Microcontroller Library
2  * Copyright (c) 2006-2020 ARM Limited
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef MBED_BLE_COMMON_H__
20 #define MBED_BLE_COMMON_H__
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /**
27  * @addtogroup ble
28  * @{
29  * @addtogroup common
30  * @{
31  */
32 
33 /**
34  * Assigned values for BLE UUIDs.
35  */
36 enum {
37  /**
38  * Reserved UUID.
39  */
40  BLE_UUID_UNKNOWN = 0x0000,
41 
42  /**
43  * Primary Service.
44  */
46 
47  /**
48  * Secondary Service.
49  */
51 
52  /**
53  * Included service.
54  */
56 
57  /**
58  * Characteristic.
59  */
61 
62  /**
63  * Characteristic Extended Properties Descriptor.
64  */
66 
67  /**
68  * Characteristic User Description Descriptor.
69  */
71 
72  /**
73  * Client Characteristic Configuration Descriptor.
74  */
76 
77  /**
78  * Server Characteristic Configuration Descriptor.
79  */
81 
82  /**
83  * Characteristic Presentation Format Descriptor.
84  */
86 
87  /**
88  * Characteristic Aggregate Format Descriptor.
89  */
91 
92 /* GATT specific UUIDs */
93  /**
94  * Generic Attribute Profile.
95  */
96  BLE_UUID_GATT = 0x1801,
97 
98  /**
99  * Service Changed Characteristic.
100  */
102 
103 /* GAP specific UUIDs */
104 
105  /**
106  * Generic Access Profile.
107  */
108  BLE_UUID_GAP = 0x1800,
109 
110  /**
111  * Device Name Characteristic.
112  */
114 
115  /**
116  * Appearance Characteristic.
117  */
119 
120  /**
121  * Peripheral Privacy Flag Characteristic.
122  */
124 
125  /**
126  * Reconnection Address Characteristic.
127  */
129 
130  /**
131  * Peripheral Preferred Connection Parameters Characteristic.
132  */
134 };
135 
136 /**
137  * Error codes for the BLE API.
138  *
139  * The value 0 means that no error was reported; therefore, it allows an API
140  * user to cleanly test for errors.
141  *
142  * @code
143  * ble_error_t error = some_ble_api_function();
144  * if (error) {
145  * // handle the error
146  * }
147  * @endcode
148  */
150  /**
151  * No error.
152  */
154 
155  /**
156  * The requested action would cause a buffer overflow and has been aborted.
157  */
159 
160  /**
161  * Requested a feature that isn't yet implemented or isn't supported by the
162  * target HW.
163  */
165 
166  /**
167  * One of the supplied parameters is outside the valid range.
168  */
170 
171  /**
172  * One of the supplied parameters is invalid.
173  */
175 
176  /**
177  * The stack is busy.
178  */
180 
181  /**
182  * Invalid state.
183  */
185 
186  /**
187  * Out of memory.
188  */
190 
191  /**
192  * The operation requested is not permitted.
193  */
195 
196  /**
197  * The BLE subsystem has not completed its initialization.
198  */
200 
201  /**
202  * The BLE system has already been initialized.
203  */
205 
206  /**
207  * Unknown error.
208  */
210 
211  /**
212  * The platform-specific stack failed.
213  */
215 
216  /**
217  * Data not found or there is nothing to return.
218  */
220 
221  /**
222  * Specified timeout expired.
223  */
225 
226  /**
227  * Specified limit expired.
228  */
230 };
231 
232 /**
233  * Default MTU size.
234  */
235 static const unsigned BLE_GATT_MTU_SIZE_DEFAULT = 23;
236 
237 /**
238  * Handle Value Notification/Indication event.
239  *
240  * Emmitted when a notification or indication has been received from a GATT
241  * server.
242  */
243 enum HVXType_t {
244  /**
245  * Handle Value Notification.
246  */
248 
249  /**
250  * Handle Value Indication.
251  */
253 };
254 
255 /**
256  * @}
257  * @}
258  */
259 
260 #ifdef __cplusplus
261 }
262 #endif
263 
264 #endif // ifndef MBED_BLE_COMMON_H__
Out of memory.
Data not found or there is nothing to return.
Specified limit expired.
Characteristic Aggregate Format Descriptor.
static const unsigned BLE_GATT_MTU_SIZE_DEFAULT
Default MTU size.
Specified timeout expired.
Generic Access Profile.
Client Characteristic Configuration Descriptor.
Reconnection Address Characteristic.
Included service.
Peripheral Privacy Flag Characteristic.
Characteristic Extended Properties Descriptor.
The stack is busy.
Server Characteristic Configuration Descriptor.
The BLE system has already been initialized.
The platform-specific stack failed.
One of the supplied parameters is invalid.
Characteristic Presentation Format Descriptor.
Peripheral Preferred Connection Parameters Characteristic.
Characteristic User Description Descriptor.
Generic Attribute Profile.
Handle Value Notification.
Handle Value Indication.
HVXType_t
Handle Value Notification/Indication event.
Reserved UUID.
The BLE subsystem has not completed its initialization.
Requested a feature that isn't yet implemented or isn't supported by the target HW.
Service Changed Characteristic.
The requested action would cause a buffer overflow and has been aborted.
One of the supplied parameters is outside the valid range.
The operation requested is not permitted.
ble_error_t
Error codes for the BLE API.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.