Skip to content

Commit

Permalink
Merge branch 'feature/adv_queue_congestion_v5.0' into 'release/v5.0'
Browse files Browse the repository at this point in the history
feat(nimble): Added adv queue congestion check (v5.0)

See merge request espressif/esp-idf!25731
  • Loading branch information
rahult-github committed Sep 25, 2023
2 parents ce6d37f + 4c118e2 commit 840d8a2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
9 changes: 9 additions & 0 deletions components/bt/host/nimble/Kconfig.in
Expand Up @@ -668,3 +668,12 @@ config BT_NIMBLE_HIGH_DUTY_ADV_ITVL
depends on BT_NIMBLE_ENABLED
help
This enable BLE high duty advertising interval feature

config BT_NIMBLE_HOST_QUEUE_CONG_CHECK
bool "BLE queue congestion check"
depends on BT_NIMBLE_ENABLED
default n
help
When scanning and scan duplicate is not enabled, if there are a lot of adv packets around
or application layer handling adv packets is slow, it will cause the controller memory
to run out. if enabled, adv packets will be lost when host queue is congested.
8 changes: 8 additions & 0 deletions components/bt/host/nimble/esp-hci/src/esp_nimble_hci.c
Expand Up @@ -452,6 +452,10 @@ esp_err_t esp_nimble_hci_init(void)

xSemaphoreGive(vhci_send_sem);

#if MYNEWT_VAL(BLE_QUEUE_CONG_CHECK)
ble_adv_list_init();
#endif

return ret;
err:
ble_buf_free();
Expand Down Expand Up @@ -494,5 +498,9 @@ esp_err_t esp_nimble_hci_deinit(void)

ble_buf_free();

#if MYNEWT_VAL(BLE_QUEUE_CONG_CHECK)
ble_adv_list_deinit();
#endif

return ESP_OK;
}
8 changes: 8 additions & 0 deletions components/bt/host/nimble/port/include/esp_nimble_cfg.h
Expand Up @@ -1619,4 +1619,12 @@
#endif
#endif

#ifndef MYNEWT_VAL_BLE_QUEUE_CONG_CHECK
#ifdef CONFIG_BT_NIMBLE_HOST_QUEUE_CONG_CHECK
#define MYNEWT_VAL_BLE_QUEUE_CONG_CHECK CONFIG_BT_NIMBLE_HOST_QUEUE_CONG_CHECK
#else
#define MYNEWT_VAL_BLE_QUEUE_CONG_CHECK FALSE
#endif
#endif

#endif

0 comments on commit 840d8a2

Please sign in to comment.