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 /**
223  * Default MTU size.
224  */
225 static const unsigned BLE_GATT_MTU_SIZE_DEFAULT = 23;
226 
227 /**
228  * Handle Value Notification/Indication event.
229  *
230  * Emmitted when a notification or indication has been received from a GATT
231  * server.
232  */
233 enum HVXType_t {
234  /**
235  * Handle Value Notification.
236  */
238 
239  /**
240  * Handle Value Indication.
241  */
243 };
244 
245 /**
246  * @}
247  * @}
248  */
249 
250 #ifdef __cplusplus
251 }
252 #endif
253 
254 #endif // ifndef MBED_BLE_COMMON_H__
Out of memory.
Characteristic Aggregate Format Descriptor.
Data not found or there is nothing to return.
Characteristic Extended Properties Descriptor.
static const unsigned BLE_GATT_MTU_SIZE_DEFAULT
Default MTU size.
Reconnection Address Characteristic.
Server Characteristic Configuration Descriptor.
Characteristic Presentation Format Descriptor.
Generic Attribute Profile.
Characteristic User Description Descriptor.
The stack is busy.
The BLE system has already been initialized.
Included service.
The platform-specific stack failed.
One of the supplied parameters is invalid.
Peripheral Preferred Connection Parameters Characteristic.
Handle Value Notification.
Handle Value Indication.
HVXType_t
Handle Value Notification/Indication event.
Reserved UUID.
Peripheral Privacy Flag Characteristic.
Service Changed Characteristic.
The BLE subsystem has not completed its initialization.
Generic Access Profile.
Client Characteristic Configuration Descriptor.
Requested a feature that isn't yet implemented or isn't supported by the target HW.
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.