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

nRF52832 SDK15.3.0 how to force paring/bonding after connection

nRF52832

SDK15.3.0

ble_app_gls

ble_app_gls(SDK15.3.0) works perfectly and I want to port this "request pairing immediately feature" to my own project.

I referred a project from ble_app_uart_bonding_static_passkey_SDK_15.2.0  as my own project.

but this project does not start a pairing request after connection established. I have not found much difference between referred project and ble_app_gls.

Question:

ble_app_gls will start a pairing request with passkey method after connection established.

I want to find out where this paring request starts?

I tried:

1. in services_init(), modify SEC_JUST_WORKS to SEC_OPEN, but it still starts paring request after connection.

    // Here the sec level for the Glucose Service can be changed/increased.
    gls_init.gl_meas_cccd_wr_sec = SEC_JUST_WORKS;
    gls_init.gl_feature_rd_sec   = SEC_JUST_WORKS;
    gls_init.racp_cccd_wr_sec    = SEC_JUST_WORKS;
    gls_init.racp_wr_sec         = SEC_JUST_WORKS;

2. modify SEC_PARAM_LESC from 1 to 0, but it still starts paring request after connection

3. modify ble_app_uart_bonding_static_passkey_SDK_15.2.0 ble_nus_init(), make add_char_params.read_access/write_access/cccd_write_access to SEC_JUST_WORKS(just like ble_app_gls), it still does not start paring

Here I attach my test project on SDK15.2.0

ble_app_uart_bonding_static_passkey_SDK_15.2.0.7z

Related