system/bt
Revision | a2bb603ac61fa5ba66b4219c95f252519b2235b9 (tree) |
---|---|
Time | 2019-07-10 11:07:39 |
Author | weichinweng <weichinweng@goog...> |
Commiter | Ugo Yu |
Hearing Aid: set BLE phy to 2M if local and peer indicate PHY 2M support
Set the BLE phy to 2M if the BT controller and peer Hearing Aid device
indicate phy 2M support, otherwise, use default phy channel.
Bug: 135769508
Test: 1.Forget/Repair Hearing Aid device check whether phy is expected.
2.Disconnect/Reconnect Hearing Aid device check whether phy is expected.
3.HearingAid device power off/on, check whether phy is expected.
Change-Id: Ib410a8885f3a68c361bb97d5c9a3833f2a1be528
Merged-In: Ib410a8885f3a68c361bb97d5c9a3833f2a1be528
(cherry picked from commit 554c3598db5661ac0166eb12006d248a38723db1)
@@ -390,6 +390,13 @@ class HearingAidImpl : public HearingAid { | ||
390 | 390 | hearingDevice->connection_update_status = AWAITING; |
391 | 391 | } |
392 | 392 | |
393 | + tACL_CONN* p_acl = btm_bda_to_acl(address, BT_TRANSPORT_LE); | |
394 | + if (p_acl != nullptr && controller_get_interface()->supports_ble_2m_phy() && | |
395 | + HCI_LE_2M_PHY_SUPPORTED(p_acl->peer_le_features)) { | |
396 | + LOG(INFO) << address << " set preferred PHY to 2M"; | |
397 | + BTM_BleSetPhy(address, PHY_LE_2M, PHY_LE_2M, 0); | |
398 | + } | |
399 | + | |
393 | 400 | // Set data length |
394 | 401 | // TODO(jpawlowski: for 16khz only 87 is required, optimize |
395 | 402 | BTM_SetBleDataLength(address, 167); |