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 <Marek.Pieta@nordicsemi.no>
diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c
index 1c2fab8..a8c0e69 100644
--- a/subsys/bluetooth/host/conn.c
+++ b/subsys/bluetooth/host/conn.c
@@ -138,7 +138,9 @@
}
}
- bt_gatt_connected(conn);
+ if (!conn->err) {
+ bt_gatt_connected(conn);
+ }
}
static void notify_disconnected(struct bt_conn *conn)