diff options
author | Subramanian Srinivasan <quic_subrsrin@quicinc.com> | 2023-04-03 02:31:14 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2023-04-03 17:05:07 -0700 |
commit | b3ad55a7775f875078f28024049c2a7427916bd1 (patch) | |
tree | 5c80fb07ce11cc9d244676f51c367797a9b93fb6 | |
parent | f20503c97e19542e15f2e94b0d4fc21fed70dfa1 (diff) |
Read Client features only when remote BT version is 5.1 or above
After LE connection is established, read of Client
supported features characteristic for Robust caching
support is performed by stack. Some remote devices
which do not suport Robust caching do not respond
to this read by UUID procedure and this leads to LE
disconnection due to GATT response timeout.
Hence for interoperability, read of Client supported
features characteristic is initiated by stack only
when remote version is BT 5.1 or above.
CRs-Fixed: 3430416
Change-Id: Ia647eb54670e9cd4ab279c976631e089a8f115a9
-rw-r--r-- | stack/btm/btm_acl.cc | 15 | ||||
-rw-r--r-- | stack/gatt/gatt_main.cc | 17 |
2 files changed, 15 insertions, 17 deletions
diff --git a/stack/btm/btm_acl.cc b/stack/btm/btm_acl.cc index eb8b530ce..4462dd6a1 100644 --- a/stack/btm/btm_acl.cc +++ b/stack/btm/btm_acl.cc @@ -58,6 +58,7 @@ #include "controller.h" #include <btcommon_interface_defs.h> #include "btif/include/btif_config.h" +#include "stack/gatt/gatt_int.h" static void btm_read_remote_features(uint16_t handle); static void btm_read_remote_ext_features(uint16_t handle, uint8_t page_number); @@ -1050,6 +1051,20 @@ void btm_read_remote_version_complete(uint8_t* p) { if (p_acl_cb->transport == BT_TRANSPORT_LE) { l2cble_notify_le_connection(p_acl_cb->remote_addr); btm_use_preferred_conn_params(p_acl_cb->remote_addr); + if ((p_acl_cb->lmp_version >= HCI_PROTO_VERSION_5_1) + && gatt_is_robust_caching_enabled()) { + bool skip_caching_enable = false; + BD_NAME bd_name; + if (BTM_GetRemoteDeviceName(p_acl_cb->remote_addr, bd_name)) { + if (interop_database_match_name(INTEROP_SKIP_ROBUST_CACHING_READ, (char*) bd_name)) { + skip_caching_enable = true; + } + } + VLOG(1) << __func__ << " skip_caching_enable:" << +skip_caching_enable; + if (!skip_caching_enable) { + GATT_EnableRobustCaching(p_acl_cb->remote_addr, BT_TRANSPORT_LE); + } + } } VLOG(2) << __func__ << " btm_read_remote_version_complete: BDA: " << p_acl_cb->remote_addr; BTM_TRACE_WARNING ("btm_read_remote_version_complete lmp_version %d manufacturer %d lmp_subversion %d", diff --git a/stack/gatt/gatt_main.cc b/stack/gatt/gatt_main.cc index a3fa189c2..71880b787 100644 --- a/stack/gatt/gatt_main.cc +++ b/stack/gatt/gatt_main.cc @@ -721,23 +721,6 @@ static void gatt_le_connect_cback(uint16_t chan, const RawAddress& bd_addr, } } - if (gatt_is_robust_caching_enabled()) { - bool skip_caching_enable = false; - BD_NAME bd_name; - VLOG(1) << StringPrintf("[%s] BTM_GetRemoteDeviceName: %s", __func__, bd_addr.ToString().c_str()); - if (BTM_GetRemoteDeviceName(bd_addr, bd_name)) { - VLOG(1) << StringPrintf("[%s] FileDB Device name: %s", __func__, bd_name); - if (interop_database_match_name(INTEROP_SKIP_ROBUST_CACHING_READ, (char*) bd_name)) { - VLOG(1) << StringPrintf("[%s] Skip GATT_EnableRobustCaching", __func__); - skip_caching_enable = true; - } - } - VLOG(1) << StringPrintf("[%s] skip_caching_enable: %d", __func__, skip_caching_enable); - if (!skip_caching_enable) { - GATT_EnableRobustCaching(bd_addr, BT_TRANSPORT_LE); - } - } - } /** This function is called to process the congestion callback from lcb */ |