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

S110 - Bonding with static PIN, incorrect PIN causes assert/error

I've created a BT peripheral based on the app_proximity example (SDK 8.0) and added code to implement paring with a static PIN per examples posted here. It works as expected if/when the correct PIN is entered at the client. However (after clearing all the bonds at the peripheral and on an iOS client) attempting to bind using the wrong PIN causes the device manager throw an event 0x14 (DM_EVT_SECURITY_SETUP_COMPLETE) result 0x84 (BLE_GAP_SEC_STATUS_CONFIRM_VALUE) that generates an exception/assert error when checked at the DM event handler. As far as I can tell the event/result doesn't necessarily indicate anything wrong has happened. See error log attached. I can provide additional info if needed. I can't figure why this is an error. Thanks.

INCORRECT PIN ENTERED.txt

Parents
  • @gwayne: You are correct, it may not be considered as an error. But it's purely design choice. You can change this behaviour by modifying the device manager event handler in main.c

    Currently we will assert with any call back that doesn't return NRF_SUCCESS. I think it's make sense to disconnect when the bonding is fail, so that end user can re-connect.

    But it seems the current behaviour is that we reset in the app_error_handler() when the bonding is failed, which may be not the best.

  • @gwayne: If you have a look at the description of the sd_ble_gap_disconnect() function you can find this:

    @param[in] hci_status_code HCI status code, see @ref BLE_HCI_STATUS_CODES (accepted values are @ref BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION and @ref BLE_HCI_CONN_INTERVAL_UNACCEPTABLE).
    

    It's always good to check the return err_code when you call a function, make sure all the parameter is accepted by the softdevice.

    If the answer is correct, could you mark it as correct so that we can close the case ?

Reply
  • @gwayne: If you have a look at the description of the sd_ble_gap_disconnect() function you can find this:

    @param[in] hci_status_code HCI status code, see @ref BLE_HCI_STATUS_CODES (accepted values are @ref BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION and @ref BLE_HCI_CONN_INTERVAL_UNACCEPTABLE).
    

    It's always good to check the return err_code when you call a function, make sure all the parameter is accepted by the softdevice.

    If the answer is correct, could you mark it as correct so that we can close the case ?

Children
No Data
Related