OSDN Git Service

Re-log stack/gatt/gatt_api::GATT_Connect
authorChris Manton <cmanton@google.com>
Thu, 29 Oct 2020 05:46:51 +0000 (22:46 -0700)
committerChris Manton <cmanton@google.com>
Fri, 30 Oct 2020 04:52:50 +0000 (04:52 +0000)
Towards loggable code

Bug: 163134718
Tag: #refactor
Test: acts/bin/act.py -tp ~/Goog/tools/test/connectivity -tc BleCocTest

Change-Id: Ic33a2f3a2c0fb30aa2404186773257b7511eacd3

stack/gatt/gatt_api.cc

index 69812d2..6eb1030 100644 (file)
@@ -1133,9 +1133,6 @@ bool GATT_Connect(tGATT_IF gatt_if, const RawAddress& bd_addr, bool is_direct,
 bool GATT_Connect(tGATT_IF gatt_if, const RawAddress& bd_addr, bool is_direct,
                   tBT_TRANSPORT transport, bool opportunistic,
                   uint8_t initiating_phys) {
-  LOG(INFO) << __func__ << ": gatt_if=" << +gatt_if << ", address=" << bd_addr
-            << " is_direct=" << std::boolalpha << is_direct << std::noboolalpha;
-
   /* Make sure app is registered */
   tGATT_REG* p_reg = gatt_get_regcb(gatt_if);
   if (!p_reg) {
@@ -1160,8 +1157,12 @@ bool GATT_Connect(tGATT_IF gatt_if, const RawAddress& bd_addr, bool is_direct,
 
   bool ret;
   if (is_direct) {
+    LOG_DEBUG("Starting direct connect gatt_if=%u address=%s", gatt_if,
+              bd_addr.ToString().c_str());
     ret = gatt_act_connect(p_reg, bd_addr, transport, initiating_phys);
   } else {
+    LOG_DEBUG("Starting background connect gatt_if=%u address=%s", gatt_if,
+              bd_addr.ToString().c_str());
     if (!BTM_BackgroundConnectAddressKnown(bd_addr)) {
       //  RPA can rotate, causing address to "expire" in the background
       //  connection list. RPA is allowed for direct connect, as such request