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: I agree. I mentioned the err_code just in relation to your note about sd_ble_gap_disconnect() that you got issue. Because if you check the err_code, and if you use incorrect status code, it will return NRF_ERROR_INVALID_PARAM that will help you to find the cause of the error.

Reply Children
No Data
Related