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

nRF51822 Pairing confirmation with hardware button click with Mobile App

Hi There,

I am working on a project based on nrf51822. I need to establish pairing the device with smart phone by clicking a button as confirmation on the nrf51822.

How can I achieve this? I have gone through the developer forum but unfortunately couldn't find any relevant information.

I would really appreciate, if you can help me out on  this issue.

Best,

Krish

Parents
  • Hi Krishna,

    upon receiving a paring request from a BLE central, the SD will generate an event, BLE_GAP_EVT_SEC_PARAMS_REQUEST,  which triggers a callback where the appropriate "reply" function, sd_ble_gap_sec_params_reply() is called. So if you only want to pair if the button is pressed, then you can wait for the butten press when handling the BLE_GAP_EVT_SEC_PARAMS_REQUEST. If the button is not pressed, then you do not send sd_ble_gap_sec_params_reply().

    See the Peripheral Security Procedures message sequence charts for more information on which events that are generated during the pairing process for the different pairing methods. 

    Best regards

    Bjørn

  • Hi,Bjorn

     I had the same problem with him, I I need to establish pairing the device with smart phone by clicking a button as confirmation on the nRF52833 ,so I can get  the response BLE_GAP_EVT_SEC_PARAMS_REQUEST.but how can I reply it and disabled pairing.In other words, what function do I need to use to realize the function of clicking the button of the APP to initiate pairing and not clicking it will not be paired.

Reply
  • Hi,Bjorn

     I had the same problem with him, I I need to establish pairing the device with smart phone by clicking a button as confirmation on the nRF52833 ,so I can get  the response BLE_GAP_EVT_SEC_PARAMS_REQUEST.but how can I reply it and disabled pairing.In other words, what function do I need to use to realize the function of clicking the button of the APP to initiate pairing and not clicking it will not be paired.

Children
No Data
Related