forked from espressif/esp-idf
Merge branch 'nimble/add_error_prints_acl_buf_v4.0' into 'release/v4.0'
NimBLE: Add error prints for ACL buffer exhaustion in NPL (v4.0) See merge request espressif/esp-idf!12971
This commit is contained in:
@ -247,6 +247,7 @@ static struct os_mbuf *ble_hci_trans_acl_buf_alloc(void)
|
|||||||
static void ble_hci_rx_acl(uint8_t *data, uint16_t len)
|
static void ble_hci_rx_acl(uint8_t *data, uint16_t len)
|
||||||
{
|
{
|
||||||
struct os_mbuf *m;
|
struct os_mbuf *m;
|
||||||
|
int rc;
|
||||||
int sr;
|
int sr;
|
||||||
if (len < BLE_HCI_DATA_HDR_SZ || len > MYNEWT_VAL(BLE_ACL_BUF_SIZE)) {
|
if (len < BLE_HCI_DATA_HDR_SZ || len > MYNEWT_VAL(BLE_ACL_BUF_SIZE)) {
|
||||||
return;
|
return;
|
||||||
@ -255,9 +256,11 @@ static void ble_hci_rx_acl(uint8_t *data, uint16_t len)
|
|||||||
m = ble_hci_trans_acl_buf_alloc();
|
m = ble_hci_trans_acl_buf_alloc();
|
||||||
|
|
||||||
if (!m) {
|
if (!m) {
|
||||||
|
ESP_LOGE(TAG, "%s failed to allocate ACL buffers; increase ACL_BUF_COUNT", __func__);
|
||||||
return;
|
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);
|
os_mbuf_free_chain(m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user