Bluetooth: L2CAP: Make sure state is correctly updated
This makes l2cap_chan_add updates the state to CONNECT so it doesn't have to be done manually for both incoming and outgoing code paths. Change-Id: I7331e49c675c83c6c1b184eeecc49c75c446a1ff Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
6cc35a751e
commit
514c9fa55f
1 changed files with 4 additions and 1 deletions
|
@ -326,6 +326,10 @@ static bool l2cap_chan_add(struct bt_conn *conn, struct bt_l2cap_chan *chan,
|
|||
|
||||
bt_l2cap_chan_add(conn, chan, destroy);
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL)) {
|
||||
bt_l2cap_chan_set_state(chan, BT_L2CAP_CONNECT);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1451,7 +1455,6 @@ static int l2cap_le_connect(struct bt_conn *conn, struct bt_l2cap_le_chan *ch,
|
|||
}
|
||||
|
||||
ch->chan.psm = psm;
|
||||
bt_l2cap_chan_set_state(&ch->chan, BT_L2CAP_CONNECT);
|
||||
|
||||
return l2cap_le_conn_req(ch);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue