How to authorize and remember central on user request?

Hello,

I am developing a peripheral device, on which the firmware shall prevent unauthorized access to some custom characteristics. Once a central device is authorized, the peripheral device shall allow the access to these characteristics. The authorization shall happen only after an explicit user action (the user has to press a button on the peripheral to allow this). Once a central device is authorized, the peripheral device shall grant full access to the characteristics in the following power cycles automatically, without any user action.

My question is, how can I achieve this in the most straightforward way? Shall I add some protection to the characteristics through bonding and allow the bonding only after the user requested it? Or would it be more intuitive to use whitelisting (after bonding) and allow the bonding onyl after user request? I am happy to hear you suggestions, with some detailed description.

Thanks.

Adam

Target hardware is nRF52810, with softdevice s112, 7.3.0.

Related