Zephyr Project API  3.1.0
A Scalable Open Source RTOS
audio.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2020 Intel Corporation
7 * Copyright (c) 2020-2022 Nordic Semiconductor ASA
8 *
9 * SPDX-License-Identifier: Apache-2.0
10 */
11#ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_AUDIO_H_
12#define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_AUDIO_H_
13
14#include <zephyr/sys/atomic.h>
21
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#define BT_AUDIO_BROADCAST_ID_SIZE 3 /* octets */
34
42#define BT_AUDIO_CONTEXT_TYPE_PROHIBITED 0
48#define BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED BIT(0)
54#define BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL BIT(1)
61#define BT_AUDIO_CONTEXT_TYPE_MEDIA BIT(2)
68#define BT_AUDIO_CONTEXT_TYPE_GAME BIT(3)
74#define BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL BIT(4)
80#define BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS BIT(5)
87#define BT_AUDIO_CONTEXT_TYPE_LIVE BIT(6)
94#define BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS BIT(7)
101#define BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS BIT(8)
108#define BT_AUDIO_CONTEXT_TYPE_RINGTONE BIT(9)
115#define BT_AUDIO_CONTEXT_TYPE_ALERTS BIT(10)
121#define BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM BIT(11)
126#define BT_AUDIO_CONTEXT_TYPE_ANY (BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED | \
127 BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | \
128 BT_AUDIO_CONTEXT_TYPE_MEDIA | \
129 BT_AUDIO_CONTEXT_TYPE_GAME | \
130 BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL | \
131 BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS | \
132 BT_AUDIO_CONTEXT_TYPE_LIVE | \
133 BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS | \
134 BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS | \
135 BT_AUDIO_CONTEXT_TYPE_RINGTONE | \
136 BT_AUDIO_CONTEXT_TYPE_ALERTS | \
137 BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM)
138
139
140/* Unicast Announcement Type, Generic Audio */
141#define BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL 0x00
142#define BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED 0x01
143
144#if defined(CONFIG_BT_AUDIO_BROADCAST_SINK)
145#define BROADCAST_SNK_STREAM_CNT CONFIG_BT_AUDIO_BROADCAST_SNK_STREAM_COUNT
146#define BROADCAST_SNK_SUBGROUP_CNT CONFIG_BT_AUDIO_BROADCAST_SNK_SUBGROUP_COUNT
147#else /* !CONFIG_BT_AUDIO_BROADCAST_SINK */
148#define BROADCAST_SNK_STREAM_CNT 0
149#define BROADCAST_SNK_SUBGROUP_CNT 0
150#endif /* CONFIG_BT_AUDIO_BROADCAST_SINK*/
151
153struct bt_audio_unicast_group;
154
156struct bt_audio_broadcast_sink;
157
159struct bt_audio_broadcast_source;
160
163 struct bt_data data;
164 uint8_t value[CONFIG_BT_CODEC_MAX_DATA_LEN];
165};
166
177#define BT_CODEC_DATA(_type, _bytes...) \
178 { \
179 .data = BT_DATA(_type, ((uint8_t []) { _bytes }), \
180 sizeof((uint8_t []) { _bytes })) \
181 }
182
192#define BT_CODEC(_id, _cid, _vid, _data, _meta) \
193 { \
194 .id = _id, \
195 .cid = _cid, \
196 .vid = _vid, \
197 .data_count = ARRAY_SIZE(((struct bt_codec_data[]) _data)), \
198 .data = _data, \
199 .meta_count = ARRAY_SIZE(((struct bt_codec_data[]) _meta)), \
200 .meta = _meta, \
201 }
202
203
218};
219
253};
254
256struct bt_codec {
266 struct bt_codec_data data[CONFIG_BT_CODEC_MAX_DATA_COUNT];
270 struct bt_codec_data meta[CONFIG_BT_CODEC_MAX_METADATA_COUNT];
271};
272
274 /* Unique index of the BIS */
285 struct bt_codec_data data[CONFIG_BT_CODEC_MAX_DATA_COUNT];
286};
287
289 /* Number of BIS in the subgroup */
290 size_t bis_count;
297 /* Array of BIS specific data for each BIS in the subgroup */
299};
300
302 /* Number of subgroups in the BASE */
304 /* Array of subgroups in the BASE */
306};
307
312};
313
325#define BT_CODEC_QOS(_interval, _framing, _phy, _sdu, _rtn, _latency, \
326 _pd) \
327 { \
328 .interval = _interval, \
329 .framing = _framing, \
330 .phy = _phy, \
331 .sdu = _sdu, \
332 .rtn = _rtn, \
333 .latency = _latency, \
334 .pd = _pd, \
335 }
336
338enum {
341};
342
344enum {
348};
349
359#define BT_CODEC_QOS_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd) \
360 BT_CODEC_QOS(_interval, BT_CODEC_QOS_UNFRAMED, BT_CODEC_QOS_2M, _sdu, \
361 _rtn, _latency, _pd)
362
372#define BT_CODEC_QOS_FRAMED(_interval, _sdu, _rtn, _latency, _pd) \
373 BT_CODEC_QOS(_interval, BT_CODEC_QOS_FRAMED, BT_CODEC_QOS_2M, _sdu, \
374 _rtn, _latency, _pd)
375
380
383
386
389
392
397};
398
411#define BT_CODEC_QOS_PREF(_unframed_supported, _phy, _rtn, _latency, _pd_min, \
412 _pd_max, _pref_pd_min, _pref_pd_max) \
413 { \
414 .unframed_supported = _unframed_supported, \
415 .phy = _phy, \
416 .rtn = _rtn, \
417 .latency = _latency, \
418 .pd_min = _pd_min, \
419 .pd_max = _pd_max, \
420 .pref_pd_min = _pref_pd_min, \
421 .pref_pd_max = _pref_pd_max, \
422 }
423
432
435
438
441
448
455
458
461};
462
469};
470
472#define BT_AUDIO_LC3_PRESET(_codec, _qos) \
473 { \
474 .codec = _codec, \
475 .qos = _qos, \
476 }
477
478/* LC3 Unicast presets defined by table 5.2 in the BAP v1.0 specification */
479#define BT_AUDIO_LC3_UNICAST_PRESET_8_1_1 \
480 BT_AUDIO_LC3_PRESET( \
481 BT_CODEC_LC3_CONFIG_8_1, \
482 BT_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 2u, 8u, 40000u) \
483 )
484
485#define BT_AUDIO_LC3_UNICAST_PRESET_8_2_1 \
486 BT_AUDIO_LC3_PRESET( \
487 BT_CODEC_LC3_CONFIG_8_2, \
488 BT_CODEC_LC3_QOS_10_UNFRAMED(30u, 2u, 10u, 40000u) \
489 )
490
491#define BT_AUDIO_LC3_UNICAST_PRESET_16_1_1 \
492 BT_AUDIO_LC3_PRESET( \
493 BT_CODEC_LC3_CONFIG_16_1, \
494 BT_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 2u, 8u, 40000u) \
495 )
496
498#define BT_AUDIO_LC3_UNICAST_PRESET_16_2_1 \
499 BT_AUDIO_LC3_PRESET( \
500 BT_CODEC_LC3_CONFIG_16_2, \
501 BT_CODEC_LC3_QOS_10_UNFRAMED(40u, 2u, 10u, 40000u) \
502 )
503
504#define BT_AUDIO_LC3_UNICAST_PRESET_24_1_1 \
505 BT_AUDIO_LC3_PRESET( \
506 BT_CODEC_LC3_CONFIG_24_1, \
507 BT_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 2u, 8u, 40000u) \
508 )
509
511#define BT_AUDIO_LC3_UNICAST_PRESET_24_2_1 \
512 BT_AUDIO_LC3_PRESET( \
513 BT_CODEC_LC3_CONFIG_24_2, \
514 BT_CODEC_LC3_QOS_10_UNFRAMED(60u, 2u, 10u, 40000u) \
515 )
516
517#define BT_AUDIO_LC3_UNICAST_PRESET_32_1_1 \
518 BT_AUDIO_LC3_PRESET( \
519 BT_CODEC_LC3_CONFIG_32_1, \
520 BT_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 2u, 8u, 40000u) \
521 )
522
523#define BT_AUDIO_LC3_UNICAST_PRESET_32_2_1 \
524 BT_AUDIO_LC3_PRESET( \
525 BT_CODEC_LC3_CONFIG_32_2, \
526 BT_CODEC_LC3_QOS_10_UNFRAMED(80u, 2u, 10u, 40000u) \
527 )
528
529#define BT_AUDIO_LC3_UNICAST_PRESET_441_1_1 \
530 BT_AUDIO_LC3_PRESET( \
531 BT_CODEC_LC3_CONFIG_441_1, \
532 BT_CODEC_QOS(8163u, BT_CODEC_QOS_FRAMED, \
533 BT_CODEC_QOS_2M, 97u, 5u, 24u, 40000u) \
534 )
535
536#define BT_AUDIO_LC3_UNICAST_PRESET_441_2_1 \
537 BT_AUDIO_LC3_PRESET( \
538 BT_CODEC_LC3_CONFIG_441_2, \
539 BT_CODEC_QOS(10884u, BT_CODEC_QOS_FRAMED, \
540 BT_CODEC_QOS_2M, 130u, 5u, 31u, 40000u) \
541 )
542
543#define BT_AUDIO_LC3_UNICAST_PRESET_48_1_1 \
544 BT_AUDIO_LC3_PRESET( \
545 BT_CODEC_LC3_CONFIG_48_1, \
546 BT_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 5u, 15u, 40000u) \
547 )
548
549#define BT_AUDIO_LC3_UNICAST_PRESET_48_2_1 \
550 BT_AUDIO_LC3_PRESET( \
551 BT_CODEC_LC3_CONFIG_48_2, \
552 BT_CODEC_LC3_QOS_10_UNFRAMED(100u, 5u, 20u, 40000u) \
553 )
554
555#define BT_AUDIO_LC3_UNICAST_PRESET_48_3_1 \
556 BT_AUDIO_LC3_PRESET( \
557 BT_CODEC_LC3_CONFIG_48_3, \
558 BT_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 5u, 15u, 40000u) \
559 )
560
561#define BT_AUDIO_LC3_UNICAST_PRESET_48_4_1 \
562 BT_AUDIO_LC3_PRESET( \
563 BT_CODEC_LC3_CONFIG_48_4, \
564 BT_CODEC_LC3_QOS_10_UNFRAMED(120u, 5u, 20u, 40000u) \
565 )
566
567#define BT_AUDIO_LC3_UNICAST_PRESET_48_5_1 \
568 BT_AUDIO_LC3_PRESET( \
569 BT_CODEC_LC3_CONFIG_48_5, \
570 BT_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 5u, 15u, 40000u) \
571 )
572
573#define BT_AUDIO_LC3_UNICAST_PRESET_48_6_1 \
574 BT_AUDIO_LC3_PRESET( \
575 BT_CODEC_LC3_CONFIG_48_6, \
576 BT_CODEC_LC3_QOS_10_UNFRAMED(155u, 5u, 20u, 40000u) \
577 )
578
579/* Following presets are for unicast high reliability audio data */
580#define BT_AUDIO_LC3_UNICAST_PRESET_8_1_2 \
581 BT_AUDIO_LC3_PRESET( \
582 BT_CODEC_LC3_CONFIG_8_1, \
583 BT_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 13u, 75u, 40000u) \
584 )
585
586#define BT_AUDIO_LC3_UNICAST_PRESET_8_2_2 \
587 BT_AUDIO_LC3_PRESET( \
588 BT_CODEC_LC3_CONFIG_8_2, \
589 BT_CODEC_LC3_QOS_10_UNFRAMED(30u, 13u, 95u, 40000u) \
590 )
591
592#define BT_AUDIO_LC3_UNICAST_PRESET_16_1_2 \
593 BT_AUDIO_LC3_PRESET( \
594 BT_CODEC_LC3_CONFIG_16_1, \
595 BT_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 13u, 75u, 40000u) \
596 )
597
598#define BT_AUDIO_LC3_UNICAST_PRESET_16_2_2 \
599 BT_AUDIO_LC3_PRESET( \
600 BT_CODEC_LC3_CONFIG_16_2, \
601 BT_CODEC_LC3_QOS_10_UNFRAMED(40u, 13u, 95u, 40000u) \
602 )
603
604#define BT_AUDIO_LC3_UNICAST_PRESET_24_1_2 \
605 BT_AUDIO_LC3_PRESET( \
606 BT_CODEC_LC3_CONFIG_24_1, \
607 BT_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 13u, 75u, 40000u) \
608 )
609
610#define BT_AUDIO_LC3_UNICAST_PRESET_24_2_2 \
611 BT_AUDIO_LC3_PRESET( \
612 BT_CODEC_LC3_CONFIG_24_2, \
613 BT_CODEC_LC3_QOS_10_UNFRAMED(60u, 13u, 95u, 40000u) \
614 )
615
616#define BT_AUDIO_LC3_UNICAST_PRESET_32_1_2 \
617 BT_AUDIO_LC3_PRESET( \
618 BT_CODEC_LC3_CONFIG_32_1, \
619 BT_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 13u, 75u, 40000u) \
620 )
621
622#define BT_AUDIO_LC3_UNICAST_PRESET_32_2_2 \
623 BT_AUDIO_LC3_PRESET( \
624 BT_CODEC_LC3_CONFIG_32_2, \
625 BT_CODEC_LC3_QOS_10_UNFRAMED(80u, 13u, 95u, 40000u) \
626 )
627
628#define BT_AUDIO_LC3_UNICAST_PRESET_441_1_2 \
629 BT_AUDIO_LC3_PRESET( \
630 BT_CODEC_LC3_CONFIG_441_1, \
631 BT_CODEC_QOS(8163u, BT_CODEC_QOS_FRAMED, \
632 BT_CODEC_QOS_2M, 97u, 13u, 80u, 40000u) \
633 )
634
635#define BT_AUDIO_LC3_UNICAST_PRESET_441_2_2 \
636 BT_AUDIO_LC3_PRESET( \
637 BT_CODEC_LC3_CONFIG_441_2, \
638 BT_CODEC_QOS(10884u, BT_CODEC_QOS_FRAMED, \
639 BT_CODEC_QOS_2M, 130u, 13u, 85u, 40000u) \
640 )
641
642#define BT_AUDIO_LC3_UNICAST_PRESET_48_1_2 \
643 BT_AUDIO_LC3_PRESET( \
644 BT_CODEC_LC3_CONFIG_48_1, \
645 BT_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 13u, 75u, 40000u) \
646 )
647
648#define BT_AUDIO_LC3_UNICAST_PRESET_48_2_2 \
649 BT_AUDIO_LC3_PRESET( \
650 BT_CODEC_LC3_CONFIG_48_2, \
651 BT_CODEC_LC3_QOS_10_UNFRAMED(100u, 13u, 95u, 40000u) \
652 )
653
654#define BT_AUDIO_LC3_UNICAST_PRESET_48_3_2 \
655 BT_AUDIO_LC3_PRESET( \
656 BT_CODEC_LC3_CONFIG_48_3, \
657 BT_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 13u, 75u, 40000u) \
658 )
659
660#define BT_AUDIO_LC3_UNICAST_PRESET_48_4_2 \
661 BT_AUDIO_LC3_PRESET( \
662 BT_CODEC_LC3_CONFIG_48_4, \
663 BT_CODEC_LC3_QOS_10_UNFRAMED(120u, 13u, 100u, 40000u) \
664 )
665
666#define BT_AUDIO_LC3_UNICAST_PRESET_48_5_2 \
667 BT_AUDIO_LC3_PRESET( \
668 BT_CODEC_LC3_CONFIG_48_5, \
669 BT_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 13u, 75u, 40000u) \
670 )
671
672#define BT_AUDIO_LC3_UNICAST_PRESET_48_6_2 \
673 BT_AUDIO_LC3_PRESET( \
674 BT_CODEC_LC3_CONFIG_48_6, \
675 BT_CODEC_LC3_QOS_10_UNFRAMED(155u, 13u, 100u, 40000u) \
676 )
677
678/* LC3 Broadcast presets defined by table 6.4 in the BAP v1.0 specification */
679#define BT_AUDIO_LC3_BROADCAST_PRESET_8_1_1 \
680 BT_AUDIO_LC3_PRESET( \
681 BT_CODEC_LC3_CONFIG_8_1, \
682 BT_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 2u, 8u, 40000u) \
683 )
684
685#define BT_AUDIO_LC3_BROADCAST_PRESET_8_2_1 \
686 BT_AUDIO_LC3_PRESET( \
687 BT_CODEC_LC3_CONFIG_8_2, \
688 BT_CODEC_LC3_QOS_10_UNFRAMED(30u, 2u, 10u, 40000u) \
689 )
690
691#define BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1 \
692 BT_AUDIO_LC3_PRESET( \
693 BT_CODEC_LC3_CONFIG_16_1, \
694 BT_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 2u, 8u, 40000u) \
695 )
696
698#define BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1 \
699 BT_AUDIO_LC3_PRESET( \
700 BT_CODEC_LC3_CONFIG_16_2, \
701 BT_CODEC_LC3_QOS_10_UNFRAMED(40u, 2u, 10u, 40000u) \
702 )
703
704#define BT_AUDIO_LC3_BROADCAST_PRESET_24_1_1 \
705 BT_AUDIO_LC3_PRESET( \
706 BT_CODEC_LC3_CONFIG_24_1, \
707 BT_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 2u, 8u, 40000u) \
708 )
709
711#define BT_AUDIO_LC3_BROADCAST_PRESET_24_2_1 \
712 BT_AUDIO_LC3_PRESET( \
713 BT_CODEC_LC3_CONFIG_24_2, \
714 BT_CODEC_LC3_QOS_10_UNFRAMED(60u, 2u, 10u, 40000u) \
715 )
716
717#define BT_AUDIO_LC3_BROADCAST_PRESET_32_1_1 \
718 BT_AUDIO_LC3_PRESET( \
719 BT_CODEC_LC3_CONFIG_32_1, \
720 BT_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 2u, 8u, 40000u) \
721 )
722
723#define BT_AUDIO_LC3_BROADCAST_PRESET_32_2_1 \
724 BT_AUDIO_LC3_PRESET( \
725 BT_CODEC_LC3_CONFIG_32_2, \
726 BT_CODEC_LC3_QOS_10_UNFRAMED(80u, 2u, 10u, 40000u) \
727 )
728
729#define BT_AUDIO_LC3_BROADCAST_PRESET_441_1_1 \
730 BT_AUDIO_LC3_PRESET( \
731 BT_CODEC_LC3_CONFIG_441_1, \
732 BT_CODEC_QOS(8163u, BT_CODEC_QOS_FRAMED, \
733 BT_CODEC_QOS_2M, 97u, 4u, 24u, 40000u) \
734 )
735
736#define BT_AUDIO_LC3_BROADCAST_PRESET_441_2_1 \
737 BT_AUDIO_LC3_PRESET( \
738 BT_CODEC_LC3_CONFIG_441_2, \
739 BT_CODEC_QOS(10884u, BT_CODEC_QOS_FRAMED, \
740 BT_CODEC_QOS_2M, 130u, 4u, 31u, 40000u) \
741 )
742
743#define BT_AUDIO_LC3_BROADCAST_PRESET_48_1_1 \
744 BT_AUDIO_LC3_PRESET( \
745 BT_CODEC_LC3_CONFIG_48_1, \
746 BT_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 4u, 15u, 40000u) \
747 )
748
749#define BT_AUDIO_LC3_BROADCAST_PRESET_48_2_1 \
750 BT_AUDIO_LC3_PRESET( \
751 BT_CODEC_LC3_CONFIG_48_2, \
752 BT_CODEC_LC3_QOS_10_UNFRAMED(100u, 4u, 20u, 40000u) \
753 )
754
755#define BT_AUDIO_LC3_BROADCAST_PRESET_48_3_1 \
756 BT_AUDIO_LC3_PRESET( \
757 BT_CODEC_LC3_CONFIG_48_3, \
758 BT_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 4u, 15u, 40000u) \
759 )
760
761#define BT_AUDIO_LC3_BROADCAST_PRESET_48_4_1 \
762 BT_AUDIO_LC3_PRESET( \
763 BT_CODEC_LC3_CONFIG_48_4, \
764 BT_CODEC_LC3_QOS_10_UNFRAMED(120u, 4u, 20u, 40000u) \
765 )
766
767#define BT_AUDIO_LC3_BROADCAST_PRESET_48_5_1 \
768 BT_AUDIO_LC3_PRESET( \
769 BT_CODEC_LC3_CONFIG_48_5, \
770 BT_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 4u, 15u, 40000u) \
771 )
772
773#define BT_AUDIO_LC3_BROADCAST_PRESET_48_6_1 \
774 BT_AUDIO_LC3_PRESET( \
775 BT_CODEC_LC3_CONFIG_48_6, \
776 BT_CODEC_LC3_QOS_10_UNFRAMED(155u, 4u, 20u, 40000u) \
777 )
778
779/* Following presets are for broadcast high reliability audio data */
780#define BT_AUDIO_LC3_BROADCAST_PRESET_8_1_2 \
781 BT_AUDIO_LC3_PRESET( \
782 BT_CODEC_LC3_CONFIG_8_1, \
783 BT_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 4u, 45u, 40000u) \
784 )
785
786#define BT_AUDIO_LC3_BROADCAST_PRESET_8_2_2 \
787 BT_AUDIO_LC3_PRESET( \
788 BT_CODEC_LC3_CONFIG_8_2, \
789 BT_CODEC_LC3_QOS_10_UNFRAMED(30u, 4u, 60u, 40000u) \
790 )
791
792#define BT_AUDIO_LC3_BROADCAST_PRESET_16_1_2 \
793 BT_AUDIO_LC3_PRESET( \
794 BT_CODEC_LC3_CONFIG_16_1, \
795 BT_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 4u, 45u, 40000u) \
796 )
797
799#define BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2 \
800 BT_AUDIO_LC3_PRESET( \
801 BT_CODEC_LC3_CONFIG_16_2, \
802 BT_CODEC_LC3_QOS_10_UNFRAMED(40u, 4u, 60u, 40000u) \
803 )
804
805#define BT_AUDIO_LC3_BROADCAST_PRESET_24_1_2 \
806 BT_AUDIO_LC3_PRESET( \
807 BT_CODEC_LC3_CONFIG_24_1, \
808 BT_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 4u, 45u, 40000u) \
809 )
810
812#define BT_AUDIO_LC3_BROADCAST_PRESET_24_2_2 \
813 BT_AUDIO_LC3_PRESET( \
814 BT_CODEC_LC3_CONFIG_24_2, \
815 BT_CODEC_LC3_QOS_10_UNFRAMED(60u, 4u, 60u, 40000u) \
816 )
817
818#define BT_AUDIO_LC3_BROADCAST_PRESET_32_1_2 \
819 BT_AUDIO_LC3_PRESET( \
820 BT_CODEC_LC3_CONFIG_32_1, \
821 BT_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 4u, 45u, 40000u) \
822 )
823
824#define BT_AUDIO_LC3_BROADCAST_PRESET_32_2_2 \
825 BT_AUDIO_LC3_PRESET( \
826 BT_CODEC_LC3_CONFIG_32_2, \
827 BT_CODEC_LC3_QOS_10_UNFRAMED(80u, 4u, 60u, 40000u) \
828 )
829
830#define BT_AUDIO_LC3_BROADCAST_PRESET_441_1_2 \
831 BT_AUDIO_LC3_PRESET( \
832 BT_CODEC_LC3_CONFIG_441_1, \
833 BT_CODEC_QOS(8163u, BT_CODEC_QOS_FRAMED, \
834 BT_CODEC_QOS_2M, 97u, 4u, 54u, 40000u) \
835 )
836
837#define BT_AUDIO_LC3_BROADCAST_PRESET_441_2_2 \
838 BT_AUDIO_LC3_PRESET( \
839 BT_CODEC_LC3_CONFIG_441_2, \
840 BT_CODEC_QOS(10884u, BT_CODEC_QOS_FRAMED, \
841 BT_CODEC_QOS_2M, 130u, 4u, 60u, 40000u) \
842 )
843
844#define BT_AUDIO_LC3_BROADCAST_PRESET_48_1_2 \
845 BT_AUDIO_LC3_PRESET( \
846 BT_CODEC_LC3_CONFIG_48_1, \
847 BT_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 4u, 50u, 40000u) \
848 )
849
850#define BT_AUDIO_LC3_BROADCAST_PRESET_48_2_2 \
851 BT_AUDIO_LC3_PRESET( \
852 BT_CODEC_LC3_CONFIG_48_2, \
853 BT_CODEC_LC3_QOS_10_UNFRAMED(100u, 4u, 65u, 40000u) \
854 )
855
856#define BT_AUDIO_LC3_BROADCAST_PRESET_48_3_2 \
857 BT_AUDIO_LC3_PRESET( \
858 BT_CODEC_LC3_CONFIG_48_3, \
859 BT_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 4u, 50u, 40000u) \
860 )
861
862#define BT_AUDIO_LC3_BROADCAST_PRESET_48_4_2 \
863 BT_AUDIO_LC3_PRESET( \
864 BT_CODEC_LC3_CONFIG_48_4, \
865 BT_CODEC_LC3_QOS_10_UNFRAMED(120u, 4u, 65u, 40000u) \
866 )
867
868#define BT_AUDIO_LC3_BROADCAST_PRESET_48_5_2 \
869 BT_AUDIO_LC3_PRESET( \
870 BT_CODEC_LC3_CONFIG_48_5, \
871 BT_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 4u, 50u, 40000u) \
872 )
873
874#define BT_AUDIO_LC3_BROADCAST_PRESET_48_6_2 \
875 BT_AUDIO_LC3_PRESET( \
876 BT_CODEC_LC3_CONFIG_48_6, \
877 BT_CODEC_LC3_QOS_10_UNFRAMED(155u, 4u, 65u, 40000u) \
878 )
879
891 struct bt_conn *conn;
893 struct bt_audio_ep *ep;
903
904 union {
905 void *group;
906 struct bt_audio_unicast_group *unicast_group;
907 struct bt_audio_broadcast_source *broadcast_source;
908 struct bt_audio_broadcast_sink *broadcast_sink;
909 };
910
913};
914
934 int (*config)(struct bt_conn *conn,
935 const struct bt_audio_ep *ep,
936 enum bt_audio_dir dir,
937 const struct bt_codec *codec,
938 struct bt_audio_stream **stream,
939 struct bt_codec_qos_pref *const pref);
940
955 int (*reconfig)(struct bt_audio_stream *stream,
956 enum bt_audio_dir dir,
957 const struct bt_codec *codec,
958 struct bt_codec_qos_pref *const pref);
959
970 int (*qos)(struct bt_audio_stream *stream,
971 const struct bt_codec_qos *qos);
972
984 int (*enable)(struct bt_audio_stream *stream,
985 const struct bt_codec_data *meta,
986 size_t meta_count);
987
997 int (*start)(struct bt_audio_stream *stream);
998
1010 int (*metadata)(struct bt_audio_stream *stream,
1011 const struct bt_codec_data *meta,
1012 size_t meta_count);
1013
1023 int (*disable)(struct bt_audio_stream *stream);
1024
1034 int (*stop)(struct bt_audio_stream *stream);
1035
1045 int (*release)(struct bt_audio_stream *stream);
1046
1070 int (*publish_capability)(struct bt_conn *conn, uint8_t type,
1071 uint8_t index, struct bt_codec *const codec);
1072
1073#if defined(CONFIG_BT_PAC_SNK_LOC) || defined(CONFIG_BT_PAC_SRC_LOC)
1090 int (*publish_location)(struct bt_conn *conn,
1091 enum bt_audio_dir dir,
1092 enum bt_audio_location *location);
1093
1094#if defined(CONFIG_BT_PAC_SNK_LOC_WRITEABLE) || defined(CONFIG_BT_PAC_SRC_LOC_WRITEABLE)
1106 int (*write_location)(struct bt_conn *conn, enum bt_audio_dir dir,
1107 enum bt_audio_location location);
1108#endif /* CONFIG_BT_PAC_SNK_LOC_WRITEABLE || CONFIG_BT_PAC_SRC_LOC_WRITEABLE */
1109#endif /* CONFIG_BT_PAC_SNK_LOC || CONFIG_BT_PAC_SRC_LOC */
1110};
1111
1125 bool (*scan_recv)(const struct bt_le_scan_recv_info *info,
1126 uint32_t broadcast_id);
1127
1139 void (*pa_synced)(struct bt_audio_broadcast_sink *sink,
1140 struct bt_le_per_adv_sync *sync,
1141 uint32_t broadcast_id);
1142
1151 void (*base_recv)(struct bt_audio_broadcast_sink *sink,
1152 const struct bt_audio_base *base);
1153
1166 void (*syncable)(struct bt_audio_broadcast_sink *sink, bool encrypted);
1167
1181 void (*scan_term)(int err);
1182
1192 void (*pa_sync_lost)(struct bt_audio_broadcast_sink *sink);
1193
1194 /* Internally used list node */
1196};
1197
1200#if defined(CONFIG_BT_AUDIO_UNICAST)
1209 void (*configured)(struct bt_audio_stream *stream,
1210 const struct bt_codec_qos_pref *pref);
1211
1219 void (*qos_set)(struct bt_audio_stream *stream);
1220
1228 void (*enabled)(struct bt_audio_stream *stream);
1229
1237 void (*metadata_updated)(struct bt_audio_stream *stream);
1238
1246 void (*disabled)(struct bt_audio_stream *stream);
1247
1255 void (*released)(struct bt_audio_stream *stream);
1256#endif /* CONFIG_BT_AUDIO_UNICAST */
1257
1265 void (*started)(struct bt_audio_stream *stream);
1266
1274 void (*stopped)(struct bt_audio_stream *stream);
1275
1276#if defined(CONFIG_BT_AUDIO_UNICAST) || defined(CONFIG_BT_AUDIO_BROADCAST_SINK)
1288 void (*recv)(struct bt_audio_stream *stream,
1289 const struct bt_iso_recv_info *info,
1290 struct net_buf *buf);
1291#endif /* CONFIG_BT_AUDIO_UNICAST || CONFIG_BT_AUDIO_BROADCAST_SINK */
1292
1293#if defined(CONFIG_BT_AUDIO_UNICAST) || defined(CONFIG_BT_AUDIO_BROADCAST_SOURCE)
1303 void (*sent)(struct bt_audio_stream *stream);
1304#endif /* CONFIG_BT_AUDIO_UNICAST || CONFIG_BT_AUDIO_BROADCAST_SOURCE */
1305
1306};
1307
1316 struct bt_audio_stream_ops *ops);
1333
1344
1354 /* End of group bt_audio_server */
1356
1364
1370typedef void (*bt_audio_discover_func_t)(struct bt_conn *conn,
1371 struct bt_codec *codec,
1372 struct bt_audio_ep *ep,
1373 struct bt_audio_discover_params *params);
1374
1388};
1389
1401int bt_audio_discover(struct bt_conn *conn,
1402 struct bt_audio_discover_params *params);
1403
1416int bt_audio_stream_config(struct bt_conn *conn,
1417 struct bt_audio_stream *stream,
1418 struct bt_audio_ep *ep,
1419 struct bt_codec *codec);
1420
1434 struct bt_codec *codec);
1435
1449int bt_audio_stream_qos(struct bt_conn *conn,
1450 struct bt_audio_unicast_group *group,
1451 struct bt_codec_qos *qos);
1452
1467 struct bt_codec_data *meta,
1468 size_t meta_count);
1469
1481 struct bt_codec_data *meta,
1482 size_t meta_count);
1483
1496
1510
1524
1540int bt_audio_stream_release(struct bt_audio_stream *stream, bool cache);
1541
1554int bt_audio_stream_send(struct bt_audio_stream *stream, struct net_buf *buf);
1555
1570 size_t num_stream,
1571 struct bt_audio_unicast_group **unicast_group);
1572
1590int bt_audio_unicast_group_add_streams(struct bt_audio_unicast_group *unicast_group,
1591 struct bt_audio_stream *streams[],
1592 size_t num_stream);
1593
1610int bt_audio_unicast_group_remove_streams(struct bt_audio_unicast_group *unicast_group,
1611 struct bt_audio_stream *streams[],
1612 size_t num_stream);
1613
1623int bt_audio_unicast_group_delete(struct bt_audio_unicast_group *unicast_group);
1624 /* End of group bt_audio_client */
1626
1627
1656 size_t num_stream,
1657 struct bt_codec *codec,
1658 struct bt_codec_qos *qos,
1659 struct bt_audio_broadcast_source **source);
1660
1672int bt_audio_broadcast_source_reconfig(struct bt_audio_broadcast_source *source,
1673 struct bt_codec *codec,
1674 struct bt_codec_qos *qos);
1675
1686int bt_audio_broadcast_source_start(struct bt_audio_broadcast_source *source);
1687
1698int bt_audio_broadcast_source_stop(struct bt_audio_broadcast_source *source);
1699
1710int bt_audio_broadcast_source_delete(struct bt_audio_broadcast_source *source);
1711
1717
1731
1740
1758int bt_audio_broadcast_sink_sync(struct bt_audio_broadcast_sink *sink,
1759 uint32_t indexes_bitfield,
1760 struct bt_audio_stream *streams[],
1761 struct bt_codec *codec,
1762 const uint8_t broadcast_code[16]);
1763
1774int bt_audio_broadcast_sink_stop(struct bt_audio_broadcast_sink *sink);
1775
1787int bt_audio_broadcast_sink_delete(struct bt_audio_broadcast_sink *sink);
1788 /* End of bt_audio_broadcast */
1790
1791
1805
1808
1811
1814
1817};
1818
1826int bt_codec_cfg_get_freq(const struct bt_codec *codec);
1827
1836
1851int bt_codec_cfg_get_chan_allocation_val(const struct bt_codec *codec, uint32_t *chan_allocation);
1852
1870
1890int bt_codec_cfg_get_frame_blocks_per_sdu(const struct bt_codec *codec, bool fallback_to_default);
1891
1907bool bt_codec_get_val(const struct bt_codec *codec,
1908 uint8_t type,
1909 const struct bt_codec_data **data);
1910 /* End of bt_audio_codec_cfg */
1912
1913#ifdef __cplusplus
1914}
1915#endif
1916 /* end of bt_audio */
1918
1919#endif /* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_H_ */
Bluetooth data buffer API.
ZTEST_BMEM int index[(3)]
Definition: main.c:32
Bluetooth connection handling.
Generic Attribute Profile handling.
int bt_audio_broadcast_source_create(struct bt_audio_stream *streams[], size_t num_stream, struct bt_codec *codec, struct bt_codec_qos *qos, struct bt_audio_broadcast_source **source)
Create audio broadcast source.
int bt_audio_broadcast_sink_delete(struct bt_audio_broadcast_sink *sink)
Release a broadcast sink.
int bt_audio_broadcast_source_delete(struct bt_audio_broadcast_source *source)
Delete audio broadcast source.
void bt_audio_broadcast_sink_register_cb(struct bt_audio_broadcast_sink_cb *cb)
Register Broadcast sink callbacks *.
int bt_audio_broadcast_sink_scan_start(const struct bt_le_scan_param *param)
Start scan for broadcast sources.
int bt_audio_broadcast_sink_sync(struct bt_audio_broadcast_sink *sink, uint32_t indexes_bitfield, struct bt_audio_stream *streams[], struct bt_codec *codec, const uint8_t broadcast_code[16])
Sync to a broadcaster's audio.
int bt_audio_broadcast_sink_stop(struct bt_audio_broadcast_sink *sink)
Stop audio broadcast sink.
int bt_audio_broadcast_sink_scan_stop(void)
Stop scan for broadcast sources.
int bt_audio_broadcast_source_reconfig(struct bt_audio_broadcast_source *source, struct bt_codec *codec, struct bt_codec_qos *qos)
Reconfigure audio broadcast source.
int bt_audio_broadcast_source_stop(struct bt_audio_broadcast_source *source)
Stop audio broadcast source.
int bt_audio_broadcast_source_start(struct bt_audio_broadcast_source *source)
Start audio broadcast source.
int bt_audio_unicast_group_add_streams(struct bt_audio_unicast_group *unicast_group, struct bt_audio_stream *streams[], size_t num_stream)
Add streams to a unicast group as a unicast client.
int bt_audio_stream_reconfig(struct bt_audio_stream *stream, struct bt_codec *codec)
Reconfigure Audio Stream.
int bt_audio_stream_qos(struct bt_conn *conn, struct bt_audio_unicast_group *group, struct bt_codec_qos *qos)
Configure Audio Stream QoS.
int bt_audio_stream_enable(struct bt_audio_stream *stream, struct bt_codec_data *meta, size_t meta_count)
Enable Audio Stream.
int bt_audio_stream_start(struct bt_audio_stream *stream)
Start Audio Stream.
int bt_audio_unicast_group_delete(struct bt_audio_unicast_group *unicast_group)
Delete audio unicast group.
int bt_audio_unicast_group_create(struct bt_audio_stream *streams[], size_t num_stream, struct bt_audio_unicast_group **unicast_group)
Create audio unicast group.
int bt_audio_discover(struct bt_conn *conn, struct bt_audio_discover_params *params)
Discover remote capabilities and endpoints.
int bt_audio_unicast_group_remove_streams(struct bt_audio_unicast_group *unicast_group, struct bt_audio_stream *streams[], size_t num_stream)
Remove streams from a unicast group as a unicast client.
void(* bt_audio_discover_func_t)(struct bt_conn *conn, struct bt_codec *codec, struct bt_audio_ep *ep, struct bt_audio_discover_params *params)
Discover Audio capabilities and endpoints callback function.
Definition: audio.h:1370
int bt_audio_stream_release(struct bt_audio_stream *stream, bool cache)
Release Audio Stream.
int bt_audio_stream_send(struct bt_audio_stream *stream, struct net_buf *buf)
Send data to Audio stream.
int bt_audio_stream_stop(struct bt_audio_stream *stream)
Stop Audio Stream.
int bt_audio_stream_config(struct bt_conn *conn, struct bt_audio_stream *stream, struct bt_audio_ep *ep, struct bt_codec *codec)
Configure Audio Stream.
int bt_audio_stream_disable(struct bt_audio_stream *stream)
Disable Audio Stream.
int bt_audio_stream_metadata(struct bt_audio_stream *stream, struct bt_codec_data *meta, size_t meta_count)
Change Audio Stream Metadata.
bt_audio_codec_parse_err
Codec parser error codes for Codec config parsing APIs.
Definition: audio.h:1804
int bt_codec_cfg_get_octets_per_frame(const struct bt_codec *codec)
Extract frame size in octets from BT codec config.
int bt_codec_cfg_get_frame_blocks_per_sdu(const struct bt_codec *codec, bool fallback_to_default)
Extract number of audio frame blockss in each SDU from BT codec config.
bool bt_codec_get_val(const struct bt_codec *codec, uint8_t type, const struct bt_codec_data **data)
Lookup a specific value based on type.
int bt_codec_cfg_get_freq(const struct bt_codec *codec)
Extract the frequency from a codec configuration.
int bt_codec_cfg_get_frame_duration_us(const struct bt_codec *codec)
Extract frame duration from BT codec config.
int bt_codec_cfg_get_chan_allocation_val(const struct bt_codec *codec, uint32_t *chan_allocation)
Extract channel allocation from BT codec config.
@ BT_AUDIO_CODEC_PARSE_ERR_SUCCESS
The requested type is not present in the data set.
Definition: audio.h:1807
@ BT_AUDIO_CODEC_PARSE_ERR_TYPE_NOT_FOUND
The requested type is not present in the data set.
Definition: audio.h:1810
@ BT_AUDIO_CODEC_PARSE_ERR_INVALID_VALUE_FOUND
The value found is invalid.
Definition: audio.h:1813
@ BT_AUDIO_CODEC_PARSE_ERR_INVALID_PARAM
The parameters specified to the function call are not valid.
Definition: audio.h:1816
int bt_audio_unicast_server_register_cb(const struct bt_audio_unicast_server_cb *cb)
Register unicast server callbacks.
int bt_audio_unicast_server_location_changed(enum bt_audio_dir dir)
Notify location changed.
int bt_audio_unicast_server_unregister_cb(const struct bt_audio_unicast_server_cb *cb)
Unregister unicast server callbacks.
#define BROADCAST_SNK_SUBGROUP_CNT
Definition: audio.h:149
bt_audio_dir
Audio Capability type.
Definition: audio.h:309
#define BROADCAST_SNK_STREAM_CNT
Definition: audio.h:148
bt_audio_location
Location values for BT Audio.
Definition: audio.h:224
bt_audio_meta_type
Meta data type ids used for LTV encoded metadata.
Definition: audio.h:208
void bt_audio_stream_cb_register(struct bt_audio_stream *stream, struct bt_audio_stream_ops *ops)
Register Audio callbacks for a stream.
#define BT_CODEC_QOS_FRAMED(_interval, _sdu, _rtn, _latency, _pd)
Helper to declare Input Framed bt_codec_qos.
Definition: audio.h:372
#define BT_CODEC_QOS_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd)
Helper to declare Input Unframed bt_codec_qos.
Definition: audio.h:359
@ BT_CODEC_QOS_2M
Definition: audio.h:346
@ BT_CODEC_QOS_CODED
Definition: audio.h:347
@ BT_CODEC_QOS_1M
Definition: audio.h:345
@ BT_AUDIO_DIR_SINK
Definition: audio.h:310
@ BT_AUDIO_DIR_SOURCE
Definition: audio.h:311
@ BT_AUDIO_LOCATION_FRONT_CENTER
Definition: audio.h:227
@ BT_AUDIO_LOCATION_TOP_BACK_LEFT
Definition: audio.h:241
@ BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2
Definition: audio.h:234
@ BT_AUDIO_LOCATION_TOP_SIDE_RIGHT
Definition: audio.h:244
@ BT_AUDIO_LOCATION_FRONT_RIGHT
Definition: audio.h:226
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT
Definition: audio.h:248
@ BT_AUDIO_LOCATION_BACK_RIGHT
Definition: audio.h:230
@ BT_AUDIO_LOCATION_TOP_CENTER
Definition: audio.h:240
@ BT_AUDIO_LOCATION_LEFT_SURROUND
Definition: audio.h:251
@ BT_AUDIO_LOCATION_TOP_FRONT_RIGHT
Definition: audio.h:238
@ BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER
Definition: audio.h:232
@ BT_AUDIO_LOCATION_TOP_BECK_RIGHT
Definition: audio.h:242
@ BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE
Definition: audio.h:250
@ BT_AUDIO_LOCATION_BACK_LEFT
Definition: audio.h:229
@ BT_AUDIO_LOCATION_RIGHT_SURROUND
Definition: audio.h:252
@ BT_AUDIO_LOCATION_SIDE_RIGHT
Definition: audio.h:236
@ BT_AUDIO_LOCATION_TOP_FRONT_LEFT
Definition: audio.h:237
@ BT_AUDIO_LOCATION_SIDE_LEFT
Definition: audio.h:235
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT
Definition: audio.h:247
@ BT_AUDIO_LOCATION_TOP_FRONT_CENTER
Definition: audio.h:239
@ BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1
Definition: audio.h:228
@ BT_AUDIO_LOCATION_FRONT_LEFT
Definition: audio.h:225
@ BT_AUDIO_LOCATION_FRONT_LEFT_WIDE
Definition: audio.h:249
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER
Definition: audio.h:246
@ BT_AUDIO_LOCATION_BACK_CENTER
Definition: audio.h:233
@ BT_AUDIO_LOCATION_TOP_SIDE_LEFT
Definition: audio.h:243
@ BT_AUDIO_LOCATION_TOP_BACK_CENTER
Definition: audio.h:245
@ BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER
Definition: audio.h:231
@ BT_CODEC_META_PROGRAM_INFO
Definition: audio.h:211
@ BT_CODEC_META_VENDOR_SPECIFIC
Definition: audio.h:217
@ BT_CODEC_META_LANGUAGE
Definition: audio.h:212
@ BT_CODEC_META_CCID_LIST
Definition: audio.h:213
@ BT_CODEC_META_PROGRAM_INFO_URI
Definition: audio.h:215
@ BT_CODEC_META_EXTENDED_METADATA
Definition: audio.h:216
@ BT_CODEC_META_PREFER_CONTEXT
Definition: audio.h:209
@ BT_CODEC_META_CONTEXT
Definition: audio.h:210
@ BT_CODEC_META_PARENTAL_RATING
Definition: audio.h:214
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition: util_macro.h:44
Bluetooth ISO handling.
Bluetooth LC3 codec handling.
static ssize_t recv(int sock, void *buf, size_t max_len, int flags)
Definition: socket.h:66
struct _snode sys_snode_t
Definition: slist.h:33
#define bool
Definition: stdbool.h:13
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Definition: audio.h:273
uint8_t index
Definition: audio.h:275
struct bt_codec_data data[CONFIG_BT_CODEC_MAX_DATA_COUNT]
Definition: audio.h:285
size_t data_count
Definition: audio.h:280
Definition: audio.h:288
size_t bis_count
Definition: audio.h:290
struct bt_audio_base_bis_data bis_data[0]
Definition: audio.h:298
struct bt_codec codec
Definition: audio.h:296
Definition: audio.h:301
struct bt_audio_base_subgroup subgroups[0]
Definition: audio.h:305
size_t subgroup_count
Definition: audio.h:303
Definition: audio.h:1113
void(* scan_term)(int err)
Scan terminated callback.
Definition: audio.h:1181
bool(* scan_recv)(const struct bt_le_scan_recv_info *info, uint32_t broadcast_id)
Scan receive callback.
Definition: audio.h:1125
void(* syncable)(struct bt_audio_broadcast_sink *sink, bool encrypted)
Broadcast sink is syncable.
Definition: audio.h:1166
void(* pa_synced)(struct bt_audio_broadcast_sink *sink, struct bt_le_per_adv_sync *sync, uint32_t broadcast_id)
Periodic advertising sync callback.
Definition: audio.h:1139
void(* base_recv)(struct bt_audio_broadcast_sink *sink, const struct bt_audio_base *base)
Broadcast Audio Source Endpoint (BASE) received.
Definition: audio.h:1151
sys_snode_t node
Definition: audio.h:1195
void(* pa_sync_lost)(struct bt_audio_broadcast_sink *sink)
Periodic advertising synchronization lost callback.
Definition: audio.h:1192
Definition: audio.h:1375
uint8_t num_caps
Definition: audio.h:1381
uint8_t err
Definition: audio.h:1385
enum bt_audio_dir dir
Definition: audio.h:1377
uint8_t num_eps
Definition: audio.h:1383
struct bt_gatt_read_params read
Definition: audio.h:1386
struct bt_gatt_discover_params discover
Definition: audio.h:1387
bt_audio_discover_func_t func
Definition: audio.h:1379
Definition: audio.h:464
struct bt_codec codec
Definition: audio.h:466
struct bt_codec_qos qos
Definition: audio.h:468
Stream operation.
Definition: audio.h:1199
void(* stopped)(struct bt_audio_stream *stream)
Stream stopped callback.
Definition: audio.h:1274
void(* started)(struct bt_audio_stream *stream)
Stream started callback.
Definition: audio.h:1265
Audio stream structure.
Definition: audio.h:889
struct bt_audio_stream_ops * ops
Definition: audio.h:901
sys_snode_t node
Definition: audio.h:902
struct bt_audio_unicast_group * unicast_group
Definition: audio.h:906
struct bt_audio_broadcast_sink * broadcast_sink
Definition: audio.h:908
struct bt_codec * codec
Definition: audio.h:895
void * group
Definition: audio.h:905
struct bt_conn * conn
Definition: audio.h:891
struct bt_audio_ep * ep
Definition: audio.h:893
struct bt_audio_broadcast_source * broadcast_source
Definition: audio.h:907
struct bt_iso_chan * iso
Definition: audio.h:899
struct bt_codec_qos * qos
Definition: audio.h:897
void * user_data
Definition: audio.h:912
Definition: audio.h:916
int(* reconfig)(struct bt_audio_stream *stream, enum bt_audio_dir dir, const struct bt_codec *codec, struct bt_codec_qos_pref *const pref)
Stream reconfig request callback.
Definition: audio.h:955
int(* qos)(struct bt_audio_stream *stream, const struct bt_codec_qos *qos)
Stream QoS request callback.
Definition: audio.h:970
int(* start)(struct bt_audio_stream *stream)
Stream Start request callback.
Definition: audio.h:997
int(* stop)(struct bt_audio_stream *stream)
Stream Stop callback.
Definition: audio.h:1034
int(* enable)(struct bt_audio_stream *stream, const struct bt_codec_data *meta, size_t meta_count)
Stream Enable request callback.
Definition: audio.h:984
int(* disable)(struct bt_audio_stream *stream)
Stream Disable request callback.
Definition: audio.h:1023
int(* release)(struct bt_audio_stream *stream)
Stream release callback.
Definition: audio.h:1045
int(* config)(struct bt_conn *conn, const struct bt_audio_ep *ep, enum bt_audio_dir dir, const struct bt_codec *codec, struct bt_audio_stream **stream, struct bt_codec_qos_pref *const pref)
Endpoint config request callback.
Definition: audio.h:934
int(* publish_capability)(struct bt_conn *conn, uint8_t type, uint8_t index, struct bt_codec *const codec)
Publish Capability callback.
Definition: audio.h:1070
int(* metadata)(struct bt_audio_stream *stream, const struct bt_codec_data *meta, size_t meta_count)
Stream Metadata update request callback.
Definition: audio.h:1010
Codec configuration structure.
Definition: audio.h:162
struct bt_data data
Definition: audio.h:163
uint8_t value[CONFIG_BT_CODEC_MAX_DATA_LEN]
Definition: audio.h:164
Audio Stream Quality of Service Preference structure.
Definition: audio.h:425
bool unframed_supported
Unframed PDUs supported.
Definition: audio.h:431
uint32_t pd_min
Minimum Presentation Delay.
Definition: audio.h:447
uint32_t pref_pd_min
Preferred minimum Presentation Delay.
Definition: audio.h:457
uint32_t pd_max
Maximum Presentation Delay.
Definition: audio.h:454
uint8_t rtn
Definition: audio.h:437
uint8_t phy
Definition: audio.h:434
uint16_t latency
Definition: audio.h:440
uint32_t pref_pd_max
Preferred maximum Presentation Delay
Definition: audio.h:460
Codec QoS structure.
Definition: audio.h:377
uint8_t phy
Definition: audio.h:379
uint8_t framing
Definition: audio.h:382
uint32_t pd
Definition: audio.h:396
uint16_t latency
Definition: audio.h:391
uint32_t interval
Definition: audio.h:394
uint8_t rtn
Definition: audio.h:385
uint16_t sdu
Definition: audio.h:388
Codec structure.
Definition: audio.h:256
struct bt_codec_data data[CONFIG_BT_CODEC_MAX_DATA_COUNT]
Definition: audio.h:266
size_t meta_count
Definition: audio.h:268
uint16_t cid
Definition: audio.h:260
size_t data_count
Definition: audio.h:264
uint8_t id
Definition: audio.h:258
uint16_t vid
Definition: audio.h:262
struct bt_codec_data meta[CONFIG_BT_CODEC_MAX_METADATA_COUNT]
Definition: audio.h:270
Bluetooth data.
Definition: bluetooth.h:342
GATT Discover Attributes parameters.
Definition: gatt.h:1337
uint8_t type
Definition: gatt.h:1357
GATT Read parameters.
Definition: gatt.h:1421
ISO Channel structure.
Definition: iso.h:114
ISO Meta Data structure for received ISO packets.
Definition: iso.h:206
Definition: bluetooth.h:1691
Definition: bluetooth.h:1728
Network buffer representation.
Definition: buf.h:915
static fdata_t data[2]
Definition: test_fifo_contexts.c:15