Is there a way to refuse to re-pair with an Android device?

I am developing with nrf52832 (s132 v7.0.1, SDK v17.0.0) as a peripheral device.

I am communicating with an Android device (SH-M05) as central.

There are times when I want to refuse to re-pair with an Android device, but before I can set up the refusal, a "Pair Setup Request" appears.

The current situation that is displayed is the following procedure.
(1) Connect to the device and pair it.
(2) On the Android device, delete the pairing information of nRF52832.
(3) Connect with the device.

To reject the re-pairing, we thought we could set conn_sec_config.allow_repairing to false in PM_EVT_CONN_SEC_CONFIG_REQ, but before PM_EVT_CONN_SEC_CONFIG_REQ occurs, "pair Configuration Request" is displayed.

Is there an effective way to prevent the "Pair Configuration Request" from being displayed?
Is there any other way to deny re-pairing?

Thank you in advance.

 

  • Not really possible.

    If you delete the pairing on Android, you still have the old pairing key in the device.

    Upon connecting, PM will notice the key and offer it to the android device since the address matches. That is what makes android display the pairing dialog, since because the key is missing on the "host".

    There is no way of knowing that the host key was deleted at this point.

    And PM_EVT_CONN_SEC_CONFIG_REQ only arrives after the user confirmed the re-pairing dialog on android.

  • Hi Sdi_kei, 

    Could you show us what exactly is the  "Pair Configuration Request" ? I guess it's different on each phone manufacturer to display such message or not. 
    But what we need to look into here is that if the peripheral actively send the encryption request or not. And if that trigger the message. If it's the case, we can check if you can modify the peer manager to not send the security request when connect to a bonded peer. And let the bonded peer do the task. 
    You may want to capture a sniffer trace to see what occurs over the air. 

Related