Multiple security passkeys for bonding/peering to a single BLE peripheral from multiple BLE centrals.

Currently I have a 52840 peripheral running peer manager. We bond/peer with it using a passkey system from an mobile phone central. It works great.

SDK is 1702 nrf5.

What I'd like to know, is it possible to have a second bond/peer relationship establish from a second central device using a different passkey from the first one. Basically allow the peer_manager to accept two different passkeys for elevation to peered/bonding status. Either central would then have access to characteristics which are behind secured access attributes (including DFU)

Basically have two centrals....each with their own passkey allowing peered/bonded status.  Basically I'm after a two passkey system. Is this possible? Can peer_manager be setup to accept two different passkeys?

Parents
  • Hello,

    Normally the passkey is generated on the fly, meaning that each time you bond with passkey, then one peer show the passkey on a display, and the other peer have a keyboard where you input the passkey.

    If you don't have a display on your device, you can use what is called static passkey, where you set the passkey to a pre-defined value. This can be done when you are idle, before starting to advertise. The api you use to set a pre-defined passkey is for instance:

        // static passkey
        ble_opt_t ble_opt;
        uint8_t passkey[] = "123456";
    
        ble_opt.gap_opt.passkey.p_passkey = passkey;
        err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &ble_opt);
        APP_ERROR_CHECK(err_code);

    Best regards,
    Kenneth

Reply
  • Hello,

    Normally the passkey is generated on the fly, meaning that each time you bond with passkey, then one peer show the passkey on a display, and the other peer have a keyboard where you input the passkey.

    If you don't have a display on your device, you can use what is called static passkey, where you set the passkey to a pre-defined value. This can be done when you are idle, before starting to advertise. The api you use to set a pre-defined passkey is for instance:

        // static passkey
        ble_opt_t ble_opt;
        uint8_t passkey[] = "123456";
    
        ble_opt.gap_opt.passkey.p_passkey = passkey;
        err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &ble_opt);
        APP_ERROR_CHECK(err_code);

    Best regards,
    Kenneth

Children
Related