diff options
author | Sven Gothel <[email protected]> | 2021-09-24 12:59:13 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-09-24 12:59:13 +0200 |
commit | 61bfb0757a1c337eaf86f9df8b0524bec1b7bc0f (patch) | |
tree | 55e81117467e342ba7c6ef7d7b6beb3a43b01655 /api/direct_bt/HCIHandler.hpp | |
parent | 61108682ad95d12f66cc5ee6cca89a5bbf99c5fa (diff) |
HCIHandler/BTAdapter/BTDevice: Add le_set[_default]_phy(..) / set[Connected|Default]LE_PHY(..)
Note that the HCIHandler methods validate if LE_Features if host do support LE_2M.
le_set*_phy(): Missing LE_2M support causes command to fail early w/o issuing it.
le_read_phy(): Missing LE_2M support causes command to return LE_1M here.
+++
Also remove 'TODO' re scanning PHY, since we shall simply stick with LE_1M band for compatibility.
Connection itself may use the fast LE_2M or long range LE_CODED band.
Diffstat (limited to 'api/direct_bt/HCIHandler.hpp')
-rw-r--r-- | api/direct_bt/HCIHandler.hpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/api/direct_bt/HCIHandler.hpp b/api/direct_bt/HCIHandler.hpp index daec62e5..9341270a 100644 --- a/api/direct_bt/HCIHandler.hpp +++ b/api/direct_bt/HCIHandler.hpp @@ -682,6 +682,10 @@ namespace direct_bt { * <pre> * BT Core Spec v5.2: Vol 4, Part E, 7.8.47 LE Read PHY command * </pre> + * + * Controller shall send a pending HCIMetaEventType::LE_PHY_UPDATE_COMPLETE event with SUCCESS + * after issuing this command in all cases (change or unchanged PHYs). + * * @param conn_handle * @param addressAndType * @param resTx reference for the resulting transmitter LE_PHYs bit @@ -692,6 +696,41 @@ namespace direct_bt { HCIStatusCode le_read_phy(const uint16_t conn_handle, const BDAddressAndType& peerAddressAndType, LE_PHYs& resTx, LE_PHYs& resRx) noexcept; + + /** + * Sets default preference of used LE_PHYs for all subsequent LE connections. + * + * BT Core Spec v5.2: Vol 4, Part E, 7.8.48 LE Set Default PHY command + * + * @param tryTx if true, host has preference for given Tx LE_PHYs + * @param tryRx if true, host has preference for given Rx LE_PHYs + * @param Tx transmitter LE_PHYs of preference if tryTx is true, otherwise ignored + * @param Rx receiver LE_PHYs of preference if tryRx is true, otherwise ignored + * @return + * @since 2.4.0 + */ + HCIStatusCode le_set_default_phy(const bool tryTx, const bool tryRx, + const LE_PHYs Tx, const LE_PHYs Rx) noexcept; + + /** + * Sets preference of used LE_PHYs for the given connection. + * + * - BT Core Spec v5.2: Vol 4, Part E, 7.8.49 LE Set PHY command + * - BT Core Spec v5.2: Vol 4, Part E, 7.7.65.12 LE PHY Update Complete event + * + * @param conn_handle + * @param peerAddressAndType + * @param tryTx if true, host has preference for given Tx LE_PHYs + * @param tryRx if true, host has preference for given Rx LE_PHYs + * @param Tx transmitter LE_PHYs of preference if tryTx is true, otherwise ignored + * @param Rx receiver LE_PHYs of preference if tryRx is true, otherwise ignored + * @return + * @since 2.4.0 + */ + HCIStatusCode le_set_phy(const uint16_t conn_handle, const BDAddressAndType& peerAddressAndType, + const bool tryTx, const bool tryRx, + const LE_PHYs Tx, const LE_PHYs Rx) noexcept; + private: /** * Sets LE advertising parameters. |