Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Inconsistency in peer_manager

Hello,

I have a small test BLE peripheral application with a few functions I can invoke over a UART dialog. With one function, I can print the first peer in the peer manager, by calling pm_next_peer_id_get() and then retrieve the details of the bond using pm_peer_data_bonding_load(). With an other function, I can invoke pm_peers_delete(). With a third function, I can set previously stored bonding data, using pm_peer_new().

My test procedure goes like this:

- Bond the device to a GATT client

- store that bonding information to somewhere

- Delete the bond information

- Reset the device

- add previously stored bonding information, using pm_peer_new()

- Print existing bonding information (pm_next_peer_id_get() / pm_peer_data_bonding_load())

In the last step, pm_next_peer_id_get() returns a peer ID, with is not PM_PEER_ID_INVALID. However, pm_peer_data_bonding_load() returns NRF_ERROR_NOT_FOUND. I know, that the bonding data is not available shortly after it was inserted into the database. But I can wait for minutes between the call to pm_peer_new() and pm_peer_data_bonding_load() and this delay does not solve the inconsistency.

What could be the reason for the inconsistency?

best regards,

Torsten

I haven't found any examples of the usage of pm_peer_new() in the SDK examples. SDK version is 16.0.0, SD is S113. All return values to SDK function calls are systematically checked.

  • Hi Edvin,

    yes I read everything you wrote very carefully. I'm well aware that you and your colleagues have plenty of requests to answer and thus I try to investigate as much as possible before asking here.

    The internal error occurs without any connection being established. The test application calls `pm_peer_new()` and then starts advertising and _no_ central connects to the peripheral in this scenario.

    We started our application by using the peer_manager (who stores the bond information in flash) and are now moving to store the bonding informations somewhere else (of the chip). So, the startup sequence is to retrieve the bonding information from somewhere else and update the bonding information (if necessary) and then start advertising.

    We've decided to kick out the bond manager and to implement the bonding / pairing directly on top of the softdevice.

    Thank you very much for your patient!

    Best regards,

    Torsten

Related