From b57b6f1adbc6088dc454998b78cb60603eef5ee7 Mon Sep 17 00:00:00 2001 From: Prasad Alatkar Date: Mon, 14 Dec 2020 19:59:13 +0530 Subject: [PATCH] NimBLE: Fix host flow control in NimBLE porting layer. - Register `ble_hs_flow_acl_free` callback in NimBLE porting layer. --- components/bt/host/nimble/esp-hci/src/esp_nimble_hci.c | 4 +++- examples/bluetooth/nimble/bleprph/main/main.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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 81c49e5a92..c386bdc4b3 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 @@ -210,7 +210,9 @@ void ble_hci_trans_buf_free(uint8_t *buf) */ int ble_hci_trans_set_acl_free_cb(os_mempool_put_fn *cb, void *arg) { - return BLE_ERR_UNSUPPORTED; + ble_hci_acl_pool.mpe_put_cb = cb; + ble_hci_acl_pool.mpe_put_arg = arg; + return 0; } int ble_hci_trans_reset(void) diff --git a/examples/bluetooth/nimble/bleprph/main/main.c b/examples/bluetooth/nimble/bleprph/main/main.c index d43d4d8b9f..56a6f2d087 100644 --- a/examples/bluetooth/nimble/bleprph/main/main.c +++ b/examples/bluetooth/nimble/bleprph/main/main.c @@ -361,11 +361,11 @@ app_main(void) ble_hs_cfg.sm_sc = 1; #else ble_hs_cfg.sm_sc = 0; +#endif #ifdef CONFIG_EXAMPLE_BONDING ble_hs_cfg.sm_our_key_dist = 1; ble_hs_cfg.sm_their_key_dist = 1; #endif -#endif rc = gatt_svr_init();