diff --git a/port/arduino/btstack_config.h b/port/arduino/btstack_config.h index d9beabfd5..32507ef97 100644 --- a/port/arduino/btstack_config.h +++ b/port/arduino/btstack_config.h @@ -10,10 +10,11 @@ // BTstack features that can be enabled #define ENABLE_BLE -#define ENABLE_CLASSIC #define ENABLE_LOG_INTO_HCI_DUMP #define ENABLE_LOG_INFO #define ENABLE_LOG_ERROR +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL // BTstack configuration. buffers, sizes, ... #define HCI_ACL_PAYLOAD_SIZE 200 diff --git a/port/ez430-rf2560/btstack_config.h b/port/ez430-rf2560/btstack_config.h index a45fca371..ae2db174b 100644 --- a/port/ez430-rf2560/btstack_config.h +++ b/port/ez430-rf2560/btstack_config.h @@ -11,6 +11,8 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_CLASSIC +#define ENABLE_LE_PERIPHERAL +// #define ENABLE_LE_CENTRAL #define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO diff --git a/port/libusb/btstack_config.h b/port/libusb/btstack_config.h index c424fc133..926acf6cf 100644 --- a/port/libusb/btstack_config.h +++ b/port/libusb/btstack_config.h @@ -14,6 +14,8 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_CLASSIC +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO diff --git a/port/msp-exp430f5438-cc2564b/btstack_config.h b/port/msp-exp430f5438-cc2564b/btstack_config.h index c7383fe10..7165bcd88 100644 --- a/port/msp-exp430f5438-cc2564b/btstack_config.h +++ b/port/msp-exp430f5438-cc2564b/btstack_config.h @@ -11,6 +11,8 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_CLASSIC +#define ENABLE_LE_PERIPHERAL +// #define ENABLE_LE_CENTRAL // #define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO diff --git a/port/msp430f5229lp-cc2564b/btstack_config.h b/port/msp430f5229lp-cc2564b/btstack_config.h index f8bd5b38d..5579f8187 100644 --- a/port/msp430f5229lp-cc2564b/btstack_config.h +++ b/port/msp430f5229lp-cc2564b/btstack_config.h @@ -11,6 +11,8 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_CLASSIC +#define ENABLE_LE_PERIPHERAL +// #define ENABLE_LE_CENTRAL #define ENABLE_LOG_INTO_HCI_DUMP // #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO diff --git a/port/mtk/btstack_config.h b/port/mtk/btstack_config.h index 61ea24a50..ffc5510fe 100644 --- a/port/mtk/btstack_config.h +++ b/port/mtk/btstack_config.h @@ -13,6 +13,8 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_CLASSIC +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO #define ENABLE_LOG_INTO_HCI_DUMP diff --git a/port/nrf5-zephyr/btstack_config.h b/port/nrf5-zephyr/btstack_config.h index 4427c2c07..7e9cda771 100644 --- a/port/nrf5-zephyr/btstack_config.h +++ b/port/nrf5-zephyr/btstack_config.h @@ -9,6 +9,8 @@ // BTstack features that can be enabled #define ENABLE_BLE +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL #define ENABLE_LOG_INFO #define ENABLE_LOG_ERROR diff --git a/port/nrf5x/btstack_config.h b/port/nrf5x/btstack_config.h index d11bbc0fe..68570ee64 100644 --- a/port/nrf5x/btstack_config.h +++ b/port/nrf5x/btstack_config.h @@ -11,6 +11,8 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_CLASSIC +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL #define ENABLE_LOG_INFO #define ENABLE_LOG_ERROR diff --git a/port/pic32-harmony/src/btstack_config.h b/port/pic32-harmony/src/btstack_config.h index 94647ba9c..afdb69c93 100644 --- a/port/pic32-harmony/src/btstack_config.h +++ b/port/pic32-harmony/src/btstack_config.h @@ -12,6 +12,8 @@ #define ENABLE_BLE #define ENABLE_CLASSIC #define ENABLE_LE_SECURE_CONNECTIONS +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL #define ENABLE_LOG_INFO #define ENABLE_LOG_ERROR diff --git a/port/posix-h4/btstack_config.h b/port/posix-h4/btstack_config.h index 2dc6d665c..e8531d822 100644 --- a/port/posix-h4/btstack_config.h +++ b/port/posix-h4/btstack_config.h @@ -14,6 +14,8 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_CLASSIC +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO diff --git a/port/posix-h5/btstack_config.h b/port/posix-h5/btstack_config.h index 260c75bbe..6542908c7 100644 --- a/port/posix-h5/btstack_config.h +++ b/port/posix-h5/btstack_config.h @@ -14,6 +14,8 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_CLASSIC +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO diff --git a/port/stm32-f103rb-nucleo/btstack_config.h b/port/stm32-f103rb-nucleo/btstack_config.h index 42861f2cf..10cf285b3 100644 --- a/port/stm32-f103rb-nucleo/btstack_config.h +++ b/port/stm32-f103rb-nucleo/btstack_config.h @@ -10,6 +10,8 @@ // BTstack features that can be enabled #define ENABLE_BLE +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL #define ENABLE_CLASSIC // #define ENABLE_LOG_INFO // #define ENABLE_LOG_ERROR diff --git a/port/wiced/btstack_config.h b/port/wiced/btstack_config.h index df360ee75..78681dffa 100644 --- a/port/wiced/btstack_config.h +++ b/port/wiced/btstack_config.h @@ -12,6 +12,8 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_CLASSIC +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL // #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR // #define ENABLE_LOG_INFO diff --git a/src/ble/sm.c b/src/ble/sm.c index 40e618d02..d19fd0231 100644 --- a/src/ble/sm.c +++ b/src/ble/sm.c @@ -51,6 +51,10 @@ #include "hci_dump.h" #include "l2cap.h" +#if !defined(ENABLE_LE_PERIPHERAL) && !defined(ENABLE_LE_CENTRAL) +#error "LE Security Manager used, but neither ENABLE_LE_PERIPHERAL nor ENABLE_LE_CENTRAL defined. Please add at least one to btstack_config.h." +#endif + #ifdef ENABLE_LE_SECURE_CONNECTIONS #ifdef HAVE_HCI_CONTROLLER_DHKEY_SUPPORT #error "Support for DHKEY Support in HCI Controller not implemented yet. Please use software implementation"