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

Correct parameter to sd_ble_gap_sec_params_reply() when bonding not allowed

Hello,

I decided that bonding (does it equivalent to "pairing"?) is not allowed in my application, so I modified the following definition in main.c: #define SEC_PARAM_BOND 0 //1

And inside the on_ble_evt() function, I am not sure which of the following 2 options is correct when replying to the BLE_GAP_EVT_SEC_PARAMS_REQUEST event, please advise.

option 1) case BLE_GAP_EVT_SEC_PARAMS_REQUEST: err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_SUCCESS, &m_sec_params); break;

option 2) case BLE_GAP_EVT_SEC_PARAMS_REQUEST: err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, &m_sec_params); break;

Thank you! Joseph

Parents
  • Hi Joseph,

    Bonding is just an extended version of pairing, where you exchange some keys that can identify the peer at a later point. (IRK or LTK).

    In general if you don't want to use encryption at all, you should respond with option 2.

    You can use option 1 if you have characteristics that require authentication. Then no device can start encrypting the connection, but they would have to initiate pairing first.

    -- Pål

Reply
  • Hi Joseph,

    Bonding is just an extended version of pairing, where you exchange some keys that can identify the peer at a later point. (IRK or LTK).

    In general if you don't want to use encryption at all, you should respond with option 2.

    You can use option 1 if you have characteristics that require authentication. Then no device can start encrypting the connection, but they would have to initiate pairing first.

    -- Pål

Children
Related