}
void bta_debug_av_dump(int fd) {
+ if (appl_trace_level < BT_TRACE_LEVEL_DEBUG) return;
+
dprintf(fd, "\nBTA AV State:\n");
dprintf(fd, " State Machine State: %s\n", bta_av_st_code(bta_av_cb.state));
dprintf(fd, " Link signalling timer: %s\n",
for (size_t i = 0; i < sizeof(bta_av_cb.lcb) / sizeof(bta_av_cb.lcb[0]);
i++) {
const tBTA_AV_LCB& lcb = bta_av_cb.lcb[i];
+ if (lcb.addr.IsEmpty()) {
+ continue;
+ }
dprintf(fd, "\n Link control block: %zu peer: %s\n", i,
lcb.addr.ToString().c_str());
dprintf(fd, " Connected stream handle mask: 0x%x\n", lcb.conn_msk);
if (p_scb == nullptr) {
continue;
}
+ if (p_scb->PeerAddress().IsEmpty()) {
+ continue;
+ }
dprintf(fd, "\n BTA ID: %zu peer: %s\n", i,
p_scb->PeerAddress().ToString().c_str());
dprintf(fd, " SDP discovery started: %s\n",
p_scb->sdp_discovery_started ? "true" : "false");
for (size_t j = 0; j < BTAV_A2DP_CODEC_INDEX_MAX; j++) {
const tBTA_AV_SEP& sep = p_scb->seps[j];
+ if (sep.av_handle == 0) {
+ continue;
+ }
dprintf(fd, " SEP ID: %zu\n", j);
dprintf(fd, " SEP AVDTP handle: %d\n", sep.av_handle);
dprintf(fd, " Local SEP type: %d\n", sep.tsep);
// Nothing to do (for now)
return true;
}
+
void BtaAvCo::DebugDump(int fd) {
std::lock_guard<std::recursive_mutex> lock(codec_lock_);
- dprintf(fd, "\nA2DP Codecs and Peers State:\n");
+ //
+ // Active peer codec-specific stats
+ //
+ if (active_peer_ != nullptr) {
+ A2dpCodecs* a2dp_codecs = active_peer_->GetCodecs();
+ if (a2dp_codecs != nullptr) {
+ a2dp_codecs->debug_codec_dump(fd);
+ }
+ }
+
+ if (appl_trace_level < BT_TRACE_LEVEL_DEBUG) return;
+
+ dprintf(fd, "\nA2DP Peers State:\n");
dprintf(fd, " Active peer: %s\n",
(active_peer_ != nullptr) ? active_peer_->addr.ToString().c_str()
: "null");
for (size_t i = 0; i < BTA_AV_CO_NUM_ELEMENTS(peers_); i++) {
const BtaAvCoPeer& peer = peers_[i];
+ if (peer.addr.IsEmpty()) {
+ continue;
+ }
dprintf(fd, " Peer: %s\n", peer.addr.ToString().c_str());
dprintf(fd, " Number of sinks: %u\n", peer.num_sinks);
dprintf(fd, " Number of sources: %u\n", peer.num_sources);
dprintf(fd, " UUID to connect: 0x%x\n", peer.uuid_to_connect);
dprintf(fd, " BTA AV handle: %u\n", peer.BtaAvHandle());
}
-
- //
- // Active peer codec-specific stats
- //
- if (active_peer_ != nullptr) {
- A2dpCodecs* a2dp_codecs = active_peer_->GetCodecs();
- if (a2dp_codecs != nullptr) {
- a2dp_codecs->debug_codec_dump(fd);
- }
- }
}
bool BtaAvCo::ContentProtectIsScmst(const uint8_t* p_protect_info) {
}
void stack_debug_avdtp_api_dump(int fd) {
+ if (appl_trace_level < BT_TRACE_LEVEL_DEBUG) return;
+
dprintf(fd, "\nAVDTP Stack State:\n");
dprintf(fd, " AVDTP signalling L2CAP channel MTU: %d\n",
avdtp_cb.rcb.ctrl_mtu);
for (size_t i = 0; i < AVDT_NUM_LINKS; i++) {
const AvdtpCcb& ccb = avdtp_cb.ccb[i];
+ if (ccb.peer_addr.IsEmpty()) {
+ continue;
+ }
dprintf(fd, "\n Channel control block: %zu peer: %s\n", i,
ccb.peer_addr.ToString().c_str());
dprintf(fd, " Allocated: %s\n", ccb.allocated ? "true" : "false");
for (size_t i = 0; i < AVDT_NUM_SEPS; i++) {
const AvdtpScb& scb = ccb.scb[i];
+ if (!scb.in_use) {
+ continue;
+ }
dprintf(fd, "\n Stream control block: %zu\n", i);
dprintf(fd, " SEP codec: %s\n",
A2DP_CodecName(scb.stream_config.cfg.codec_info));