diff --git a/include/bluetooth/conn.h b/include/bluetooth/conn.h index afeaa7bacf9..8c6df6d28e9 100644 --- a/include/bluetooth/conn.h +++ b/include/bluetooth/conn.h @@ -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, }; diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 3cdbc537b70..c879f88d00a 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -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; diff --git a/subsys/bluetooth/host/smp.h b/subsys/bluetooth/host/smp.h index 6660f76bb20..e1f20094bc4 100644 --- a/subsys/bluetooth/host/smp.h +++ b/subsys/bluetooth/host/smp.h @@ -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