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

ble_app_uart_c dongle with passkey

Hi all,

I seek an advice on the passkey topic. Have been researching the topic all day but still have some confusion. I am running SDK 10.0 ble_app_uart example on nRF51 DK and ble_app_uart_c on the nRF51 dongle. The dongle connects to windows app that receives/transmit messages.

I have tried the SDK 8.0 uart example (it isn't implementing device manager) on peripheral nRF51 DK and demonstrated that adding the passkey works either with mobile phone or dongle via MCP.

Now, I want to be able to with dongle (ble_app_uart_c - SDK 10.0) send passkey via uart to peripheral device when requested. Similar to this topic here What do I need to implement in dongle?

Is device manager required (recommended) for both devices? I am confused with BLE_GAP_EVT_SEC_PARAMS_REQUEST and sd_ble_gap_sec_params_reply() on dongle side.

Parents
  • If you want the passkey to be sent from the central to the peripheral, the peripheral should have keyboard set and the central should have keyboard or display set.

    If both peripheral and central has keyboard set both sides will receive the BLE_GAP_EVT_AUTH_KEY_REQUEST event. You will have to create the passkey in the central. Send it via uart to the peripheral. Both sides use the passkey in sd_ble_gap_auth_key_reply(). See this and this MSCs.

    If the peripheral has keyboard set and the central has display set. The central will receive the BLE_GAP_EVT_PASSKEY_DISPLAY event, with the passkey. See this MSC. Send it via uart to the peripheral. The peripheral will receive the BLE_GAP_EVT_AUTH_KEY_REQUEST event, use the passkey in sd_ble_gap_auth_key_reply(). See this MSC.

    The Device Manager is optional software that handles pairing and bonding. If you are only doing pairing, I wouldn't recommend using it. If you are doing bonding and it covers your use case, I would recommend using it.

  • If you use static passkey the peripheral will have display set, but it is not necessary to display the passkey, because it is static. If you want to input this static passkey on the central you shoudl set that it has a keyboard. Then when you get the BLE_GAP_EVT_AUTH_KEY_REQUEST event, you use the static passkey in sd_ble_gap_auth_key_reply().

Reply Children
No Data
Related