From 855454d58a0ff1514b83755ffe45c95f0a2c83a6 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Fri, 12 May 2023 10:24:45 +0530 Subject: [PATCH] Add debug code to print HCI events information --- nimble/host/src/ble_hs_hci_evt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nimble/host/src/ble_hs_hci_evt.c b/nimble/host/src/ble_hs_hci_evt.c index c743edc60..d9040fabb 100644 --- a/nimble/host/src/ble_hs_hci_evt.c +++ b/nimble/host/src/ble_hs_hci_evt.c @@ -1022,6 +1022,18 @@ ble_hs_hci_evt_process(struct ble_hci_ev *ev) STATS_INC(ble_hs_stats, hci_unknown_event); rc = BLE_HS_ENOTSUP; } else { +#if !BLE_MONITOR + /* Ignore NOCP for debug */ + if(ev->opcode != 0x13) { + BLE_HS_LOG(DEBUG, "ble_hs_event_rx_hci_ev; opcode=0x%x ", ev->opcode); + + /* For LE Meta, print subevent code */ + if(ev->opcode == 0x3e) + BLE_HS_LOG(DEBUG, "subevent: 0x%x", ev->data[0]); + + BLE_HS_LOG(DEBUG, "\n"); + } +#endif rc = entry->cb(ev->opcode, ev->data, ev->length); }