Bluetooth: L2CAP: Log an error if data cannot be sent

This add an error to the output which helps detects failures in case
debug is not enabled.

Change-Id: I2f4ed357ccf288c15b231d637bf1986af9ecbf37
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2016-02-17 16:37:26 +02:00 committed by Gerrit Code Review
commit c22f551940

View file

@ -1277,6 +1277,8 @@ static int l2cap_chan_le_send_sdu(struct bt_l2cap_chan *chan,
int bt_l2cap_chan_send(struct bt_l2cap_chan *chan, struct net_buf *buf)
{
int err;
BT_DBG("chan %p buf %p len %u", chan, buf, buf->len);
if (!buf) {
@ -1288,6 +1290,11 @@ int bt_l2cap_chan_send(struct bt_l2cap_chan *chan, struct net_buf *buf)
}
/* TODO: Check conn/address type when BR/EDR is introduced */
return l2cap_chan_le_send_sdu(chan, buf);
err = l2cap_chan_le_send_sdu(chan, buf);
if (err < 0) {
BT_ERR("failed to send message %d", err);
}
return err;
}
#endif /* CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL */