OSDN Git Service

Re-log stack/btm/btm_ble::BTM_SetBleDataLength
authorChris Manton <cmanton@google.com>
Wed, 23 Sep 2020 15:50:18 +0000 (08:50 -0700)
committerChris Manton <cmanton@google.com>
Thu, 8 Oct 2020 06:08:35 +0000 (06:08 +0000)
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

index 037f385..5cb4514 100644 (file)
@@ -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;
   }