This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bond manager and pstorage module

Hello,

i use the bond manager together with a own module to store data in memory. On user interaction i want to delete the whole memory. I proceed as follows:

  1. Disconnect from Device/Deactivate Advertising
  2. Call ble_bondmngr_bonded_centrals_delete() function
  3. Call my own delete function for user momory
  4. Call Bond manager init function (also pstorage_init() is calles in this function)
  5. Call my own memory init function (pstorage_init() is not called)
  6. Activate Advertising

The problem is now that if i call bond manager init (step 4) the pstorages module is reinitialized and the command queue from pstorages module is deleted. So my own delete function call from step 3 is nor executed.

What is the best practise to get the state after all commands are processed in pstorage module. In the pstorage module there is the function pstorage_sys_event_handler() but no callback is called if all commands are processed.

Do all memory commands have to be executed before i call Bond manager init?

Do all memory commands have to be executed before i start advertising?

Related