From dc1d7893c4d39399c5b62a2332b6efa72d5f969c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Brucker Date: Mon, 24 Aug 2015 17:49:45 +0100 Subject: [PATCH] Update S110 detection macros Those macros are defined by mbed SDK in targets.py. They changed from MCU_NORDIC_xxx_S110 to MCU_NRF51_xxx_S110. Update the #ifdefs accordingly. --- source/btle/btle.cpp | 4 ++-- source/btle/btle_discovery.cpp | 2 +- source/nRF5xGap.h | 2 +- source/nRF5xGattClient.cpp | 2 +- source/nRF5xGattClient.h | 2 +- .../nordic-sdk/components/softdevice/s130/include/ble_gap.h | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/btle/btle.cpp b/source/btle/btle.cpp index b6088d7..cb6e454 100644 --- a/source/btle/btle.cpp +++ b/source/btle/btle.cpp @@ -133,7 +133,7 @@ static void btle_handler(ble_evt_t *p_ble_evt) dm_ble_evt_handler(p_ble_evt); -#if !defined(MCU_NORDIC_16K_S110) && !defined(MCU_NORDIC_32K_S110) +#if !defined(MCU_NRF51_16K_S110) && !defined(MCU_NRF51_32K_S110) bleGattcEventHandler(p_ble_evt); #endif @@ -141,7 +141,7 @@ static void btle_handler(ble_evt_t *p_ble_evt) switch (p_ble_evt->header.evt_id) { case BLE_GAP_EVT_CONNECTED: { Gap::Handle_t handle = p_ble_evt->evt.gap_evt.conn_handle; -#if defined(MCU_NORDIC_16K_S110) || defined(MCU_NORDIC_32K_S110) +#if defined(MCU_NRF51_16K_S110) || defined(MCU_NRF51_32K_S110) /* Only peripheral role is supported by S110 */ Gap::Role_t role = Gap::PERIPHERAL; #else diff --git a/source/btle/btle_discovery.cpp b/source/btle/btle_discovery.cpp index 6861a3d..d737f94 100644 --- a/source/btle/btle_discovery.cpp +++ b/source/btle/btle_discovery.cpp @@ -17,7 +17,7 @@ #include "nRF5xServiceDiscovery.h" #include "nRF5xGattClient.h" -#if !defined(MCU_NORDIC_16K_S110) && !defined(MCU_NORDIC_32K_S110) +#if !defined(MCU_NRF51_16K_S110) && !defined(MCU_NRF51_32K_S110) void bleGattcEventHandler(const ble_evt_t *p_ble_evt) { nRF5xServiceDiscovery &sdSingleton = nRF5xGattClient::getInstance().discovery; diff --git a/source/nRF5xGap.h b/source/nRF5xGap.h index 91d4500..b272604 100644 --- a/source/nRF5xGap.h +++ b/source/nRF5xGap.h @@ -81,7 +81,7 @@ public: } /* Observer role is not supported by S110, return BLE_ERROR_NOT_IMPLEMENTED */ -#if !defined(MCU_NORDIC_16K_S110) && !defined(MCU_NORDIC_32K_S110) +#if !defined(MCU_NRF51_16K_S110) && !defined(MCU_NRF51_32K_S110) virtual ble_error_t startRadioScan(const GapScanningParams &scanningParams) { ble_gap_scan_params_t scanParams = { .active = scanningParams.getActiveScanning(), /**< If 1, perform active scanning (scan requests). */ diff --git a/source/nRF5xGattClient.cpp b/source/nRF5xGattClient.cpp index ef39d2d..b29a4f3 100644 --- a/source/nRF5xGattClient.cpp +++ b/source/nRF5xGattClient.cpp @@ -22,7 +22,7 @@ nRF5xGattClient::getInstance(void) { return nRFGattClientSingleton; } -#if !defined(MCU_NORDIC_16K_S110) && !defined(MCU_NORDIC_32K_S110) +#if !defined(MCU_NRF51_16K_S110) && !defined(MCU_NRF51_32K_S110) ble_error_t nRF5xGattClient::launchServiceDiscovery(Gap::Handle_t connectionHandle, ServiceDiscovery::ServiceCallback_t sc, diff --git a/source/nRF5xGattClient.h b/source/nRF5xGattClient.h index cd06811..b8764f6 100644 --- a/source/nRF5xGattClient.h +++ b/source/nRF5xGattClient.h @@ -29,7 +29,7 @@ public: * When using S110, all Gatt client features will return * BLE_ERROR_NOT_IMPLEMENTED */ -#if !defined(MCU_NORDIC_16K_S110) && !defined(MCU_NORDIC_32K_S110) +#if !defined(MCU_NRF51_16K_S110) && !defined(MCU_NRF51_32K_S110) /** * Launch service discovery. Once launched, service discovery will remain diff --git a/source/nordic-sdk/components/softdevice/s130/include/ble_gap.h b/source/nordic-sdk/components/softdevice/s130/include/ble_gap.h index d562c62..a41f655 100644 --- a/source/nordic-sdk/components/softdevice/s130/include/ble_gap.h +++ b/source/nordic-sdk/components/softdevice/s130/include/ble_gap.h @@ -547,7 +547,7 @@ typedef struct { ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. */ ble_gap_addr_t own_addr; /**< Bluetooth address of the local device used during connection setup. */ -#if !defined(MCU_NORDIC_16K_S110) && !defined(MCU_NORDIC_32K_S110) +#if !defined(MCU_NRF51_16K_S110) && !defined(MCU_NRF51_32K_S110) uint8_t role; /**< BLE role for this connection, see @ref BLE_GAP_ROLES */ #endif uint8_t irk_match :1; /**< If 1, peer device's address resolved using an IRK. */