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

Push Button to confirm connection

Hey, I noticed that most of the wearable ble devices (without keyboard and screen) on the market are using 'push to confirm connection' authentication, when you have to push button on the device to confirm smartphone connection within given timeout. All I could find in documentation is based on generated passkey or man in the middle( like ble_app_gls). Maybe someone is able to provide example using this type of authentication, or give a guidelines where and how it should be done. Thank you

  • Hi Justin,

    Maybe I haven't tried the a device with that feature but by spec if you don't use whitelist or directed advertise when advertising, you won't be able to allow or discard a connection before it is made. The peripheral will accept any connect request from central.

    What I can suggest you to do is to have a state that you ignore any event from BLE and not putting any data into the characteristics on the peripheral. The device remains in that stat until the "push to to confirm" button is press after that you can return the normal functionality of the device.

    If the button is not pressed after a timeout, you can terminate the connection. You can also refuse to do pairing in that waiting state as well.

Related