Skip to content

Commit

Permalink
[BT] Disable debug mode upon any write from thee Web interface
Browse files Browse the repository at this point in the history
darthcloud committed Jan 29, 2025
1 parent 2678849 commit 8d997b3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main/bluetooth/att_cfg.c
Original file line number Diff line number Diff line change
@@ -701,6 +701,12 @@ void bt_att_cfg_hdlr(struct bt_dev *device, struct bt_hci_pkt *bt_hci_acl_pkt, u
uint16_t *data = (uint16_t *)wr_req->value;
uint32_t att_len = len - (BT_HCI_H4_HDR_SIZE + BT_HCI_ACL_HDR_SIZE + sizeof(struct bt_l2cap_hdr) + sizeof(struct bt_att_hdr));
uint32_t data_len = att_len - sizeof(wr_req->handle);

/* Disable debug tracing */
if (config.global_cfg.banksel == CONFIG_BANKSEL_DBG) {
config.global_cfg.banksel = 0xFF;
}

printf("# BT_ATT_OP_WRITE_REQ len: %ld\n", data_len);
switch (wr_req->handle) {
case BR_GLBL_CFG_CHRC_HDL:
@@ -736,10 +742,6 @@ void bt_att_cfg_hdlr(struct bt_dev *device, struct bt_hci_pkt *bt_hci_acl_pkt, u
bt_att_cmd_wr_rsp(device->acl_handle);
break;
case BR_MC_CTRL_CHRC_HDL:
if (config.global_cfg.banksel == CONFIG_BANKSEL_DBG) {
/* Disable debug tracing */
config.global_cfg.banksel = 0xFF;
}
mc_offset = *(uint32_t *)wr_req->value;
bt_att_cmd_wr_rsp(device->acl_handle);
break;

0 comments on commit 8d997b3

Please sign in to comment.