espressif / esp-nimble

A fork of NimBLE stack, for use with ESP32 and ESP-IDF
Apache License 2.0
76 stars 49 forks source link

Incomplete *unpair* when using round-robin store status callback #39

Closed jspngh closed 5 months ago

jspngh commented 2 years ago

In the bleprph example, the following configuration is used ble_hs_cfg.store_status_cb = ble_store_util_status_rr;. However, this implementation does not work for BT_NIMBLE_MAX_BONDS >= 2. In case of BLE_STORE_EVENT_OVERFLOW, ble_gap_unpair_oldest_peer does not seem to delete all necessary data. When I replace it with ble_store_util_delete_oldest_peer, it works better. I am not sure if this because of the changes in esp-nimble or if this is also the case in upstream mynewt-nimble.

Since we can set the store_status_cb to whichever function we want, this is not a giant problem, but it might be a good idea to update the example to something that works with esp-nimble.

darshan7patel commented 5 months ago

Hi, this issue was addressed and fixed in this commit: 1.5.0 - fix(nimble): Fixed ble_gap_unpair_oldest_peer to prevent writing to invalid memory 1.4.0 -fix(nimble): Fixed ble_gap_unpair_oldest_peer to prevent writing to invalid memory 1.3.0 - fix(nimble): Fixed incorrect handling of bonded devices