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

nRF52840 Enable Pairing with Static Passkey

Hi,

I am working on the ble_app_template project.

1-How can I enable simple pairing without NFC?
2-Also how can I set pairing code?
3-Is the write way to secure characteristics?

    attr_md.rd_auth    = 1;
    attr_md.wr_auth    = 1;
 

Thanks!

Parents Reply
  • Yes, many of the BLE examples in the SDK uses Just Works with pairing/bonding, e.g. the ble_app_hrs example. As seen here, the Device/Peer Manager is configured as this when using "Just Works bonding":

    sec_param.bond = true;
    sec_param.mitm = false;
    sec_param.lesc = 0;
    sec_param.keypress = 0;
    sec_param.io_caps = BLE_GAP_IO_CAPS_NONE;
    sec_param.oob = false;
    sec_param.min_key_size = 7;
    sec_param.max_key_size = 16;
    sec_param.kdist_own.enc = 1;
    sec_param.kdist_own.id = 1;
    sec_param.kdist_peer.enc = 1;
    sec_param.kdist_peer.id = 1;


    -Amanda H.

Children
Related