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

nrf51822 bonding with "CSR demo PC software" failed

Hi everyone:

I was testing the bonding with passkey entry, but it seems failed.

The slave 51822 EVK board is set with "BLE_GAP_IO_CAPS_DISPLAY_ONLY" and "MITM = 1".

When paring, the master device did not show any dialog for passkey entry, but the slave device is successful bonded to "CSR demo PC software" and the communication is normally. 

It look like the the slave do not check the PIN which confirmed by master.

Is there any thing wrong? Or if the "CSR demo PC software" is not support passkey , what will be happen?

Is there any way to disconnect with master when slave found that the master do not support passkey entry?

Parents
  • Hi,

    The slave 51822 EVK board is set with "BLE_GAP_IO_CAPS_DISPLAY_ONLY" and "MITM = 1".

    This look sensible, but I cannot say for sure without knowing more about your code. Are you using an SDK example? Which example from which SDK version? Which other modifications have you done?

    Is there any thing wrong? Or if the "CSR demo PC software" is not support passkey , what will be happen?

    I have no knowledge of this tool. Can you test with nRF Connect for Dekstop (if you have another nRF5 device), or alternatively nRF Connect for iOS or Android instead?

Reply
  • Hi,

    The slave 51822 EVK board is set with "BLE_GAP_IO_CAPS_DISPLAY_ONLY" and "MITM = 1".

    This look sensible, but I cannot say for sure without knowing more about your code. Are you using an SDK example? Which example from which SDK version? Which other modifications have you done?

    Is there any thing wrong? Or if the "CSR demo PC software" is not support passkey , what will be happen?

    I have no knowledge of this tool. Can you test with nRF Connect for Dekstop (if you have another nRF5 device), or alternatively nRF Connect for iOS or Android instead?

Children
  • Hi Einar:

    I patched the problem. The reason of bonding failed is that the CRS tool dose not support passkey entry.

    The patch is handle the BLE_GAP_EVT_SEC_PARAMS_REQUEST event. Source code is below.

    if(ble_cfg & BLE_CFG_MTD_PSK)
    {
        if(p_ble_evt->evt.gap_evt.params.sec_params_request.peer_params.io_caps == BLE_GAP_IO_CAPS_KEYBOARD_ONLY ||\
           p_ble_evt->evt.gap_evt.params.sec_params_request.peer_params.io_caps == BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY)
        {
            err_code = sd_ble_gap_sec_params_reply(p_ble_evt->evt.gap_evt.conn_handle,
                                           BLE_GAP_SEC_STATUS_SUCCESS,
                                           &m_application_table[0].sec_param, 
                                           &keys_exchanged);
        }
        else
        {
            err_code = sd_ble_gap_sec_params_reply(p_ble_evt->evt.gap_evt.conn_handle,
                                           BLE_GAP_SEC_STATUS_INVALID_PARAMS,
                                           &m_application_table[0].sec_param, 
                                           &keys_exchanged);
        }
        
    }
    else
    {
        err_code = sd_ble_gap_sec_params_reply(p_ble_evt->evt.gap_evt.conn_handle,
                                           BLE_GAP_SEC_STATUS_SUCCESS,
                                           &m_application_table[0].sec_param, 
                                           &keys_exchanged);
    }

Related