From 88b174ea62a35c3b87047139bf74c9382744abde Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rymanowski?= Date: Tue, 22 Sep 2020 09:53:16 +0000 Subject: [PATCH] btm: Add API to check peer's 2M PHY support Sponsor: jpawlowski@ Tag: #feature Bug: 150670922 Test: compile Change-Id: I2f0809ba14434d8c4431174aaa67ec01e9ba0788 --- stack/acl/btm_acl.cc | 21 +++++++++++++++++++++ stack/include/btm_api.h | 11 +++++++++++ 2 files changed, 32 insertions(+) diff --git a/stack/acl/btm_acl.cc b/stack/acl/btm_acl.cc index 5e83dda99..8d36aa9ce 100644 --- a/stack/acl/btm_acl.cc +++ b/stack/acl/btm_acl.cc @@ -1205,6 +1205,27 @@ uint16_t BTM_GetHCIConnHandle(const RawAddress& remote_bda, /******************************************************************************* * + * Function BTM_IsPhy2mSupported + * + * Description This function is called to check PHY 2M support + * from peer device + * Returns True when PHY 2M supported false otherwise + * + ******************************************************************************/ +bool BTM_IsPhy2mSupported(const RawAddress& remote_bda, tBT_TRANSPORT transport) { + tACL_CONN* p; + BTM_TRACE_DEBUG("BTM_IsPhy2mSupported"); + p = internal_.btm_bda_to_acl(remote_bda, transport); + if (p == (tACL_CONN*)NULL) { + BTM_TRACE_DEBUG("BTM_IsPhy2mSupported: no connection"); + return false; + } + + return HCI_LE_2M_PHY_SUPPORTED(p->peer_le_features); +} + +/******************************************************************************* + * * Function BTM_RequestPeerSCA * * Description This function is called to request sleep clock accuracy diff --git a/stack/include/btm_api.h b/stack/include/btm_api.h index 920890e08..01edb0f08 100644 --- a/stack/include/btm_api.h +++ b/stack/include/btm_api.h @@ -743,6 +743,17 @@ uint16_t BTM_GetHCIConnHandle(const RawAddress& remote_bda, /******************************************************************************* * + * Function BTM_IsPhy2mSupported + * + * Description This function is called to check PHY 2M support + * from peer device + * Returns True when PHY 2M supported false otherwise + * + ******************************************************************************/ +bool BTM_IsPhy2mSupported(const RawAddress& remote_bda, tBT_TRANSPORT transport); + +/******************************************************************************* + * * Function BTM_RequestPeerSCA * * Description This function is called to request sleep clock accuracy -- 2.11.0