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

Add passkey in usbd_ble_uart example??

Hello.

I am developing using usbd_ble_uart project.

Development platform : nRF52833-DK, s113, SDK 16.0.0, IAR 8.31.1

I want to add static passkey and bonding in my project.

To do this, I added the passkey related code from the ble_app_gls example to my project.

1. test ble_app_gls project
- open nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_gls\ble_app_gls.www
- complie “ble_app_gls_pca10040_s132 - nrf52832_xxaa”
==>This caused the following compilation error.

The liboberon_3.0.1.a in “nRF5_SDK_16.0.0_98a08e2\external\nrf_oberon\lib\cortex-m4\hard-float\short-wchar” was replaced with the one in “nRF5_SDK_16.0.0_98a08e2\external\nrf_oberon\lib\cortex-m4\hard-float”.

After that, compilation was successful. So, I confirmed that the passkey and bonding functions work fine on the nRF52832-DK.

2. Add code to “usbd_ble_uart_pca10100_s113 – nrf52833_xxaa” project in “nRF5_SDK_16.0.0_98a08e2\examples\peripheral\usbd_ble_uart” from ble_app_gls project.

When the modified code is executed, an error occurs as shown below and reset.

How Fix it ??

Attach the modified code.

usbd_ble_uart.zip

Thanks..

Parents
  • Hi. 

    I commented the code below to fix the "BLE_GAP_EVT_SEC_PARAMS_REQUEST" error.

    static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
    {
         ....
         
            case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
                // Pairing not supported.
                NRF_LOG_DEBUG("BLE_GAP_EVT_SEC_PARAMS_REQUEST");
    //            err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
    //            APP_ERROR_CHECK(err_code);
                break;
    
       ....
    }

    As a result of the execution, I was able to proceed to the passkey input phase from the mobile phone.

    However, the device is disconnected when the following debugging message is output from the device.

    What am i missing?  ㅜㅜ

    And additionally I want to use static passkey.

    Which part of my code should I fix?

Reply
  • Hi. 

    I commented the code below to fix the "BLE_GAP_EVT_SEC_PARAMS_REQUEST" error.

    static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
    {
         ....
         
            case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
                // Pairing not supported.
                NRF_LOG_DEBUG("BLE_GAP_EVT_SEC_PARAMS_REQUEST");
    //            err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
    //            APP_ERROR_CHECK(err_code);
                break;
    
       ....
    }

    As a result of the execution, I was able to proceed to the passkey input phase from the mobile phone.

    However, the device is disconnected when the following debugging message is output from the device.

    What am i missing?  ㅜㅜ

    And additionally I want to use static passkey.

    Which part of my code should I fix?

Children
Related