Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 490235b0 authored by Chris Manton's avatar Chris Manton
Browse files

Land btm control block history

Towards loggable code

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

Change-Id: I2ac68e3096000f77fba83cc378484e6afb7e190b
parent 69c68df9
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -22,10 +22,12 @@
 *
 ******************************************************************************/

#include <string.h>
#include <memory>
#include <string>
#include "bt_target.h"
#include "bt_types.h"
#include "btm_int.h"
#include "stack/btm/btm_int_types.h"
#include "stack_config.h"

/* Global BTM control block structure
@@ -63,10 +65,16 @@ void btm_init(void) {
  btm_sco_init(); /* SCO Database and Structures (If included) */

  btm_dev_init(); /* Device Manager Structures & HCI_Reset */

  btm_cb.history_ = std::make_shared<TimestampedStringCircularBuffer>(40);
  CHECK(btm_cb.history_ != nullptr);
  btm_cb.history_->Push(std::string("Initialized btm history"));
}

/** This function is called to free dynamic memory and system resource allocated by btm_init */
void btm_free(void) {
  btm_cb.history_.reset();

  btm_dev_free();
  btm_inq_db_free();