Hi,
Thanks irahul for pointing out to the missing store_read_cb callback. I work with the Dave on the same project and allocating callbacks to
ble_hs_cfg from ble_store_config.c got us further.
Code: Select all
ble_hs_cfg.reset_cb = bleprph_on_reset;
ble_hs_cfg.sync_cb = ble_app_on_sync;
ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
ble_hs_cfg.store_read_cb = ble_store_config_read;
ble_hs_cfg.store_write_cb = ble_store_config_write;
ble_hs_cfg.store_delete_cb = ble_store_config_delete;
Now if I wish to connect to the device with an iPhone (via nRF connect), I will get a prompt to pair the device, that's cool. Once I unplug and plug the device back in and want to establish a connection, the phone refuses to connect saying that the device has no pairing info, like the device has forgotten it.
All in all the requirements would be the following:
- Once the device is paired with a phone, the device shall not be seen by other phones even if the paired phones is out of range (now the device reappears (for an Android phone for instance) once I disconnect from phone.)
- In case multiple device are up I can see that the name of the device is changing from one name (ble interface name) to another, like some kind of key rotation would be taking place.
- I want to be able to unpair the device by pressing one of the buttons of the device (any GPIO).
Now the biggest hurdle of mine is the first bullet point.
I have attached some parts of the code. Any help is highly appreciated!
Thank you,
Dani