This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to implement the static PIN type pairing?

Hi, I am using SDK6.1 and SD7.0 for our application. I would like to know how to implement the static PIN type pairing? I have searched Nordic's developers zone and found some information. devzone.nordicsemi.com/.../

I have implemented following changes for static pin , and found that it's not working.

uint8_t passkey[] = "123456";
ble_opt_t ble_opt;
ble_opt.gap.passkey.p_passkey = &passkey[0];
(void) sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &ble_opt);

I will be very much thankful if someone helps me in this regard. Thanking you very much!!! Regards, Raju

  • This also depends on what you set as the capabilities of the device.

    While pairing you would have to set the sec_params to:

    sd_ble_gap_sec_params_t sec_params;
    memset(&sec_params, 0, sizeof(sec_params));
    sec_params.timeout = 30;
    sec_params.bond = 1;
    sec_params.mitm = 1;
    sec_params.io_caps = BLE_GAP_IO_CAPS_DISPLAY_ONLY;
    sec_params.min_key_size = 7;
    sec_params.max_key_size = 16;
    

    and use this sec_params in the sd_ble_gap_sec_params_reply

  • Could you please share the source code here? I tried to add the passkey but i failed.

Related