NimBLE - where is code that manages persistent bonding

bfriedkin
Posts: 5
Joined: Sat Nov 24, 2018 10:21 pm

NimBLE - where is code that manages persistent bonding

Postby bfriedkin » Mon Jun 29, 2020 12:55 am

Hello -

This is a follow-up on this topic that covers persistent storage of the keys required to maintain device bonds across ESP32 reboots:

viewtopic.php?t=13049

Simple question: Where is the code that reads and writes the persistent data? Looking at the ble_hs_cfg store callbacks and reading through the ESP-IDF NimBLE port, I wasn't able to find the code. Presumably there are functions that read/write NVS to store the keys and associated data. The sample apps only set the store_status_cb to ble_store_util_status_rr, which I believe is called when there is insufficient storage.

Thanks,
Brian

ESP_ulipe
Posts: 7
Joined: Fri Mar 27, 2020 8:13 pm
Location: Campinas, SP - Brazil

Re: NimBLE - where is code that manages persistent bonding

Postby ESP_ulipe » Mon Jun 29, 2020 2:48 pm

Hi Brian, you can find this code section in: components/bt/host/nimble/nimble/nimble/host/store.

In this directory, there are different implementations of storing configuration, including the NVS way that the ESP32 implements, you can find specifically this implementation in: store/config/src/ble_store_nvs.c, the configuration of the read and write memory callbacks are implemented locally in this file.

Please let me know if this information was useful to you :D

Felipe

bfriedkin
Posts: 5
Joined: Sat Nov 24, 2018 10:21 pm

Re: NimBLE - where is code that manages persistent bonding

Postby bfriedkin » Mon Jun 29, 2020 10:48 pm

Felipe -

Thank you for the helpful answer. That is what I was looking for.

Regards,
Brian

ESP_ulipe
Posts: 7
Joined: Fri Mar 27, 2020 8:13 pm
Location: Campinas, SP - Brazil

Re: NimBLE - where is code that manages persistent bonding

Postby ESP_ulipe » Thu Jul 02, 2020 6:47 pm

Glad that I could help.

Cheers.

Who is online

Users browsing this forum: No registered users and 195 guests