From 5d80d551cf7cc4cf4e29034b47638c8eb6711c06 Mon Sep 17 00:00:00 2001 From: Prasad Alatkar Date: Tue, 9 Mar 2021 14:56:46 +0530 Subject: [PATCH] NimBLE: Add error prints for ACL buffer exhaustion in NPL --- components/bt/host/nimble/esp-hci/src/esp_nimble_hci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/bt/host/nimble/esp-hci/src/esp_nimble_hci.c b/components/bt/host/nimble/esp-hci/src/esp_nimble_hci.c index f231366b42..ab8d35dd7e 100644 --- a/components/bt/host/nimble/esp-hci/src/esp_nimble_hci.c +++ b/components/bt/host/nimble/esp-hci/src/esp_nimble_hci.c @@ -252,6 +252,7 @@ static struct os_mbuf *ble_hci_trans_acl_buf_alloc(void) static void ble_hci_rx_acl(uint8_t *data, uint16_t len) { struct os_mbuf *m; + int rc; int sr; if (len < BLE_HCI_DATA_HDR_SZ || len > MYNEWT_VAL(BLE_ACL_BUF_SIZE)) { return; @@ -260,9 +261,11 @@ static void ble_hci_rx_acl(uint8_t *data, uint16_t len) m = ble_hci_trans_acl_buf_alloc(); if (!m) { + ESP_LOGE(TAG, "%s failed to allocate ACL buffers; increase ACL_BUF_COUNT", __func__); return; } - if (os_mbuf_append(m, data, len)) { + if ((rc = os_mbuf_append(m, data, len)) != 0) { + ESP_LOGE(TAG, "%s failed to os_mbuf_append; rc = %d", __func__, rc); os_mbuf_free_chain(m); return; }