From 2245b6082f8510de046635a4678e6580abd199bb Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Wed, 23 Sep 2020 08:50:18 -0700 Subject: [PATCH] Re-log stack/btm/btm_ble::BTM_SetBleDataLength Towards loggable code Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Test: act.py -tc BleCocTest Change-Id: I87148e3c932c671111f5a61f3a178275e9d86804 --- stack/btm/btm_ble.cc | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/stack/btm/btm_ble.cc b/stack/btm/btm_ble.cc index 037f3851a..5cb451499 100644 --- a/stack/btm/btm_ble.cc +++ b/stack/btm/btm_ble.cc @@ -667,15 +667,6 @@ bool BTM_UseLeLink(const RawAddress& bd_addr) { return (dev_type == BT_DEVICE_TYPE_BLE); } -/******************************************************************************* - * - * Function BTM_SetBleDataLength - * - * Description This function is to set maximum BLE transmission packet size - * - * Returns BTM_SUCCESS if success; otherwise failed. - * - ******************************************************************************/ tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr, uint16_t tx_pdu_length) { if (bluetooth::shim::is_gd_shim_enabled()) { @@ -684,22 +675,20 @@ tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr, uint16_t tx_time = BTM_BLE_DATA_TX_TIME_MAX_LEGACY; if (!BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE)) { - BTM_TRACE_ERROR("%s: Wrong mode: no LE link exist or LE not supported", - __func__); + LOG_INFO( + "Unable to set data length because no le acl link connected to device"); return BTM_WRONG_MODE; } - BTM_TRACE_DEBUG("%s: tx_pdu_length =%d", __func__, tx_pdu_length); - if (!controller_get_interface()->supports_ble_packet_extension()) { - BTM_TRACE_ERROR("%s failed, request not supported", __func__); + LOG_INFO("Local controller unable to support le packet extension"); return BTM_ILLEGAL_VALUE; } uint16_t hci_handle = acl_get_hci_handle_for_hcif(bd_addr, BT_TRANSPORT_LE); if (!acl_peer_supports_ble_packet_extension(hci_handle)) { - BTM_TRACE_ERROR("%s failed, peer does not support request", __func__); + LOG_INFO("Remote device unable to support le packet extension"); return BTM_ILLEGAL_VALUE; } -- 2.11.0