Hi! I am trying to implement oob pairing, but I don't know how to do it. I' ve got 2 nrf devices. Central and peripheral. Central receives oob data, which it stores in structure. What I've done now is presented below.
Central side:
- Getting some information like peripheral address, peripheral tk value.
- Connecting with device (in
BLE_GAP_EVT_ADV_REPORT
I check ble address and if it matches I callsd_ble_gap_connect
). - Discovering peer services: (in
DM_EVT_CONNECTION
useble_db_discovery_start
). - Initiating bonding procedure.
In service handler as reply of event:
BLE_MY_SERVICE_C_EVT_DISCOVERY_COMPLETE
I usedm_security_setup_req
.
On the peripheral side:
- Creating advdata with my uuids, like in example:
experimental_ble_app_hrs_pairing_nfc
. - Using
conn_params_init()
with the difference:cp_init.start_on_notify_cccd_handle = BLE_GATT_HANDLE_INVALID;
- Calling
ble_advertising_start(BLE_ADV_MODE_FAST);
. (I replace ble_advdata.h and ble_advdata.c to new one from nrf52 sdk). - In the
case BLE_GAP_EVT_AUTH_KEY_REQUEST:
usingerr_code = sd_ble_gap_auth_key_reply(p_ble_evt->evt.gap_evt.conn_handle, BLE_GAP_AUTH_KEY_TYPE_OOB, m_oob_auth_key.tk);
And that's all. It does not work. Where I made a mistake?