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

static passkey implementation in Central code

Hi,

I am new to NRF development. I am using 2 nrf52840 DK one as central and other as peripheral(for reference). I am using ble_gap_gatts example from central side. i am able to scan and connect to nordic peripheral board using ble_gap_gatts_c example code.

on other side, i have BLE4 sensor parameters are not in my hand. I want connect my central device to this sensor as peripheral. I tried it with normal android mobile, it has passkey "000000", after giving this able to connect using android mobile. Same i want to do using nrf52840DK board as central. I dont have keyboard or display on nay side. I read few threads, but i am not getting how to add passkey and.I am referring this sequence charts  and threads given below but not able to replicate this in the code.

Can anybody please help me?

Output log:

<debug> ble_scan: Scanning parameters have been changed successfully

<debug> ble_scan: Scanning parameters have been changed successfully

<info> app: Starting scan.

<debug> ble_scan: Scanning

<debug> ble_scan: Connecting

<debug> ble_scan: Connection status: 0

<debug> peer_manager_handler: Connected, securing connection. conn_handle: 0

<debug> peer_manager_handler: Event PM_EVT_CONN_SEC_PARAMS_REQ

<debug> peer_manager_handler: Security parameter request

<debug> peer_manager_handler: Event PM_EVT_CONN_SEC_START

<debug> peer_manager_handler: Connection security procedure started: role: Central, conn_handle: 0, procedure: Bonding

<debug> peer_manager_handler: Event PM_EVT_CONN_SEC_PARAMS_REQ

<debug> peer_manager_handler: Security parameter request

<debug> peer_manager_handler: Event PM_EVT_CONN_SEC_FAILED

<info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Bonding, error: 136

<warning> peer_manager_handler: Disconnecting conn_handle 0.

<info> app: Disconnected. conn_handle: 0x0, reason: 0x16

sequence chart - http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.api.v2.0.0%2Fgroup___b_l_e___g_a_p___c_e_n_t_r_a_l___b_o_n_d_i_n_g___p_k___p_e_r_i_p_h___o_o_b___m_s_c.html&cp=2_6_2_1_0_2_1_3_5_2_2 .

https://devzone.nordicsemi.com/f/nordic-q-a/16846/passkey-activation

https://devzone.nordicsemi.com/f/nordic-q-a/8049/static-passkey-and-mitm

Related