From a2a674a10795b73e15d9615ea494e3c128286853 Mon Sep 17 00:00:00 2001 From: "isha.pardikar@espressif.com" Date: Wed, 29 Mar 2023 15:27:48 +0530 Subject: [PATCH] NimBLE: Fixed mismatch of number of completed packtes in host flow control --- .../throughput_app/bleprph_throughput/main/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/bluetooth/nimble/throughput_app/bleprph_throughput/main/main.c b/examples/bluetooth/nimble/throughput_app/bleprph_throughput/main/main.c index 5925b679ea..3542f0e3f1 100644 --- a/examples/bluetooth/nimble/throughput_app/bleprph_throughput/main/main.c +++ b/examples/bluetooth/nimble/throughput_app/bleprph_throughput/main/main.c @@ -185,14 +185,14 @@ notify_task(void *arg) /* Check if the MBUFs are available */ if (os_msys_num_free() >= MIN_REQUIRED_MBUF) { - om = ble_hs_mbuf_from_flat(payload, sizeof(payload)); - if (om == NULL) { - /* Memory not available for mbuf */ - ESP_LOGE(tag, "No MBUFs available from pool, retry.."); - vTaskDelay(100 / portTICK_PERIOD_MS); + do { om = ble_hs_mbuf_from_flat(payload, sizeof(payload)); - assert(om != NULL); - } + if (om == NULL) { + /* Memory not available for mbuf */ + ESP_LOGE(tag, "No MBUFs available from pool, retry.."); + vTaskDelay(100 / portTICK_PERIOD_MS); + } + } while (om == NULL); rc = ble_gatts_notify_custom(conn_handle, notify_handle, om); if (rc != 0) {