diff --git a/features/FEATURE_BLE/ble/BLETypes.h b/features/FEATURE_BLE/ble/BLETypes.h index b4e8d5a3ae..0aed57d9c0 100644 --- a/features/FEATURE_BLE/ble/BLETypes.h +++ b/features/FEATURE_BLE/ble/BLETypes.h @@ -668,26 +668,6 @@ public: set_coded(phy_coded); } - /** - * Create an ALL_PHYS parameter used in LE Set PHY Command - * and LE Set Default PHY Command. - * @see BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E - 7.8.49 - */ - static uint8_t all_phys_value( - const phy_set_t& tx_phys, - const phy_set_t& rx_phys - ) { - /* if phy set is empty set corresponding all_phys bit to 1 */ - uint8_t all_phys = 0; - if (tx_phys.value() == 0) { - all_phys |= 0x01; - } - if (rx_phys.value() == 0) { - all_phys |= 0x02; - } - return all_phys; - } - /** Prefer 1M PHY. */ void set_1m(bool enabled = true) { if (enabled) { diff --git a/features/FEATURE_BLE/ble/pal/PalGap.h b/features/FEATURE_BLE/ble/pal/PalGap.h index 14fd51112e..a32b0ebbf8 100644 --- a/features/FEATURE_BLE/ble/pal/PalGap.h +++ b/features/FEATURE_BLE/ble/pal/PalGap.h @@ -802,6 +802,27 @@ protected: } } +public: + /** + * Create an ALL_PHYS parameter used in LE Set PHY Command + * and LE Set Default PHY Command. + * @see BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E - 7.8.49 + */ + static uint8_t create_all_phys_value( + const phy_set_t& tx_phys, + const phy_set_t& rx_phys + ) { + /* if phy set is empty set corresponding all_phys bit to 1 */ + uint8_t all_phys = 0; + if (tx_phys.value() == 0) { + all_phys |= 0x01; + } + if (rx_phys.value() == 0) { + all_phys |= 0x02; + } + return all_phys; + } + private: /** * Callback called when an event is emitted by the LE subsystem. diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp index b8a33f72b3..7fca33e470 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.cpp @@ -343,7 +343,7 @@ ble_error_t Gap::set_preferred_phys( const phy_set_t& rx_phys ) { DmSetDefaultPhy( - phy_set_t::all_phys_value(tx_phys, rx_phys), + create_all_phys_value(tx_phys, rx_phys), tx_phys.value(), rx_phys.value() ); @@ -368,7 +368,7 @@ ble_error_t Gap::set_phy( DmSetPhy( connection, - phy_set_t::all_phys_value(tx_phys, rx_phys), + create_all_phys_value(tx_phys, rx_phys), tx_phys.value(), rx_phys.value(), coded_symbol.value()