Skip to content

Commit 1489900

Browse files
author
Cruz Monrreal
authored
Merge pull request #8556 from paul-szczepanek-arm/fix-phy-support
BLE: fix using an optional feature before checking for support
2 parents ec362c5 + b77bd22 commit 1489900

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,12 @@ ble_error_t Gap::set_address_resolution(
334334
}
335335

336336
ble_error_t Gap::read_phy(connection_handle_t connection) {
337-
DmReadPhy(connection);
338-
return BLE_ERROR_NONE;
337+
if (is_feature_supported(ControllerSupportedFeatures_t::LE_2M_PHY)
338+
|| is_feature_supported(ControllerSupportedFeatures_t::LE_CODED_PHY)) {
339+
DmReadPhy(connection);
340+
return BLE_ERROR_NONE;
341+
}
342+
return BLE_ERROR_NOT_IMPLEMENTED;
339343
}
340344

341345
ble_error_t Gap::set_preferred_phys(

0 commit comments

Comments
 (0)