Skip to content

Commit a802044

Browse files
author
Chris Manton
committed
btm_history: Log start and stop le advertising
Bug: 188074901 Tag: #refactor Test: gd/cert/run Change-Id: Ifc7d6e2eee27e4d15acf34318c8d3b883d85d72d
1 parent d89db02 commit a802044

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

system/main/shim/le_advertising_manager.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "le_advertising_manager.h"
2020

21+
#include <base/logging.h>
2122
#include <hardware/bluetooth.h>
2223
#include <hardware/bt_gatt.h>
2324

@@ -34,17 +35,20 @@
3435
#include "main/shim/helpers.h"
3536
#include "stack/include/ble_advertiser.h"
3637
#include "stack/include/btm_api.h"
38+
#include "stack/include/btm_log_history.h"
3739
#include "types/raw_address.h"
3840

39-
#include <base/logging.h>
40-
4141
using bluetooth::hci::Address;
4242
using bluetooth::hci::AddressType;
4343
using bluetooth::hci::ErrorCode;
4444
using bluetooth::hci::GapData;
4545
using bluetooth::hci::OwnAddressType;
4646
using std::vector;
4747

48+
namespace {
49+
constexpr char kBtmLogTag[] = "ADV";
50+
}
51+
4852
class BleAdvertiserInterfaceImpl : public BleAdvertiserInterface,
4953
public bluetooth::hci::AdvertisingCallback {
5054
public:
@@ -63,6 +67,8 @@ class BleAdvertiserInterfaceImpl : public BleAdvertiserInterface,
6367
void Unregister(uint8_t advertiser_id) override {
6468
LOG(INFO) << __func__ << " in shim layer";
6569
bluetooth::shim::GetAdvertising()->RemoveAdvertiser(advertiser_id);
70+
BTM_LogHistory(kBtmLogTag, RawAddress::kEmpty, "Le advert stopped",
71+
base::StringPrintf("advert_id:%d", advertiser_id));
6672
}
6773

6874
void GetOwnAddress(uint8_t advertiser_id, GetAddressCallback cb) override {
@@ -187,6 +193,9 @@ class BleAdvertiserInterfaceImpl : public BleAdvertiserInterface,
187193

188194
LOG(INFO) << "create advertising set, reg_id:" << reg_id
189195
<< ", id:" << (uint16_t)id;
196+
197+
BTM_LogHistory(kBtmLogTag, RawAddress::kEmpty, "Le advert started",
198+
base::StringPrintf("advert_id:%d", reg_id));
190199
}
191200

192201
void SetPeriodicAdvertisingParameters(

0 commit comments

Comments
 (0)