bluetooth: host: Add support for SMP error code 0x0f

This error code informs that peer device rejected key during
keys distribution phase.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This commit is contained in:
Szymon Janc 2021-10-18 14:13:40 +02:00 committed by Anas Nashif
commit 47ac14282d
3 changed files with 6 additions and 0 deletions

View file

@ -751,6 +751,9 @@ enum bt_security_err {
/** Invalid parameters. */
BT_SECURITY_ERR_INVALID_PARAM,
/** Distributed Key Rejected */
BT_SECURITY_ERR_KEY_REJECTED,
/** Pairing failed but the exact reason could not be specified. */
BT_SECURITY_ERR_UNSPECIFIED,
};

View file

@ -430,6 +430,8 @@ static enum bt_security_err security_err_get(uint8_t smp_err)
return BT_SECURITY_ERR_PAIR_NOT_ALLOWED;
case BT_SMP_ERR_INVALID_PARAMS:
return BT_SECURITY_ERR_INVALID_PARAM;
case BT_SMP_ERR_KEY_REJECTED:
return BT_SECURITY_ERR_KEY_REJECTED;
case BT_SMP_ERR_UNSPECIFIED:
default:
return BT_SECURITY_ERR_UNSPECIFIED;

View file

@ -27,6 +27,7 @@ struct bt_smp_hdr {
#define BT_SMP_ERR_NUMERIC_COMP_FAILED 0x0c
#define BT_SMP_ERR_BREDR_PAIRING_IN_PROGRESS 0x0d
#define BT_SMP_ERR_CROSS_TRANSP_NOT_ALLOWED 0x0e
#define BT_SMP_ERR_KEY_REJECTED 0x0f
#define BT_SMP_IO_DISPLAY_ONLY 0x00
#define BT_SMP_IO_DISPLAY_YESNO 0x01