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
  • Just to say that you cannot have static PASSKEY and next are the answers:

    Question 1, Did I erase anything so that original "ble_app_hrs" code can not work?

    Example does use: #define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /**< No I/O capabilities. */ So device does not have capabilities for entering PASSKEY, in this case another association model is used.

    Question 2, what is the proper way to add the PASSKEY for the pairing? This depends on your device capabilities, in other words does it has keyboard.

    #define BLE_GAP_IO_CAPS_DISPLAY_ONLY      0x00   /**< Display Only. */
    #define BLE_GAP_IO_CAPS_DISPLAY_YESNO     0x01   /**< Display and Yes/No entry. */
    #define BLE_GAP_IO_CAPS_KEYBOARD_ONLY     0x02   /**< Keyboard Only. */
    #define BLE_GAP_IO_CAPS_NONE              0x03   /**< No I/O capabilities. */
    #define BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY  0x04   /**< Keyboard and Display. */
    

    Question 3: Check the ble_app_gls example from documentation.

Reply
  • Just to say that you cannot have static PASSKEY and next are the answers:

    Question 1, Did I erase anything so that original "ble_app_hrs" code can not work?

    Example does use: #define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /**< No I/O capabilities. */ So device does not have capabilities for entering PASSKEY, in this case another association model is used.

    Question 2, what is the proper way to add the PASSKEY for the pairing? This depends on your device capabilities, in other words does it has keyboard.

    #define BLE_GAP_IO_CAPS_DISPLAY_ONLY      0x00   /**< Display Only. */
    #define BLE_GAP_IO_CAPS_DISPLAY_YESNO     0x01   /**< Display and Yes/No entry. */
    #define BLE_GAP_IO_CAPS_KEYBOARD_ONLY     0x02   /**< Keyboard Only. */
    #define BLE_GAP_IO_CAPS_NONE              0x03   /**< No I/O capabilities. */
    #define BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY  0x04   /**< Keyboard and Display. */
    

    Question 3: Check the ble_app_gls example from documentation.

Children
Related