From 71d0843c7d06de89495d1ac0dfca07bc6c726f95 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 7 Apr 2017 21:28:58 +0300 Subject: [PATCH] Bluetooth: conn: Pass disconnect error properly to the conn struct The bt_conn_set_state() function will not notify the connected callback of the connection error if conn->err isn't properly set. Jira: ZEP-2005 Change-Id: Idc30e736f4d8ba00156bf5c0e37dcccdb151742f Signed-off-by: Johan Hedberg --- subsys/bluetooth/host/conn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index bf8b67094f3..20f7f4274aa 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1631,6 +1631,7 @@ int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason) switch (conn->state) { case BT_CONN_CONNECT_SCAN: + conn->err = reason; bt_conn_set_state(conn, BT_CONN_DISCONNECTED); bt_le_scan_update(false); return 0;