Bluetooth: Fix not calling connected callback on connect failed

If LE Create Connection fails notify application that connection
failed.

Change-Id: I3993bcb1bf3f8bd8fc08546e1fe683326b47db5b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2016-02-17 11:36:41 +01:00 committed by Gerrit Code Review
commit 4dfb50e514
3 changed files with 7 additions and 0 deletions

View file

@ -673,6 +673,9 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state)
} else if (old_state == BT_CONN_CONNECT) {
/* conn->err will be set in this case */
notify_connected(conn);
} else if (old_state == BT_CONN_CONNECT_SCAN && conn->err) {
/* this indicate LE Create Connection failed */
notify_connected(conn);
}
/* Release the reference we took for the very first