From e3a23988f6df176b5ca0251a0de25f2d02d1e964 Mon Sep 17 00:00:00 2001 From: Joe Finney Date: Mon, 1 Feb 2016 04:25:51 +0000 Subject: [PATCH] microbit: Promote constants in MicroBitBLEManager to .h file Moved configuration constants from .cpp to .h file, so that they can be reused more easily from other code, such as the broadcast radio code. --- inc/MicroBitBLEManager.h | 5 +++++ source/ble-services/MicroBitBLEManager.cpp | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/inc/MicroBitBLEManager.h b/inc/MicroBitBLEManager.h index 3a897a9..8bac02b 100644 --- a/inc/MicroBitBLEManager.h +++ b/inc/MicroBitBLEManager.h @@ -39,6 +39,11 @@ #define MICROBIT_BLE_PAIR_SUCCESSFUL 0x08 #define MICROBIT_BLE_PAIRING_TIMEOUT 90 +#define MICROBIT_BLE_POWER_LEVELS 8 +#define MICROBIT_BLE_MAXIMUM_BONDS 4 +#define MICROBIT_BLE_ENABLE_BONDING true +#define MICROBIT_BLE_REQUIRE_MITM true +extern const int8_t MICROBIT_BLE_POWER_LEVEL[]; /** * Class definition for the MicroBitBLEManager. diff --git a/source/ble-services/MicroBitBLEManager.cpp b/source/ble-services/MicroBitBLEManager.cpp index 4ebcfa0..de75d0b 100644 --- a/source/ble-services/MicroBitBLEManager.cpp +++ b/source/ble-services/MicroBitBLEManager.cpp @@ -21,13 +21,7 @@ #pragma GCC diagnostic pop #endif -#define MICROBIT_BLE_ENABLE_BONDING true -#define MICROBIT_BLE_REQUIRE_MITM true - #define MICROBIT_PAIRING_FADE_SPEED 4 -#define MICROBIT_BLE_POWER_LEVELS 8 -#define MICROBIT_BLE_MAXIMUM_BONDS 4 - const char* MICROBIT_BLE_MANUFACTURER = "The Cast of W1A"; const char* MICROBIT_BLE_MODEL = "BBC micro:bit";