From 8e7936d327b547b4ff684d4ab684afeeb775faae Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Wed, 13 Jun 2018 15:02:07 +0100 Subject: [PATCH] Nordic BLE: Improve return of nRF5xn::getGap. Return the derived type instead of the abstract one. This is legal as C++ supports covariant returns. --- .../targets/TARGET_NORDIC/TARGET_NRF51/source/nRF5xn.h | 2 +- .../targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xn.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source/nRF5xn.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source/nRF5xn.h index 8829d72347..18b76b405c 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source/nRF5xn.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source/nRF5xn.h @@ -55,7 +55,7 @@ public: * always needed in a BLE application. Therefore it is allocated * statically. */ - virtual Gap &getGap() { + virtual nRF5xGap &getGap() { return gapInstance; }; diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xn.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xn.h index 38ee87ec8e..7d6c4c3522 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xn.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xn.h @@ -54,7 +54,7 @@ public: * always needed in a BLE application. Therefore it is allocated * statically. */ - virtual Gap &getGap() { + virtual nRF5xGap &getGap() { return gapInstance; };