diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 2820f5768dc..d0d08e5df12 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2248,6 +2248,8 @@ struct bt_conn *bt_conn_create_le(const bt_addr_le_t *peer, return conn; } #endif + bt_conn_set_state(conn, BT_CONN_CONNECT); + if (bt_le_direct_conn(conn)) { bt_conn_set_state(conn, BT_CONN_DISCONNECTED); bt_conn_unref(conn); @@ -2256,8 +2258,6 @@ struct bt_conn *bt_conn_create_le(const bt_addr_le_t *peer, return NULL; } - bt_conn_set_state(conn, BT_CONN_CONNECT); - return conn; }