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.

Parents Reply
  • Hello Adam,

    It is no problem to dynamically enable/disable paring support on the nRF side. You can use the pm_sec_params_set() for this. The problem, as indicated in my previous reply, is that the central has no way of knowing if the peripheral is pairable without initiating a pairing request first. This can lead to a strange user experience. 

    The only way to make iOS not prompt the user to pair is to not include any characteristics with security enabled in the attribute table.

Children
Related