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

Commit a5468e2c authored by Chris Manton's avatar Chris Manton
Browse files

stack::avct: Add dumpsys

Bug: 375001524
Test: m .
Flag: EXEMPT, Dumpsys logging change

Change-Id: I83dbac8a28123cc549a651c3b7cfe5282576ad97
parent 331c0fb7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@
#include "stack/btm/btm_sco_hfp_hal.h"
#include "stack/connection_manager/connection_manager.h"
#include "stack/include/a2dp_api.h"
#include "stack/include/avct_api.h"
#include "stack/include/avdt_api.h"
#include "stack/include/btm_client_interface.h"
#include "stack/include/btm_status.h"
@@ -886,6 +887,7 @@ static void dump(int fd, const char** arguments) {
  VolumeControl::DebugDump(fd);
  connection_manager::dump(fd);
  bluetooth::bqr::DebugDump(fd);
  AVCT_Dumpsys(fd);
  PAN_Dumpsys(fd);
  DumpsysHid(fd);
  DumpsysBtaDm(fd);
+35 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include "avct_int.h"
#include "bta/include/bta_sec_api.h"
#include "internal_include/bt_target.h"
#include "main/shim/dumpsys.h"
#include "osi/include/allocator.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_psm_types.h"
@@ -434,3 +435,37 @@ uint16_t AVCT_MsgReq(uint8_t handle, uint8_t label, uint8_t cr, BT_HDR* p_msg) {
  }
  return result;
}

#define DUMPSYS_TAG "stack::avct"

void AVCT_Dumpsys(int fd) {
  LOG_DUMPSYS_TITLE(fd, DUMPSYS_TAG);
  for (int i = 0; i < AVCT_NUM_CONN; i++) {
    const tAVCT_CCB& ccb = avct_cb.ccb[i];
    if (!ccb.allocated) {
      continue;
    }
    LOG_DUMPSYS(fd, " Id:%2u profile_uuid:0x%04x role:%s control:0x%2x", i, ccb.cc.pid,
                avct_role_text(ccb.cc.role).c_str(), ccb.cc.control);
    if (ccb.p_lcb) {  // tAVCT_LCB
      LOG_DUMPSYS(fd,
                  "  Link  : peer:%s lcid:0x%04x sm_state:%-24s ch_state:%s conflict_lcid:0x%04x",
                  fmt::format("{}", ccb.p_lcb->peer_addr).c_str(), ccb.p_lcb->ch_lcid,
                  avct_sm_state_text(ccb.p_lcb->state).c_str(),
                  avct_ch_state_text(ccb.p_lcb->ch_state).c_str(), ccb.p_lcb->conflict_lcid);
    } else {
      LOG_DUMPSYS(fd, "  Link  : No link channel");
    }

    if (ccb.p_bcb) {  // tAVCT_BCB
      LOG_DUMPSYS(fd,
                  "  Browse: peer:%s lcid:0x%04x sm_state:%-24s ch_state:%s conflict_lcid:0x%04x",
                  fmt::format("{}", ccb.p_bcb->peer_addr).c_str(), ccb.p_bcb->ch_lcid,
                  avct_sm_state_text(ccb.p_bcb->state).c_str(),
                  avct_ch_state_text(ccb.p_bcb->ch_state).c_str(), ccb.p_bcb->conflict_lcid);
    } else {
      LOG_DUMPSYS(fd, "  Browse: No browse channel");
    }
  }
}
#undef DUMPSYS_TAG
+14 −0
Original line number Diff line number Diff line
@@ -280,4 +280,18 @@ uint16_t AVCT_GetPeerMtu(uint8_t handle);
 ******************************************************************************/
uint16_t AVCT_MsgReq(uint8_t handle, uint8_t label, uint8_t cr, BT_HDR* p_msg);

/*******************************************************************************
**
** Function         AVCT_Dumpsys
**
** Description      This function provides dumpsys data during the dumpsys
**                  procedure.
**
** Parameters:      fd: Descriptor used to write the AVCT internals
**
** Returns          void
**
*******************************************************************************/
void AVCT_Dumpsys(int fd);

#endif /* AVCT_API_H */
+1 −0
Original line number Diff line number Diff line
@@ -56,3 +56,4 @@ uint16_t AVCT_RemoveConn(uint8_t /* handle */) {
}
void AVCT_Deregister(void) { inc_func_call_count(__func__); }
void AVCT_Register() { inc_func_call_count(__func__); }
void AVCT_Dumpsys(int /* fd */) { inc_func_call_count(__func__); }