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

SDK15 pm_conn_secure() doesn't bond

Hi!

After connected and get log info "Connected." I start bonding:

// Initiate bonding.
err_code = pm_conn_secure(p_ble_evt->evt.common_evt.conn_handle, false);
if (err_code != NRF_ERROR_INVALID_STATE)
{
    APP_ERROR_CHECK(err_code);
}

but there is no any success message. 

 0> <info> app: Heart Rate collector example started.
 0> <info> app: Starting scan.
 0> <info> app: Connected.
 0> <info> app: Disconnected, reason 0x8.
 0> <info> app: Starting scan.
 0> <info> app: Connected.
 0> <info> app: Disconnected, reason 0x8.
 0> <info> app: Starting scan.
 0> <info> app: Connected.
 0> <info> app: Disconnected, reason 0x8.
 0> <info> app: Starting scan.
 0> <info> app: Connected.
 0> <info> app: Disconnected, reason 0x8.
 0> <info> app: Starting scan.

Therefore nRF52 SDK15 can't to made secure bond.

Why?

Parents Reply
  • FormerMember
    0 FormerMember in reply to Mikhail

    Instead of disabling MTU exchange request in SDK 15, it is better to add support for it in your SDK 13  peripheral. If max MTU size for the SDK 13 peripheral should remain 23, you can do something like this in on_ble_evt() in main.c:

     

    case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST:
        ret_code_t err_code;
        uint16_t mtu_size_supported_by_peripheral = 23;
        
         err_code = sd_ble_gatts_exchange_mtu_reply(conn_handle, mtu_size_supported_by_peripheral);
    
        if (err_code != NRF_SUCCESS)
        {
            NRF_LOG_ERROR("sd_ble_gatts_exchange_mtu_reply() returned unexpected value 0x%x.",
                          err_code);
        }

     

     

Children
Related