Bluetooth mesh - best method to implement persistent storage



I have been thinking about different ways to add persistent storage to
bluetooth mesh. I would like to add this with as few changes to the
library as possible. I would store the data in flash using a
handle-value method.

I am however doubting the best way to trigger the writing to flash:

Option 1: trigger a writing to flash directly in the existing routines.
Option 2: add a "needs_flashing" variable to the structures, I would
add these to bt_mesh_elem, bt_mesh_cfg,(bt_mesh_health),
bt_mesh_model, bt_mesh_net, bt_mesh_friend, bt_mesh_lpn,
bt_mesh_app_key, bt_mesh_subnet,(bt_mesh_rpl). And starting a loop in
idle time checking for items that need flashing.

My preference goes to option 2, but my experience is limited, so if
someone has ideas about this please comment.

Kind regards,


Join { to automatically receive all group messages.