Mistake on this page?
Report an issue in GitHub or email us
common/BLERoles.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_ROLES_H__
20 #define MBED_BLE_ROLES_H__
21 
22 #if !(BLE_ROLE_OBSERVER) && !(BLE_ROLE_BROADCASTER)
23  #error "BLE requires at least one role 'BROADCASTER' or 'OBSERVER' to be enabled"
24 #endif
25 
26 #if (BLE_ROLE_PERIPHERAL) || (BLE_ROLE_CENTRAL)
27  #define BLE_FEATURE_CONNECTABLE 1
28 #endif
29 
30 #if (BLE_FEATURE_GATT_CLIENT) || (BLE_FEATURE_GATT_SERVER)
31  #define BLE_FEATURE_ATT 1
32 #endif
33 
34 #if BLE_ROLE_PERIPHERAL
35  #if !(BLE_ROLE_BROADCASTER)
36  #error "BLE role 'PERIPHERAL' depends on role 'BROADCASTER'"
37  #endif
38 #endif // BLE_ROLE_PERIPHERAL
39 
40 #if BLE_ROLE_CENTRAL
41  #if !(BLE_ROLE_OBSERVER)
42  #error "BLE role 'CENTRAL' depends on role 'OBSERVER'"
43  #endif
44 #endif // BLE_ROLE_CENTRAL
45 
46 #if BLE_FEATURE_SECURITY
47  #if !(BLE_ROLE_PERIPHERAL) && !(BLE_ROLE_CENTRAL)
48  #error "BLE feature 'SECURITY' requires 'PERIPHERAL' or 'CENTRAL' role"
49  #endif
50 #endif // BLE_FEATURE_SECURITY
51 
52 #if BLE_FEATURE_SECURE_CONNECTIONS
53  #if !(BLE_FEATURE_SECURITY)
54  #error "BLE feature 'SECURE CONNECTIONS' requires the 'SECURITY' feature"
55  #endif
56 #endif // BLE_FEATURE_SECURE_CONNECTIONS
57 
58 #if BLE_FEATURE_SIGNING
59  #if !(BLE_FEATURE_SECURITY)
60  #error "BLE feature 'SIGNING' requires the 'SECURITY' feature"
61  #endif
62 #endif // BLE_FEATURE_SIGNING
63 
64 #if BLE_FEATURE_WHITELIST
65  #if !(BLE_FEATURE_SECURITY)
66  #error "BLE feature 'WHITELIST' requires the 'SECURITY' feature"
67  #endif
68 #endif // BLE_FEATURE_WHITELIST
69 
70 #if BLE_FEATURE_PRIVACY
71  #if !(BLE_FEATURE_SECURITY)
72  #error "BLE feature 'PRIVACY' requires the 'SECURITY' feature"
73  #endif
74 #endif // BLE_FEATURE_PRIVACY
75 
76 #if BLE_FEATURE_PERIODIC_ADVERTISING
77  #if !(BLE_FEATURE_EXTENDED_ADVERTISING)
78  #error "BLE feature 'PERIODIC ADVERTISING' requires the 'EXTENDED ADVERTISING' feature"
79  #endif
80 #endif // BLE_FEATURE_PERIODIC_ADVERTISING
81 
82 #if BLE_FEATURE_GATT_CLIENT
83  #if !(BLE_FEATURE_CONNECTABLE)
84  #error "BLE feature 'GATT CLIENT' requires 'PERIPHERAL' or 'CENTRAL' role"
85  #endif
86 #endif // BLE_FEATURE_GATT_CLIENT
87 
88 #if BLE_FEATURE_GATT_SERVER
89  #if !(BLE_FEATURE_CONNECTABLE)
90  #error "BLE feature 'GATT SERVER' requires 'PERIPHERAL' or 'CENTRAL' role"
91  #endif
92 #endif // BLE_FEATURE_GATT_SERVER
93 
94 #endif // MBED_BLE_ROLES_H__
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.