Skip to content

Commit bb43c05

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: ISO: Set missing CIS disconnecting state
The BT_ISO_STATE_DISCONNECTING was never set when the CIS was actually in the disconnecting state. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 38095f8 commit bb43c05

File tree

1 file changed

+8
-1
lines changed
  • subsys/bluetooth/host

1 file changed

+8
-1
lines changed

subsys/bluetooth/host/iso.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,8 @@ int bt_iso_chan_get_tx_sync(const struct bt_iso_chan *chan, struct bt_iso_tx_inf
886886
#if defined(CONFIG_BT_ISO_UNICAST)
887887
int bt_iso_chan_disconnect(struct bt_iso_chan *chan)
888888
{
889+
int err;
890+
889891
CHECKIF(!chan) {
890892
LOG_DBG("Invalid parameter: chan %p", chan);
891893
return -EINVAL;
@@ -920,7 +922,12 @@ int bt_iso_chan_disconnect(struct bt_iso_chan *chan)
920922
return -EALREADY;
921923
}
922924

923-
return bt_conn_disconnect(chan->iso, BT_HCI_ERR_REMOTE_USER_TERM_CONN);
925+
err = bt_conn_disconnect(chan->iso, BT_HCI_ERR_REMOTE_USER_TERM_CONN);
926+
if (err == 0) {
927+
bt_iso_chan_set_state(chan, BT_ISO_STATE_DISCONNECTING);
928+
}
929+
930+
return err;
924931
}
925932

926933
void bt_iso_cleanup_acl(struct bt_conn *iso)

0 commit comments

Comments
 (0)