OSDN Git Service

btm: Indicate scan start/stop
authorChris Manton <cmanton@google.com>
Wed, 25 Nov 2020 04:14:57 +0000 (20:14 -0800)
committerChris Manton <cmanton@google.com>
Wed, 2 Dec 2020 16:37:25 +0000 (08:37 -0800)
Toward loggable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: Icf1a6f564dc07bf2a530b663f69dcd019bca8903

stack/btm/btm_inq.cc

index 017f5b0..9f44be8 100644 (file)
@@ -25,7 +25,8 @@
  *
  ******************************************************************************/
 
-#include <log/log.h>
+#define LOG_TAG "bluetooth"
+
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -33,6 +34,7 @@
 
 #include "common/time_util.h"
 #include "device/include/controller.h"
+#include "osi/include/log.h"
 #include "osi/include/osi.h"
 
 #include "advertise_data_parser.h"
@@ -425,6 +427,8 @@ void BTM_CancelInquiry(void) {
     return;
   }
 
+  btm_cb.history_->Push("%-32s", "Inquiry scan stopped");
+
   tBTM_INQUIRY_VAR_ST* p_inq = &btm_cb.btm_inq_vars;
   BTM_TRACE_API("BTM_CancelInquiry called");
 
@@ -505,6 +509,8 @@ tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
     return BTM_WRONG_MODE;
   }
 
+  btm_cb.history_->Push("%-32s", "Inquiry scan started");
+
   /* Save the inquiry parameters to be used upon the completion of
    * setting/clearing the inquiry filter */
   p_inq->inqparms = {};