Skip to content

Commit 51b45f0

Browse files
MarekPietacarlescufi
authored andcommitted
bluetooth: conn: Fix bt_gatt_connected call
bt_gatt_connected should be only called, when there is no connection error. Change fixes problem with receiving notifications before connection. Signed-off-by: Marek Pieta <[email protected]>
1 parent bf71aee commit 51b45f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

subsys/bluetooth/host/conn.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ static void notify_connected(struct bt_conn *conn)
138138
}
139139
}
140140

141-
bt_gatt_connected(conn);
141+
if (!conn->err) {
142+
bt_gatt_connected(conn);
143+
}
142144
}
143145

144146
static void notify_disconnected(struct bt_conn *conn)

0 commit comments

Comments
 (0)