F.4.2 Pairing State Callback (pairStateCB)
This callback returns the current pairing state to the application whenever the state changes and the current status of the pairing or bonding process associated with the current state and provides the current status of the pairing. This function is defined as the following:
The pairing state(s) is enumerated as the following:
- GAPBOND_PAIRING_STATE_STARTED
- The following status is possible for this state:
- SUCCESS (0x00): pairing has been initiated
- GAPBOND_PAIRING_STATE_COMPLETE
- The following statuses are possible for this state:
- SUCCESS (0x00): pairing is complete. Session keys have been exchanged.
- SMP_PAIRING_FAILED_PASSKEY_ENTRY_FAILED (0x01): input failed
- SMP_PAIRING_FAILED_OOB_NOT_AVAIL (0x02): Out-of-band data unavailable
- SMP_PAIRING_FAILED_AUTH_REQ (0x03): input and output capabilities of devices fails to authenticate
- SMP_PAIRING_FAILED_CONFIRM_VALUE (0x04): the confirm value fails to match the calculated compare value
- SMP_PAIRING_FAILED_NOT_SUPPORTED (0x05): pairing is not supported
- SMP_PAIRING_FAILED_ENC_KEY_SIZE (0x06): encryption key size is insufficient
- SMP_PAIRING_FAILED_CMD_NOT_SUPPORTED (0x07): The SMP command received is unsupported on this device
- SMP_PAIRING_FAILED_UNSPECIFIED (0x08): encryption failed to start
- bleTimeout (0x17): pairing failed to complete before timeout
- bleGAPBondRejected (0x32): keys did not match
- GAPBOND_PAIRING_STATE_BONDED
- The following statuses are possible for this state:
- LL_ENC_KEY_REQ_REJECTED (0x06): encryption key is missing
- LL_ENC_KEY_REQ_UNSUPPORTED_FEATURE (0x1A): feature is unsupported by the remote device
- LL_CTRL_PKT_TIMEOUT_TERM (0x22): Timeout waiting for response
- bleGAPBondRejected (0x32): This status is received due to one of the above three errors.