Bluetooth: samples: ISO: Check validity of incoming data
Only print incoming data when the data is valid. Otherwise we also print incoming data when no data was received. Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
This commit is contained in:
parent
d281b8db73
commit
57ab4f4cf4
3 changed files with 10 additions and 4 deletions
|
@ -91,8 +91,10 @@ static void iso_print_data(uint8_t *data, size_t data_len)
|
|||
static void iso_recv(struct bt_iso_chan *chan, const struct bt_iso_recv_info *info,
|
||||
struct net_buf *buf)
|
||||
{
|
||||
if (info->flags & BT_ISO_FLAGS_VALID) {
|
||||
printk("Incoming data channel %p len %u\n", chan, buf->len);
|
||||
iso_print_data(buf->data, buf->len);
|
||||
}
|
||||
}
|
||||
|
||||
static void iso_connected(struct bt_iso_chan *chan)
|
||||
|
|
|
@ -535,7 +535,9 @@ static void stream_recv(struct bt_bap_stream *stream,
|
|||
const struct bt_iso_recv_info *info,
|
||||
struct net_buf *buf)
|
||||
{
|
||||
if (info->flags & BT_ISO_FLAGS_VALID) {
|
||||
printk("Incoming audio on stream %p len %u\n", stream, buf->len);
|
||||
}
|
||||
}
|
||||
|
||||
static struct bt_bap_stream_ops stream_ops = {
|
||||
|
|
|
@ -545,7 +545,9 @@ static void stream_recv(struct bt_bap_stream *stream,
|
|||
const struct bt_iso_recv_info *info,
|
||||
struct net_buf *buf)
|
||||
{
|
||||
if (info->flags & BT_ISO_FLAGS_VALID) {
|
||||
printk("Incoming audio on stream %p len %u\n", stream, buf->len);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue