Bluetooth: shell: Don't attempt to reuse channel
If the channel is already in use don't attempt to connect it a second time. Change-Id: I87bdaeadbe866b59c1a7975002699d9ef7a90c61 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
65e07099a7
commit
a03e068b03
1 changed files with 5 additions and 0 deletions
|
@ -2130,6 +2130,11 @@ static int cmd_l2cap_connect(int argc, char *argv[])
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (l2cap_chan.chan.conn) {
|
||||
printk("Channel already in use\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psm = strtoul(argv[1], NULL, 16);
|
||||
|
||||
err = bt_l2cap_chan_connect(default_conn, &l2cap_chan.chan, psm);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue