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

Setting a PASSKEY

Hello! I am trying to develop on the nRF51822 eval board as called PCA10001. The programming interface I use is uVision4 on win7.

I would set a static PASSKEY for the pairing process in the reference code "ble_app_hrs". I add "sd_ble_gap_authenticate(p_ble_evt->evt.gap_evt.conn_handle,&m_sec_params)" at the top of "ble_evt_dispatch(ble_evt_t * p_ble_evt)". The PASSKEY has been set as "111111" in (p_ble_evt->evt.gap_evt.params.passkey_display.passkey[i]= '1').

As the result, in running "Heart Rate Monitor" in "nRF Utility APP", the screen pops up a pairing request. When I select "Pairing",

  • the iPhone get paired to the PCA10001 without asking any PASSKEY, and
  • the heart rate will never appear again, even I reload the original "ble_app_hrs" code.

Question 1, Did I erase anything so that original "ble_app_hrs" code can not work? Question 2, what is the proper way to add the PASSKEY for the pairing? Question 3, I assume "intern_ble_stack_events_execute(.......)" will be directed to "ble_evt_dispatch(....)" when the BLE stack event received. Is it applicable in this case?

Thanks for help. ELCA

Parents
  • As Mihail pointed out, the IO capability flags are used to specify how the user can interface with the peripheral. If the peripheral has a numerical keyboard a 6-digit passkey can be used in the pairing process. The passkey is typically generated randomly and displayed on the Central device (iPhone), and the user has to enter the passkey on the Peripheral device. If the keys match, the pairing process succeeds.

    For devices without any displays/keyboards/buttons, "Just Works" encryption is used in the pairing process. This is basically pairing with a static key.

    By setting IO capabilities to BLE_GAP_IO_CAPS_NONE the iPhone won't ask for a passkey to be entered. However, if you want to use passkey in your application, you can for example use the UART to enter the passkey on your connected PC and transmit the passkey to the PCA10001.

    Note that it's up to the application to read user input and notify the SoftDevice (see sd_ble_gap_auth_key_reply())

  • Hi, Audun, The final application is using the PASSKEY with smart phone while the device has no keyboard. In initial step, if we use an UART connected to the PCA10001, and save the PASSKEY in a non-volatile memory then remove the UART. The next time pairing with another smart phone, will PCA10001 request this 2nd smart phone for the PASSKEY? Of couse the PASSKEY value is identical with the first time pairing we saved in PCA10001.

Reply
  • Hi, Audun, The final application is using the PASSKEY with smart phone while the device has no keyboard. In initial step, if we use an UART connected to the PCA10001, and save the PASSKEY in a non-volatile memory then remove the UART. The next time pairing with another smart phone, will PCA10001 request this 2nd smart phone for the PASSKEY? Of couse the PASSKEY value is identical with the first time pairing we saved in PCA10001.

Children
No Data
Related