summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2016-01-28 15:51:13 +0200
committerAnas Nashif <anas.nashif@intel.com>2016-02-05 20:25:28 -0500
commit5506ec6f098489770995763d9bca1a7bfec433c7 (patch)
treea3df6517800a0d355ea41ea88da4b61b51ca91ef /samples
parentca57c08e0fda8d0ecc450e70aeeec39dcbaecc52 (diff)
Bluetooth: Shell: Fix l2cap-send
bt_l2cap_chan_send does actually return the number of bytes sent. Change-Id: I862a8519c752c6b26250a21be02a927a9326617c Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'samples')
-rw-r--r--samples/bluetooth/shell/src/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/samples/bluetooth/shell/src/main.c b/samples/bluetooth/shell/src/main.c
index af089894e..b5710f077 100644
--- a/samples/bluetooth/shell/src/main.c
+++ b/samples/bluetooth/shell/src/main.c
@@ -1402,7 +1402,7 @@ static void cmd_l2cap_disconnect(int argc, char *argv[])
static void cmd_l2cap_send(int argc, char *argv[])
{
static uint8_t buf_data[DATA_MTU] = { [0 ... (DATA_MTU - 1)] = 0xff };
- int err, len, count = 1;
+ int ret, len, count = 1;
struct net_buf *buf;
if (argc > 1) {
@@ -1419,9 +1419,9 @@ static void cmd_l2cap_send(int argc, char *argv[])
}
memcpy(net_buf_add(buf, len), buf_data, len);
- err = bt_l2cap_chan_send(&l2cap_chan, buf);
- if (err) {
- printk("Unable to send: %u\n", -err);
+ ret = bt_l2cap_chan_send(&l2cap_chan, buf);
+ if (ret < 0) {
+ printk("Unable to send: %u\n", -ret);
net_buf_unref(buf);
break;
}