2019-01-06 18:27:05 +00:00
|
|
|
#ifndef MBED_BLE_ROLES_H__
|
|
|
|
#define MBED_BLE_ROLES_H__
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if !(BLE_ROLE_OBSERVER) && !(BLE_ROLE_BROADCASTER)
|
2019-02-06 15:14:37 +00:00
|
|
|
#error "BLE requires at least one role 'BROADCASTER' or 'OBSERVER' to be enabled"
|
|
|
|
#endif
|
|
|
|
|
2019-02-07 15:51:14 +00:00
|
|
|
#if (BLE_ROLE_PERIPHERAL) || (BLE_ROLE_CENTRAL)
|
2019-02-06 16:10:39 +00:00
|
|
|
#define BLE_FEATURE_CONNECTABLE 1
|
2019-02-06 15:36:39 +00:00
|
|
|
#endif
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if (BLE_FEATURE_GATT_CLIENT) || (BLE_FEATURE_GATT_SERVER)
|
2019-02-06 15:36:39 +00:00
|
|
|
#define BLE_FEATURE_ATT 1
|
|
|
|
#endif
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if BLE_ROLE_PERIPHERAL
|
2019-02-22 17:10:53 +00:00
|
|
|
#if !(BLE_ROLE_BROADCASTER)
|
|
|
|
#error "BLE role 'PERIPHERAL' depends on role 'BROADCASTER'"
|
2019-02-06 12:13:25 +00:00
|
|
|
#endif
|
2019-01-06 18:27:05 +00:00
|
|
|
#endif // BLE_ROLE_PERIPHERAL
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if BLE_ROLE_CENTRAL
|
2019-02-22 17:10:53 +00:00
|
|
|
#if !(BLE_ROLE_OBSERVER)
|
|
|
|
#error "BLE role 'CENTRAL' depends on role 'OBSERVER'"
|
2019-02-06 12:13:25 +00:00
|
|
|
#endif
|
2019-01-06 18:27:05 +00:00
|
|
|
#endif // BLE_ROLE_CENTRAL
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if BLE_FEATURE_SECURITY
|
|
|
|
#if !(BLE_ROLE_PERIPHERAL) && !(BLE_ROLE_CENTRAL)
|
2019-02-06 12:13:25 +00:00
|
|
|
#error "BLE feature 'SECURITY' requires 'PERIPHERAL' or 'CENTRAL' role"
|
|
|
|
#endif
|
|
|
|
#endif // BLE_FEATURE_SECURITY
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if BLE_FEATURE_SECURE_CONNECTIONS
|
|
|
|
#if !(BLE_FEATURE_SECURITY)
|
2019-02-06 12:13:25 +00:00
|
|
|
#error "BLE feature 'SECURE CONNECTIONS' requires the 'SECURITY' feature"
|
|
|
|
#endif
|
|
|
|
#endif // BLE_FEATURE_SECURE_CONNECTIONS
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if BLE_FEATURE_SIGNING
|
|
|
|
#if !(BLE_FEATURE_SECURITY)
|
2019-02-06 12:13:25 +00:00
|
|
|
#error "BLE feature 'SIGNING' requires the 'SECURITY' feature"
|
|
|
|
#endif
|
|
|
|
#endif // BLE_FEATURE_SIGNING
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if BLE_FEATURE_WHITELIST
|
|
|
|
#if !(BLE_FEATURE_SECURITY)
|
2019-02-06 12:13:25 +00:00
|
|
|
#error "BLE feature 'WHITELIST' requires the 'SECURITY' feature"
|
|
|
|
#endif
|
|
|
|
#endif // BLE_FEATURE_WHITELIST
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if BLE_FEATURE_PRIVACY
|
|
|
|
#if !(BLE_FEATURE_SECURITY)
|
2019-02-06 12:13:25 +00:00
|
|
|
#error "BLE feature 'PRIVACY' requires the 'SECURITY' feature"
|
|
|
|
#endif
|
|
|
|
#endif // BLE_FEATURE_PRIVACY
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if BLE_FEATURE_PERIODIC_ADVERTISING
|
|
|
|
#if !(BLE_FEATURE_EXTENDED_ADVERTISING)
|
2019-02-06 12:13:25 +00:00
|
|
|
#error "BLE feature 'PERIODIC ADVERTISING' requires the 'EXTENDED ADVERTISING' feature"
|
|
|
|
#endif
|
|
|
|
#endif // BLE_FEATURE_PERIODIC_ADVERTISING
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if BLE_FEATURE_GATT_CLIENT
|
2019-02-20 18:06:15 +00:00
|
|
|
#if !(BLE_FEATURE_CONNECTABLE)
|
2019-02-06 12:13:25 +00:00
|
|
|
#error "BLE feature 'GATT CLIENT' requires 'PERIPHERAL' or 'CENTRAL' role"
|
|
|
|
#endif
|
|
|
|
#endif // BLE_FEATURE_GATT_CLIENT
|
|
|
|
|
2019-02-06 15:57:16 +00:00
|
|
|
#if BLE_FEATURE_GATT_SERVER
|
2019-02-20 18:06:15 +00:00
|
|
|
#if !(BLE_FEATURE_CONNECTABLE)
|
2019-02-06 12:13:25 +00:00
|
|
|
#error "BLE feature 'GATT SERVER' requires 'PERIPHERAL' or 'CENTRAL' role"
|
|
|
|
#endif
|
|
|
|
#endif // BLE_FEATURE_GATT_SERVER
|
2019-01-06 18:27:05 +00:00
|
|
|
|
|
|
|
#endif // MBED_BLE_ROLES_H__
|