Bluetooth: ISO: Add check for can_send in bt_iso_chan_send
Ensure that we don't attempt to send any data to the controller if `can_send` is not set, and return an error code to the application instead. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
24e38e90db
commit
f67e12ae8e
|
@ -696,6 +696,10 @@ int bt_iso_chan_send(struct bt_iso_chan *chan, struct net_buf *buf)
|
|||
}
|
||||
|
||||
iso_conn = chan->iso;
|
||||
if (!iso_conn->iso.can_send) {
|
||||
BT_DBG("Channel not able to send");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdr = net_buf_push(buf, sizeof(*hdr));
|
||||
hdr->sn = sys_cpu_to_le16(iso_conn->iso.seq_num);
|
||||
|
|
Loading…
Reference in a new issue