ble_mesh: add BQB LOG

This commit is contained in:
wangjialiang 2023-03-15 17:50:46 +08:00 committed by BOT
parent 0ec64df258
commit 6c55c9c800
5 changed files with 31 additions and 2 deletions

View File

@ -1464,6 +1464,9 @@ static void mod_sub_add(struct bt_mesh_model *model,
goto send_status;
}
BT_BQB(BLE_MESH_BQB_TEST_LOG_LEVEL_PRIMARY_ID_NODE | BLE_MESH_BQB_TEST_LOG_LEVEL_SUB_ID_TNPT,
"SubGroupAddr: 0x%x", sub_addr);
for (i = 0; i < ARRAY_SIZE(mod->groups); i++) {
if (mod->groups[i] == BLE_MESH_ADDR_UNASSIGNED) {
mod->groups[i] = sub_addr;
@ -1865,6 +1868,9 @@ static void mod_sub_va_add(struct bt_mesh_model *model,
goto send_status;
}
BT_BQB(BLE_MESH_BQB_TEST_LOG_LEVEL_PRIMARY_ID_NODE | BLE_MESH_BQB_TEST_LOG_LEVEL_SUB_ID_TNPT,
"SubVirtualAddr: 0x%x", sub_addr);
for (i = 0; i < ARRAY_SIZE(mod->groups); i++) {
if (mod->groups[i] == BLE_MESH_ADDR_UNASSIGNED) {
mod->groups[i] = sub_addr;

View File

@ -1472,6 +1472,11 @@ void bt_mesh_net_recv(struct net_buf_simple *data, int8_t rssi,
/* Save the state so the buffer can later be relayed */
net_buf_simple_save(&buf, &state);
BT_BQB(BLE_MESH_BQB_TEST_LOG_LEVEL_PRIMARY_ID_NODE | BLE_MESH_BQB_TEST_LOG_LEVEL_SUB_ID_NET,
"\nNetRecv: ctl: %d, src: %d, dst: %d, ttl: %d, data: 0x%s",
CTL(buf.data), SRC(buf.data), DST(buf.data), TTL(buf.data),
bt_hex(buf.data + BLE_MESH_NET_HDR_LEN, buf.len - BLE_MESH_NET_HDR_LEN));
rx.local_match = (bt_mesh_fixed_group_match(rx.ctx.recv_dst) ||
bt_mesh_elem_find(rx.ctx.recv_dst));

View File

@ -2872,8 +2872,8 @@ static void prov_msg_recv(const uint8_t idx)
fail:
/**
* FOR the case MESH/PVNR/PROV/BV-10-C and MESH/PVNR/PROV/BI-14-C
* Provisioner should send transaction ack before closing the link
* For the case MESH/PVNR/PROV/BV-10-C and MESH/PVNR/PROV/BI-14-C,
* provisioner should send transaction ack before closing the link.
*/
gen_prov_ack_send(idx, link[idx].rx.trans_id);

View File

@ -22,9 +22,11 @@
#if (CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_GATT) || \
CONFIG_BLE_MESH_GATT_PROXY_SERVER
#if !CONFIG_BLE_MESH_BQB_TEST
/* Not support enabling Proxy Client and Proxy Server simultaneously */
_Static_assert(!(IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_SERVER) &&IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_CLIENT)),
"Not support Proxy Server and Proxy Client simultaneously");
#endif
#define PDU_TYPE(data) (data[0] & BIT_MASK(6))
#define PDU_SAR(data) (data[0] >> 6)

View File

@ -782,6 +782,11 @@ static int sdu_recv(struct bt_mesh_net_rx *rx, uint32_t seq, uint8_t hdr,
continue;
}
BT_BQB(BLE_MESH_BQB_TEST_LOG_LEVEL_PRIMARY_ID_NODE | BLE_MESH_BQB_TEST_LOG_LEVEL_SUB_ID_TNPT,
"\nTNPTRecv: ctl: 0x%04x, ttl: 0x%04x, src: 0x%04x, dst: 0x%04x, payload: 0x%s",
rx->ctl, rx->ctx.recv_ttl, rx->ctx.addr, rx->ctx.recv_dst,
bt_hex(sdu->data, sdu->len));
rx->ctx.app_idx = BLE_MESH_KEY_DEV;
bt_mesh_model_recv(rx, sdu);
@ -827,6 +832,12 @@ static int sdu_recv(struct bt_mesh_net_rx *rx, uint32_t seq, uint8_t hdr,
sdu, ad, rx->ctx.addr,
rx->ctx.recv_dst, seq,
BLE_MESH_NET_IVI_RX(rx));
BT_BQB(BLE_MESH_BQB_TEST_LOG_LEVEL_PRIMARY_ID_NODE | BLE_MESH_BQB_TEST_LOG_LEVEL_SUB_ID_TNPT,
"\nTNPTRecv: ctl: 0x%04x, ttl: 0x%04x, src: 0x%04x, dst: 0x%04x, payload: 0x%s",
rx->ctl, rx->ctx.recv_ttl, rx->ctx.addr, rx->ctx.recv_dst,
bt_hex(sdu->data, sdu->len));
if (err) {
BT_DBG("Unable to decrypt with AppKey 0x%03x",
key->app_idx);
@ -997,6 +1008,11 @@ static int ctl_recv(struct bt_mesh_net_rx *rx, uint8_t hdr,
BT_DBG("OpCode 0x%02x len %u", ctl_op, buf->len);
BT_BQB(BLE_MESH_BQB_TEST_LOG_LEVEL_PRIMARY_ID_NODE | BLE_MESH_BQB_TEST_LOG_LEVEL_SUB_ID_TNPT,
"\nTNPTRecv: ctl: 0x%04x, ttl: 0x%04x, src: 0x%04x, dst: 0x%04x, payload: 0x%s",
rx->ctl, rx->ctx.recv_ttl, rx->ctx.addr, rx->ctx.recv_dst,
bt_hex(buf->data, buf->len));
switch (ctl_op) {
case TRANS_CTL_OP_ACK:
return trans_ack(rx, hdr, buf, seq_auth);