From b77bd223d798e7774caad0809ba9f5ee584843e4 Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Fri, 26 Oct 2018 12:53:39 +0100 Subject: [PATCH] check for feature before using --- .../targets/TARGET_CORDIO/source/CordioPalGap.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp index 7fca33e470..ed14d1920d 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp @@ -334,8 +334,12 @@ ble_error_t Gap::set_address_resolution( } ble_error_t Gap::read_phy(connection_handle_t connection) { - DmReadPhy(connection); - return BLE_ERROR_NONE; + if (is_feature_supported(ControllerSupportedFeatures_t::LE_2M_PHY) + || is_feature_supported(ControllerSupportedFeatures_t::LE_CODED_PHY)) { + DmReadPhy(connection); + return BLE_ERROR_NONE; + } + return BLE_ERROR_NOT_IMPLEMENTED; } ble_error_t Gap::set_preferred_phys(