@@ -19,225 +19,12 @@ extern "C" {
1919/* Get list of capabilities by type */
2020sys_slist_t * bt_audio_capability_get (enum bt_audio_dir dir );
2121
22-
23- /** @brief Audio Capability type */
24- enum bt_audio_capability_framing {
25- BT_AUDIO_CAPABILITY_UNFRAMED_SUPPORTED = 0x00 ,
26- BT_AUDIO_CAPABILITY_UNFRAMED_NOT_SUPPORTED = 0x01 ,
27- };
28-
29- /**
30- * @brief Helper to declare elements of @ref bt_audio_capability_pref
31- *
32- * @param _framing Framing Support
33- * @param _phy Preferred Target PHY
34- * @param _rtn Preferred Retransmission number
35- * @param _latency Preferred Maximum Transport Latency (msec)
36- * @param _pd_min Minimum Presentation Delay (usec)
37- * @param _pd_max Maximum Presentation Delay (usec)
38- * @param _pref_pd_min Preferred Minimum Presentation Delay (usec)
39- * @param _pref_pd_max Preferred Maximum Presentation Delay (usec)
40- */
41- #define BT_AUDIO_CAPABILITY_PREF (_framing , _phy , _rtn , _latency , _pd_min , \
42- _pd_max , _pref_pd_min , _pref_pd_max ) \
43- { \
44- .framing = _framing, \
45- .phy = _phy, \
46- .rtn = _rtn, \
47- .latency = _latency, \
48- .pd_min = _pd_min, \
49- .pd_max = _pd_max, \
50- .pref_pd_min = _pref_pd_min, \
51- .pref_pd_max = _pref_pd_max, \
52- }
53-
54- /** @brief Audio Capability Preference structure. */
55- struct bt_audio_capability_pref {
56- /** @brief Framing support value
57- *
58- * Unlike the other fields, this is not a preference but whether
59- * the capability supports unframed ISOAL PDUs.
60- *
61- * Possible values: BT_AUDIO_CAPABILITY_UNFRAMED_SUPPORTED and
62- * BT_AUDIO_CAPABILITY_UNFRAMED_NOT_SUPPORTED.
63- */
64- uint8_t framing ;
65-
66- /** Preferred PHY */
67- uint8_t phy ;
68-
69- /** Preferred Retransmission Number */
70- uint8_t rtn ;
71-
72- /** Preferred Transport Latency in ms */
73- uint16_t latency ;
74-
75- /** @brief Minimum Presentation Delay in us
76- *
77- * Unlike the other fields, this is not a preference but a minimum
78- * requirement.
79- */
80- uint32_t pd_min ;
81-
82- /** @brief Maximum Presentation Delay in us
83- *
84- * Unlike the other fields, this is not a preference but a maximum
85- * requirement.
86- */
87- uint32_t pd_max ;
88-
89- /** @brief Preferred minimum Presentation Delay in us*/
90- uint32_t pref_pd_min ;
91-
92- /** @brief Preferred maximum Presentation Delay in us */
93- uint32_t pref_pd_max ;
94- };
95-
96- struct bt_audio_capability ; /* Handle circular dependency */
97-
98- /** @brief Capability operations structure.
99- *
100- * These are only used for unicast streams and broadcast sink streams.
101- */
102- struct bt_audio_capability_ops {
103- /** @brief Capability config callback
104- *
105- * Config callback is called whenever a new Audio Stream needs to be
106- * allocated.
107- *
108- * @param conn Connection object
109- * @param ep Remote Audio Endpoint being configured
110- * @param dir Direction of the endpoint.
111- * @param cap Local Audio Capability being configured
112- * @param codec Codec configuration
113- *
114- * @return Allocated Audio Stream object or NULL in case of error.
115- */
116- struct bt_audio_stream * (* config )(struct bt_conn * conn ,
117- struct bt_audio_ep * ep ,
118- enum bt_audio_dir dir ,
119- struct bt_audio_capability * cap ,
120- struct bt_codec * codec );
121-
122- /** @brief Capability reconfig callback
123- *
124- * Reconfig callback is called whenever an Audio Stream needs to be
125- * reconfigured with different codec configuration.
126- *
127- * @param stream Stream object being reconfigured.
128- * @param cap Local Audio Capability being reconfigured
129- * @param codec Codec configuration
130- *
131- * @return 0 in case of success or negative value in case of error.
132- */
133- int (* reconfig )(struct bt_audio_stream * stream ,
134- struct bt_audio_capability * cap ,
135- struct bt_codec * codec );
136-
137- /** @brief Capability QoS callback
138- *
139- * QoS callback is called whenever an Audio Stream Quality of
140- * Service needs to be configured.
141- *
142- * @param stream Stream object being reconfigured.
143- * @param QoS Quality of Service configuration
144- *
145- * @return 0 in case of success or negative value in case of error.
146- */
147- int (* qos )(struct bt_audio_stream * stream , struct bt_codec_qos * qos );
148-
149- /** @brief Capability Enable callback
150- *
151- * Enable callback is called whenever an Audio Stream is about to be
152- * enabled.
153- *
154- * @param stream Stream object being enabled.
155- * @param meta_count Number of metadata entries
156- * @param meta Metadata entries
157- *
158- * @return 0 in case of success or negative value in case of error.
159- */
160- int (* enable )(struct bt_audio_stream * stream ,
161- struct bt_codec_data * meta ,
162- size_t meta_count );
163-
164- /** @brief Capability Start callback
165- *
166- * Start callback is called whenever an Audio Stream is about to
167- * start streaming.
168- *
169- * @param stream Stream object.
170- *
171- * @return 0 in case of success or negative value in case of error.
172- */
173- int (* start )(struct bt_audio_stream * stream );
174-
175- /** @brief Capability Metadata callback
176- *
177- * Metadata callback is called whenever an Audio Stream needs to
178- * update its metadata.
179- *
180- * @param stream Stream object.
181- * @param meta_count Number of metadata entries
182- * @param meta Metadata entries
183- *
184- * @return 0 in case of success or negative value in case of error.
185- */
186- int (* metadata )(struct bt_audio_stream * stream ,
187- struct bt_codec_data * meta ,
188- size_t meta_count );
189-
190- /** @brief Capability Disable callback
191- *
192- * Disable callback is called whenever an Audio Stream is about to be
193- * disabled.
194- *
195- * @param stream Stream object being disabled.
196- *
197- * @return 0 in case of success or negative value in case of error.
198- */
199- int (* disable )(struct bt_audio_stream * stream );
200-
201- /** @brief Capability Stop callback
202- *
203- * Stop callback is called whenever an Audio Stream is about to
204- * stop streaming.
205- *
206- * @param stream Stream object.
207- *
208- * @return 0 in case of success or negative value in case of error.
209- */
210- int (* stop )(struct bt_audio_stream * stream );
211-
212- /** @brief Capability release callback
213- *
214- * Release callback is called whenever a new Audio Stream needs to be
215- * deallocated.
216- *
217- * @param stream Stream object.
218- *
219- * @return 0 in case of success or negative value in case of error.
220- */
221- int (* release )(struct bt_audio_stream * stream );
222- };
223-
224- /** @brief Audio Capability structure.
225- *
226- * Audio Capability represents a Local Codec including its preferrable
227- * Quality of service.
228- *
229- */
22+ /** @brief Audio Capability structure. */
23023struct bt_audio_capability {
23124 /** Capability direction */
23225 enum bt_audio_dir dir ;
23326 /** Capability codec reference */
23427 struct bt_codec * codec ;
235- #if defined(CONFIG_BT_AUDIO_UNICAST_SERVER )
236- /** Capability preferences */
237- struct bt_audio_capability_pref pref ;
238- /** Capability operations reference */
239- struct bt_audio_capability_ops * ops ;
240- #endif /* CONFIG_BT_AUDIO_UNICAST_SERVER */
24128
24229 /* Internally used list node */
24330 sys_snode_t _node ;
0 commit comments