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:
Luiz Augusto von Dentz 2017-04-26 13:00:13 +03:00 committed by Anas Nashif
commit a03e068b03

View file

@ -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);