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