Bluetooth: host: Log failure to initiatie security for bonded peer

Log failure to initiatet security for bonded peer when GATT wants to
initiate security for CCCs for the remote.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2021-05-28 13:27:27 +02:00 committed by Carles Cufí
commit b9a586821e

View file

@ -4849,7 +4849,12 @@ void bt_gatt_connected(struct bt_conn *conn)
*/ */
if (IS_ENABLED(CONFIG_BT_SMP) && if (IS_ENABLED(CONFIG_BT_SMP) &&
bt_conn_get_security(conn) < data.sec) { bt_conn_get_security(conn) < data.sec) {
bt_conn_set_security(conn, data.sec); int err = bt_conn_set_security(conn, data.sec);
if (err) {
BT_WARN("Failed to set security for bonded peer (%d)",
err);
}
} }
#if defined(CONFIG_BT_GATT_CLIENT) #if defined(CONFIG_BT_GATT_CLIENT)