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 <johan.hedberg@intel.com>
This commit is contained in:
parent
ba7b6b1ced
commit
71d0843c7d
1 changed files with 1 additions and 0 deletions
|
@ -1631,6 +1631,7 @@ int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason)
|
||||||
|
|
||||||
switch (conn->state) {
|
switch (conn->state) {
|
||||||
case BT_CONN_CONNECT_SCAN:
|
case BT_CONN_CONNECT_SCAN:
|
||||||
|
conn->err = reason;
|
||||||
bt_conn_set_state(conn, BT_CONN_DISCONNECTED);
|
bt_conn_set_state(conn, BT_CONN_DISCONNECTED);
|
||||||
bt_le_scan_update(false);
|
bt_le_scan_update(false);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue