Bluetooth: Host: Add error to security changed callback
Add security error to security_changed callback. Call this callback when security has failed and provide current security level and error. Reason for failure can be. - Pairing procedure failed, pairing aborted before link encryption. - Link encrypt procedure failed - Link key refresh procedure failed. Fix missing bt_conn_unref on encryption key refresh with error status. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
f1c7371494
commit
6d4b842a10
8 changed files with 59 additions and 32 deletions
|
@ -984,13 +984,13 @@ u8_t bt_conn_enc_key_size(struct bt_conn *conn)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void bt_conn_security_changed(struct bt_conn *conn)
|
||||
void bt_conn_security_changed(struct bt_conn *conn, enum bt_security_err err)
|
||||
{
|
||||
struct bt_conn_cb *cb;
|
||||
|
||||
for (cb = callback_list; cb; cb = cb->_next) {
|
||||
if (cb->security_changed) {
|
||||
cb->security_changed(conn, conn->sec_level);
|
||||
cb->security_changed(conn, conn->sec_level, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue