This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Selective pop-up pairing function

Hello! I am using SDK 15.3.0 to develop the NRF52832 firmware. At present, I want to implement a function, when the device is connected to the IOS host, start pairing, and when connected to the ANDROID host, no pairing window will pop up. Determine whether the host you are connecting to is IOS or ANDROID by whether you find the ANCS service. I wonder if it works? How should I modify the firmware?

  • Hello,

    Determine whether the host you are connecting to is IOS or ANDROID by whether you find the ANCS service

     I think this is a good idea. You can comment out this line "pm_handler_secure_on_connection(p_ble_evt);" in ble_evt_handler() to stop the peer manager from sending a pairing request on the connection event, and instead request pairing manually if the following conditions are met (use pm_conn_secure() to request pairing):

    - Peer is not previously bonded

    - ANCS service is discovered

Related