forked from espressif/esp-idf
NimBLE: Fixed mismatch of number of completed packtes in host flow control
This commit is contained in:
committed by
Rahul Tank
parent
051965af52
commit
a2a674a107
@@ -185,14 +185,14 @@ notify_task(void *arg)
|
|||||||
|
|
||||||
/* Check if the MBUFs are available */
|
/* Check if the MBUFs are available */
|
||||||
if (os_msys_num_free() >= MIN_REQUIRED_MBUF) {
|
if (os_msys_num_free() >= MIN_REQUIRED_MBUF) {
|
||||||
|
do {
|
||||||
om = ble_hs_mbuf_from_flat(payload, sizeof(payload));
|
om = ble_hs_mbuf_from_flat(payload, sizeof(payload));
|
||||||
if (om == NULL) {
|
if (om == NULL) {
|
||||||
/* Memory not available for mbuf */
|
/* Memory not available for mbuf */
|
||||||
ESP_LOGE(tag, "No MBUFs available from pool, retry..");
|
ESP_LOGE(tag, "No MBUFs available from pool, retry..");
|
||||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
om = ble_hs_mbuf_from_flat(payload, sizeof(payload));
|
|
||||||
assert(om != NULL);
|
|
||||||
}
|
}
|
||||||
|
} while (om == NULL);
|
||||||
|
|
||||||
rc = ble_gatts_notify_custom(conn_handle, notify_handle, om);
|
rc = ble_gatts_notify_custom(conn_handle, notify_handle, om);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
|
Reference in New Issue
Block a user