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

Pairing & Bonding issue with concurrent peripheral + central app

Hi

I am developing a concurrent central + peripheral application, in which central application connects to other external peripheral side, which uses static passkey ,pairing ,bonding and its working fine . The security parameters for peripheral and central+ peripheral side have attached below.

 I am able to connect the peripheral side with the External central(NRF Connect APP).I would like to know Is it possible to achieve the bonding without pairing here using the same parameters which I have been used already for the other side using peer manager?.

Here is the security parameters for the peripheral side

#define SEC_PARAM_BOND                      1                                       /**< Perform bonding. */
#define SEC_PARAM_MITM                      1                                       /**< Man In The Middle protection not required. */
#define SEC_PARAM_LESC                      0                                       /**< LE Secure Connections enabled. */
#define SEC_PARAM_KEYPRESS                  0                                       /**< Keypress notifications not enabled. */
#define SEC_PARAM_IO_CAPABILITIES           BLE_GAP_IO_CAPS_DISPLAY_ONLY                    /**< No I/O capabilities. */
#define SEC_PARAM_OOB                       0                                       /**< Out Of Band data not available. */
#define SEC_PARAM_MIN_KEY_SIZE              7                                       /**< Minimum encryption key size. */
#define SEC_PARAM_MAX_KEY_SIZE              16                                      /**< Maximum encryption key size. */

Here is the security parameters for the central + peripheral side

#define SEC_PARAM_BOND                  1                                           /**< Perform bonding. */
#define SEC_PARAM_MITM                  1                                           /**< Man In The Middle protection not required. */
#define SEC_PARAM_LESC                  0                                           /**< LE Secure Connections not enabled. */
#define SEC_PARAM_KEYPRESS              0                                           /**< Keypress notifications not enabled. */
#define SEC_PARAM_IO_CAPABILITIES       BLE_GAP_IO_CAPS_KEYBOARD_ONLY                       /**< No I/O capabilities. */
#define SEC_PARAM_OOB                   0                                           /**< Out Of Band data not available. */
#define SEC_PARAM_MIN_KEY_SIZE          7                                           /**< Minimum encryption key size in octets. */
#define SEC_PARAM_MAX_KEY_SIZE          16                                          /**< Maximum encryption key size in octets. */
#define SCAN_DURATION_WITELIST          0     

Here is my peer manager initialization

static void peer_manager_init(void)
{
    ble_gap_sec_params_t sec_param;
    ret_code_t err_code;

    err_code = pm_init();
    APP_ERROR_CHECK(err_code);

    memset(&sec_param, 0, sizeof(ble_gap_sec_params_t));

    // Security parameters to be used for all security procedures.
    sec_param.bond           = SEC_PARAM_BOND;
    sec_param.mitm           = SEC_PARAM_MITM;
    sec_param.lesc           = SEC_PARAM_LESC;
    sec_param.keypress       = SEC_PARAM_KEYPRESS;
    sec_param.io_caps        = SEC_PARAM_IO_CAPABILITIES;
    sec_param.oob            = SEC_PARAM_OOB;
    sec_param.min_key_size   = SEC_PARAM_MIN_KEY_SIZE;
    sec_param.max_key_size   = SEC_PARAM_MAX_KEY_SIZE;
    sec_param.kdist_own.enc  = 1;
    sec_param.kdist_own.id   = 1;
    sec_param.kdist_peer.enc = 1;
    sec_param.kdist_peer.id  = 1;

    err_code = pm_sec_params_set(&sec_param);
    APP_ERROR_CHECK(err_code);

    err_code = pm_register(pm_evt_handler);
    APP_ERROR_CHECK(err_code);
}

Parents Reply Children
  • Hi

    Thanks for the response.

    Is there any other way to achieve this?

    I want to do the bonding and pairing in concurrent central side with external peripheral(Already done using peer manager) and bonding only with the concurrent peripheral side with external central(like NRF connect ).

  • Hi, 

    The Paired devices can be bonded. This means that they store the keys that have already been exchanged when they are paired and use those again the next time they connect. it cannot only do bonding without pairing. 

    See this post

    -Amanda H.

  • Hi

    Thanks for the response.

    We have 3 devices 

    1) Simultaneous Central + Peripheral Role Device

    2)External Peripheral side

    3)External Central Side

    I want to pair/bond other peers in the ( central + peripheral ) (concurrent).

    I have already done the bonding , pairing and static passkey implementation in the concurrent central (to another peripheral device). I would like to do the same for the concurrent peripheral as well. The parameters set for the central + peripheral and external peripheral side are already shared above.

    Is it possible to do the  bonding , pairing and static passkey implementation in the concurrent peripheral side with external central(Like NRF connect) using the same parameters and peer manager. Please note that I have already set the parameters for the central side in peer manager. Does this limit me from doing the same in peripheral ?

  • Hi, 

    I think it should also work in the peripheral. Do you see any issues?  

    -Amanda H.
     
  • Hi 

    Thanks for the response.

    We have 3 devices 

    1) Simultaneous Central + Peripheral  side  name it  as "Device A"

    2)External Peripheral side name it as  "Device B"

    3)External Central Side name it  as "Device C"(like NRF connect APP)

    Yes, When I tried the pairing and static passkey implementation with Device A and Device C .It just displays the  pass key, I can't enter the passkey.( parameters attached below) 

    But for the static passkey implementation with Device A and Device B, I Used the below parameters  and its working fine.

    So how to achieve the bonding , pairing and static passkey implementation with the Device A and Device C using  the same parameters (Attached below) ?

    For the Device A

    #define SEC_PARAM_BOND                  1                                           /**< Perform bonding. */
    #define SEC_PARAM_MITM                  1                                           /**< Man In The Middle protection not required. */
    #define SEC_PARAM_LESC                  0                                           /**< LE Secure Connections not enabled. */
    #define SEC_PARAM_KEYPRESS              0                                           /**< Keypress notifications not enabled. */
    #define SEC_PARAM_IO_CAPABILITIES       BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY                       /**< No I/O capabilities. */
    #define SEC_PARAM_OOB                   0                                           /**< Out Of Band data not available. */
    #define SEC_PARAM_MIN_KEY_SIZE          7                                           /**< Minimum encryption key size in octets. */
    #define SEC_PARAM_MAX_KEY_SIZE          16                                          /**< Maximum encryption key size in octets. */
    #define SCAN_DURATION_WITELIST          0  

    For the Device B

    #define SEC_PARAM_BOND                      1                                       /**< Perform bonding. */
    #define SEC_PARAM_MITM                      1                                       /**< Man In The Middle protection not required. */
    #define SEC_PARAM_LESC                      0                                       /**< LE Secure Connections enabled. */
    #define SEC_PARAM_KEYPRESS                  0                                       /**< Keypress notifications not enabled. */
    #define SEC_PARAM_IO_CAPABILITIES           BLE_GAP_IO_CAPS_DISPLAY_ONLY                    /**< No I/O capabilities. */
    #define SEC_PARAM_OOB                       0                                       /**< Out Of Band data not available. */
    #define SEC_PARAM_MIN_KEY_SIZE              7                                       /**< Minimum encryption key size. */
    #define SEC_PARAM_MAX_KEY_SIZE              16   

Related