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

Commit b68f783e authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

Dump BTA HH connection control blocks

Test: mmm packages/modules/Bluetooth
Flag: EXEMPT bugfix
Bug: 347241319
Change-Id: I6e951a6bce250fe23cdc1c70b43ad1142d8c0998
parent e9a3bd3d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -348,3 +348,14 @@ void BTA_HhRemoveDev(uint8_t dev_handle) {

  bta_sys_sendmsg(p_buf);
}

/*******************************************************************************
 *
 * Function         BTA_HhDump
 *
 * Description      Dump BTA HH control block
 *
 * Returns          void
 *
 ******************************************************************************/
void BTA_HhDump(int fd) { bta_hh_dump(fd); }
+2 −0
Original line number Diff line number Diff line
@@ -320,6 +320,8 @@ void bta_hh_headtracker_parse_service(tBTA_HH_DEV_CB* p_dev_cb, const gatt::Serv
bool bta_hh_headtracker_supported(tBTA_HH_DEV_CB* p_dev_cb);
uint16_t bta_hh_get_uuid16(tBTA_HH_DEV_CB* p_dev_cb, bluetooth::Uuid uuid);

void bta_hh_dump(int fd);

#if (BTA_HH_DEBUG == TRUE)
void bta_hh_trace_dev_db(void);
#endif
+13 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <cstdint>

#include "bta/hh/bta_hh_int.h"
#include "main/shim/dumpsys.h"
#include "os/log.h"
#include "osi/include/allocator.h"
#include "stack/include/bt_hdr.h"
@@ -425,3 +426,15 @@ bool bta_hh_hdl_event(const BT_HDR_RIGID* p_msg) {

  return true;
}

#define DUMPSYS_TAG "shim::legacy::hid"
void bta_hh_dump(int fd) {
  for (auto dev : bta_hh_cb.kdev) {
    if (dev.in_use) {
      LOG_DUMPSYS(fd, "[%d] Device:%s, handle:%d, state:%s, sub class:%d, ", dev.index,
                  dev.link_spec.ToRedactedStringForLogging().c_str(), dev.hid_handle,
                  bta_hh_state_code(dev.state), dev.sub_class);
    }
  }
}
#undef DUMPSYS_TAG
+8 −11
Original line number Diff line number Diff line
@@ -399,17 +399,14 @@ void bta_hh_cleanup_disable(tBTA_HH_STATUS status) {
 *
 ******************************************************************************/
void bta_hh_trace_dev_db(void) {
  uint8_t xx;

  log::verbose("bta_hh_trace_dev_db:: Device DB list********************");

  for (xx = 0; xx < BTA_HH_MAX_DEVICE; xx++) {
    log::verbose("kdev[{}] in_use[{}]  handle[{}]", xx, bta_hh_cb.kdev[xx].in_use,
                 bta_hh_cb.kdev[xx].hid_handle);

    log::verbose("\t\t\t attr_mask[{:04x}] state [{}] sub_class[{:02x}] index = {}",
                 bta_hh_cb.kdev[xx].attr_mask, bta_hh_cb.kdev[xx].state,
                 bta_hh_cb.kdev[xx].sub_class, bta_hh_cb.kdev[xx].index);
  log::verbose("Device DB list*******************************************");
  for (auto dev : bta_hh_cb.kdev) {
    if (dev.in_use) {
      log::verbose(
              "kdev[{:02x}] handle[{:02x}] attr_mask[{:04x}] sub_class[{:02x}] state [{}] "
              "device[{}] ",
              dev.index, dev.hid_handle, dev.attr_mask, dev.sub_class, dev.state, dev.link_spec);
    }
  }
  log::verbose("*********************************************************");
}
+11 −0
Original line number Diff line number Diff line
@@ -551,6 +551,17 @@ void BTA_HhAddDev(const tAclLinkSpec& link_spec, tBTA_HH_ATTR_MASK attr_mask, ui
 ******************************************************************************/
void BTA_HhRemoveDev(uint8_t dev_handle);

/*******************************************************************************
 *
 * Function         BTA_HhDump
 *
 * Description      Dump BTA HH control block
 *
 * Returns          void
 *
 ******************************************************************************/
void BTA_HhDump(int fd);

namespace fmt {
template <>
struct formatter<tBTA_HH_STATUS> : enum_formatter<tBTA_HH_STATUS> {};
Loading