diff --git a/src/NimBLEServer.cpp b/src/NimBLEServer.cpp index 5e4f381b5..afda6bcda 100644 --- a/src/NimBLEServer.cpp +++ b/src/NimBLEServer.cpp @@ -493,6 +493,15 @@ int NimBLEServer::handleGapEvent(ble_gap_event* event, void* arg) { break; } // BLE_GAP_EVENT_NOTIFY_TX +# if MYNEWT_VAL(BLE_ROLE_CENTRAL) + case BLE_GAP_EVENT_NOTIFY_RX: { + if (pServer->m_pClient && pServer->m_pClient->m_connHandle == event->notify_rx.conn_handle) { + NimBLEClient::handleGapEvent(event, pServer->m_pClient); + } + break; + } // BLE_GAP_EVENT_NOTIFY_RX +# endif + case BLE_GAP_EVENT_ADV_COMPLETE: { # if MYNEWT_VAL(BLE_EXT_ADV) && MYNEWT_VAL(BLE_ROLE_BROADCASTER) case BLE_GAP_EVENT_SCAN_REQ_RCVD: diff --git a/src/nimble/esp_port/esp-hci/src/esp_nimble_hci.c b/src/nimble/esp_port/esp-hci/src/esp_nimble_hci.c index 94294aa2f..4f13e2525 100644 --- a/src/nimble/esp_port/esp-hci/src/esp_nimble_hci.c +++ b/src/nimble/esp_port/esp-hci/src/esp_nimble_hci.c @@ -167,14 +167,14 @@ static void ble_hci_rx_acl(uint8_t *data, uint16_t len) m = ble_transport_alloc_acl_from_ll(); if (!m) { - esp_rom_printf("Failed to allocate buffer, retrying "); - /* Give some time to free buffer and try again */ - vTaskDelay(1); - } - }while(!m); + esp_rom_printf("Failed to allocate buffer, retrying\n"); + /* Give some time to free buffer and try again */ + vTaskDelay(pdMS_TO_TICKS(10)); + } + } while(!m); if ((rc = os_mbuf_append(m, data, len)) != 0) { - esp_rom_printf("%s failed to os_mbuf_append; rc = %d", __func__, rc); + esp_rom_printf("%s failed to os_mbuf_append; rc = %d\n", __func__, rc); os_mbuf_free_chain(m); return; }