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

About the reason code(hci_Status_code) of sd_ble_gap_disconnect()

Hello, Nordic Stuff.

I've been working at ble peripheral devices using S110.

I am just wondering why the sd_ble_gap_disconnect function accepts only the reason code of

BLE_REMOTE_USER_TERMINATED_CONNECTION and BLE_CONN_INTERVAL_UNACCEPTABLE.

I want to pass the reason code of BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING(0x06) to

this function when a peripheral device has lost the bonding information after paring with iPhone

and can not accept the encryption request from iPhone.(iPhone has kept bonding inforamation.)

Could you tell me the reason?

Best regards.

Parents
  • Hi there,

    The reason the SoftDevice only accepts those status codes is that we provide alternative solutions to make it known that your keys are missing.

    In particular in your case if you look at Variant #2 on this MSC

    You can simply reply: sd_ble_gap_sec_info_reply(conn_handle, NULL, NULL) and the stack will send an LL Reject Indication to the peer with the error code "Pin or Key Missing", so at that point you can count on the peer already knowing that you don't have the key anymore.

    After that you can simply use BLE_REMOTE_USER_TERMINATED_CONNECTION to disconnect.

Reply
  • Hi there,

    The reason the SoftDevice only accepts those status codes is that we provide alternative solutions to make it known that your keys are missing.

    In particular in your case if you look at Variant #2 on this MSC

    You can simply reply: sd_ble_gap_sec_info_reply(conn_handle, NULL, NULL) and the stack will send an LL Reject Indication to the peer with the error code "Pin or Key Missing", so at that point you can count on the peer already knowing that you don't have the key anymore.

    After that you can simply use BLE_REMOTE_USER_TERMINATED_CONNECTION to disconnect.

Children
No Data
Related