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

Error while Bonding With Pass Key Display

Hi,

I want the bonding to happen between the nrf51 and the Android Phone by displaying passkey on the phone. This can be done using device manager or peer manager. When the IO capabilities is set to None then the bonding between the two devices takes place successfully. On the other hand, changing the IO capabilities to Display Only would ask for a PIN on the phone. On entering the PIN, an error occurs saying unable to communicate with the device. What could be reason behind this and the solution to this ?

#define SEC_PARAM_BOND                  1                                          /**< Perform bonding. */
#define SEC_PARAM_MITM                  1                                          /**< Man In The Middle protection not required. */
#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. */


>  static void device_manager_init(bool erase_bonds) {
>     uint32_t               err_code;
>     dm_init_param_t        init_param = {.clear_persistent_data = erase_bonds};
>     dm_application_param_t register_param;
// Initialize persistent storage module.
err_code = pstorage_init();
APP_ERROR_CHECK(err_code);

err_code = dm_init(&init_param);
APP_ERROR_CHECK(err_code);

memset(&register_param.sec_param, 0, sizeof(ble_gap_sec_params_t));
register_param.sec_param.bond         = SEC_PARAM_BOND;
register_param.sec_param.mitm         = SEC_PARAM_MITM;
register_param.sec_param.io_caps      = SEC_PARAM_IO_CAPABILITIES;
register_param.sec_param.oob          = SEC_PARAM_OOB;
register_param.sec_param.min_key_size  = SEC_PARAM_MIN_KEY_SIZE;
register_param.sec_param.max_key_size = SEC_PARAM_MAX_KEY_SIZE;
register_param.evt_handler = device_manager_evt_handler;
register_param.service_type = DM_PROTOCOL_CNTXT_GATT_SRVR_ID;
err_code = dm_register(&m_app_handle, &register_param);
APP_ERROR_CHECK(err_code); }
static uint32_t device_manager_evt_handler(dm_handle_t const * p_handle,
                                           dm_event_t const  * p_event,
                                           ret_code_t        event_result)
{
    APP_ERROR_CHECK(event_result);

    return NRF_SUCCESS;
}

What am i missing in this?

Parents Reply Children
Related