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

Commit 908ee1ca authored by Chris Manton's avatar Chris Manton
Browse files

Add stack/btm/btm_main::BTM_LogHistory

Expand to allow any module to partake

Towards dumpable code

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

Change-Id: I3e587c191e93ba0cbee96a2e0f9cb4c6514033ca
parent 26762616
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@
#include "bt_target.h"
#include "bt_target.h"
#include "bt_types.h"
#include "bt_types.h"
#include "btm_int.h"
#include "btm_int.h"
#include "main/shim/dumpsys.h"
#include "stack/btm/btm_int_types.h"
#include "stack/btm/btm_int_types.h"
#include "stack_config.h"
#include "stack_config.h"


@@ -80,3 +81,19 @@ void btm_free(void) {


  btm_cb.Free();
  btm_cb.Free();
}
}

constexpr size_t kMaxLogHistoryTagLength = 6;
constexpr size_t kMaxLogHistoryMsgLength = 25;

void BTM_LogHistory(const std::string& tag, const RawAddress& bd_addr,
                    const std::string& msg, const std::string& extra) {
  btm_cb.history_->Push("%-6s %-25s: %s %s",
                        tag.substr(0, kMaxLogHistoryTagLength).c_str(),
                        msg.substr(0, kMaxLogHistoryMsgLength).c_str(),
                        PRIVATE_ADDRESS(bd_addr), extra.c_str());
}

void BTM_LogHistory(const std::string& tag, const RawAddress& bd_addr,
                    const std::string& msg) {
  BTM_LogHistory(tag, bd_addr, msg, std::string());
}
+5 −0
Original line number Original line Diff line number Diff line
@@ -943,4 +943,9 @@ uint16_t BTM_GetMaxPacketSize(const RawAddress& addr);
extern tBTM_STATUS BTM_BT_Quality_Report_VSE_Register(
extern tBTM_STATUS BTM_BT_Quality_Report_VSE_Register(
    bool is_register, tBTM_BT_QUALITY_REPORT_RECEIVER* p_bqr_report_receiver);
    bool is_register, tBTM_BT_QUALITY_REPORT_RECEIVER* p_bqr_report_receiver);


void BTM_LogHistory(const std::string& tag, const RawAddress& addr,
                    const std::string& msg);
void BTM_LogHistory(const std::string& tag, const RawAddress& addr,
                    const std::string& msg, const std::string& extra);

#endif /* BTM_API_H */
#endif /* BTM_API_H */