Zephyr Project API
3.3.0
A Scalable Open Source RTOS
|
Common Audio Profile (CAP) More...
Data Structures | |
struct | bt_cap_initiator_cb |
union | bt_cap_set_member |
struct | bt_cap_stream |
struct | bt_cap_unicast_audio_start_param |
struct | bt_cap_broadcast_audio_start_param |
struct | bt_cap_unicast_to_broadcast_param |
struct | bt_cap_broadcast_to_unicast_param |
Enumerations | |
enum | bt_cap_set_type { BT_CAP_SET_TYPE_AD_HOC , BT_CAP_SET_TYPE_CSIP } |
Functions | |
int | bt_cap_acceptor_register (const struct bt_csip_set_member_register_param *param, struct bt_csip_set_member_svc_inst **svc_inst) |
Register the Common Audio Service. More... | |
int | bt_cap_initiator_unicast_discover (struct bt_conn *conn) |
Discovers audio support on a remote device. More... | |
void | bt_cap_stream_ops_register (struct bt_cap_stream *stream, struct bt_audio_stream_ops *ops) |
Register Audio operations for a Common Audio Profile stream. More... | |
int | bt_cap_initiator_register_cb (const struct bt_cap_initiator_cb *cb) |
Register Common Audio Profile callbacks. More... | |
int | bt_cap_initiator_unicast_audio_start (const struct bt_cap_unicast_audio_start_param *param, struct bt_audio_unicast_group **unicast_group) |
Setup and start unicast audio streams for a set of devices. More... | |
int | bt_cap_initiator_unicast_audio_update (struct bt_audio_unicast_group *unicast_group, uint8_t meta_count, const struct bt_codec_data *meta) |
Update unicast audio streams for a unicast group. More... | |
int | bt_cap_initiator_unicast_audio_stop (struct bt_audio_unicast_group *unicast_group) |
Stop unicast audio streams for a unicast group. More... | |
int | bt_cap_initiator_broadcast_audio_start (const struct bt_cap_broadcast_audio_start_param *param, struct bt_audio_broadcast_source **source) |
Start broadcast audio. More... | |
int | bt_cap_initiator_broadcast_audio_update (struct bt_audio_broadcast_source *broadcast_source, uint8_t meta_count, const struct bt_codec_data *meta) |
Update broadcast audio streams for a broadcast source. More... | |
int | bt_cap_initiator_broadcast_audio_stop (struct bt_audio_broadcast_source *broadcast_source) |
Stop broadcast audio streams for a broadcast source. More... | |
int | bt_cap_initiator_unicast_to_broadcast (const struct bt_cap_unicast_to_broadcast_param *param, struct bt_audio_broadcast_source **source) |
Hands over the data streams in a unicast group to a broadcast source. More... | |
int | bt_cap_initiator_broadcast_to_unicast (const struct bt_cap_broadcast_to_unicast_param *param, struct bt_audio_unicast_group **unicast_group) |
Hands over the data streams in a broadcast source to a unicast group. More... | |
Common Audio Profile (CAP)
[Experimental] Users should note that the APIs can change as a part of ongoing development.
enum bt_cap_set_type |
#include <include/zephyr/bluetooth/audio/cap.h>
Type of CAP set
Enumerator | |
---|---|
BT_CAP_SET_TYPE_AD_HOC | The set is an ad-hoc set |
BT_CAP_SET_TYPE_CSIP | The set is a CSIP Coordinated Set |
int bt_cap_acceptor_register | ( | const struct bt_csip_set_member_register_param * | param, |
struct bt_csip_set_member_svc_inst ** | svc_inst | ||
) |
#include <include/zephyr/bluetooth/audio/cap.h>
Register the Common Audio Service.
This will register and enable the service and make it discoverable by clients. This will also register a Coordinated Set Identification Service instance.
This shall only be done as a server, and requires BT_CAP_ACCEPTOR_SET_MEMBER
. If BT_CAP_ACCEPTOR_SET_MEMBER
is not enabled, the Common Audio Service will by statically registered.
[in] | param | Coordinated Set Identification Service register parameters. |
[out] | svc_inst | Pointer to the registered Coordinated Set Identification Service. |
int bt_cap_initiator_broadcast_audio_start | ( | const struct bt_cap_broadcast_audio_start_param * | param, |
struct bt_audio_broadcast_source ** | source | ||
) |
#include <include/zephyr/bluetooth/audio/cap.h>
Start broadcast audio.
Create a new audio broadcast source with one or more audio streams.
The broadcast source will be visible for scanners once this has been called, and the device will advertise audio announcements.
CONFIG_BT_CAP_INITIATOR
and CONFIG_BT_AUDIO_BROADCAST_SOURCE
must be enabled for this function to be enabled.[in] | param | Parameters to start the audio streams. |
[out] | source | Pointer to the broadcast source started. |
int bt_cap_initiator_broadcast_audio_stop | ( | struct bt_audio_broadcast_source * | broadcast_source | ) |
#include <include/zephyr/bluetooth/audio/cap.h>
Stop broadcast audio streams for a broadcast source.
CONFIG_BT_CAP_INITIATOR
and CONFIG_BT_AUDIO_BROADCAST_SOURCE
must be enabled for this function to be enabled.broadcast_source | The broadcast source to stop. The audio streams in this will be stopped and reset, and the broadcast_source will be invalidated. |
int bt_cap_initiator_broadcast_audio_update | ( | struct bt_audio_broadcast_source * | broadcast_source, |
uint8_t | meta_count, | ||
const struct bt_codec_data * | meta | ||
) |
#include <include/zephyr/bluetooth/audio/cap.h>
Update broadcast audio streams for a broadcast source.
CONFIG_BT_CAP_INITIATOR
and CONFIG_BT_AUDIO_BROADCAST_SOURCE
must be enabled for this function to be enabled.broadcast_source | The broadcast source to update. |
meta_count | The number of entries in meta . |
meta | The new metadata. The metadata shall contain a list of CCIDs as well as a non-0 context bitfield. |
int bt_cap_initiator_broadcast_to_unicast | ( | const struct bt_cap_broadcast_to_unicast_param * | param, |
struct bt_audio_unicast_group ** | unicast_group | ||
) |
#include <include/zephyr/bluetooth/audio/cap.h>
Hands over the data streams in a broadcast source to a unicast group.
The streams in the broadcast source will be stopped and the broadcast source will be deleted.
CONFIG_BT_CAP_INITIATOR
, CONFIG_BT_AUDIO_UNICAST_CLIENT
and CONFIG_BT_AUDIO_BROADCAST_SOURCE
must be enabled for this function to be enabled.[in] | param | The parameters for the handover. |
[out] | unicast_group | The resulting broadcast source. |
int bt_cap_initiator_register_cb | ( | const struct bt_cap_initiator_cb * | cb | ) |
#include <include/zephyr/bluetooth/audio/cap.h>
Register Common Audio Profile callbacks.
cb | The callback structure. Shall remain static. |
int bt_cap_initiator_unicast_audio_start | ( | const struct bt_cap_unicast_audio_start_param * | param, |
struct bt_audio_unicast_group ** | unicast_group | ||
) |
#include <include/zephyr/bluetooth/audio/cap.h>
Setup and start unicast audio streams for a set of devices.
The result of this operation is that the streams in param
will be initialized and will be usable for streaming audio data. The unicast_group
value can be used to update and stop the streams.
CONFIG_BT_CAP_INITIATOR
and CONFIG_BT_AUDIO_UNICAST_CLIENT
must be enabled for this function to be enabled.[in] | param | Parameters to start the audio streams. |
[out] | unicast_group | Pointer to the unicast group created. |
int bt_cap_initiator_unicast_audio_stop | ( | struct bt_audio_unicast_group * | unicast_group | ) |
#include <include/zephyr/bluetooth/audio/cap.h>
Stop unicast audio streams for a unicast group.
CONFIG_BT_CAP_INITIATOR
and CONFIG_BT_AUDIO_UNICAST_CLIENT
must be enabled for this function to be enabled.unicast_group | The group of unicast devices to stop. The audio streams in this will be stopped and reset, and the unicast_group will be invalidated. |
int bt_cap_initiator_unicast_audio_update | ( | struct bt_audio_unicast_group * | unicast_group, |
uint8_t | meta_count, | ||
const struct bt_codec_data * | meta | ||
) |
#include <include/zephyr/bluetooth/audio/cap.h>
Update unicast audio streams for a unicast group.
CONFIG_BT_CAP_INITIATOR
and CONFIG_BT_AUDIO_UNICAST_CLIENT
must be enabled for this function to be enabled.unicast_group | The group of unicast devices to update. |
meta_count | The number of entries in meta . |
meta | The new metadata. The metadata shall contain a list of CCIDs as well as a non-0 context bitfield. |
int bt_cap_initiator_unicast_discover | ( | struct bt_conn * | conn | ) |
#include <include/zephyr/bluetooth/audio/cap.h>
Discovers audio support on a remote device.
This will discover the Common Audio Service (CAS) on the remote device, to verify if the remote device supports the Common Audio Profile.
conn | Connection to a remote server. |
int bt_cap_initiator_unicast_to_broadcast | ( | const struct bt_cap_unicast_to_broadcast_param * | param, |
struct bt_audio_broadcast_source ** | source | ||
) |
#include <include/zephyr/bluetooth/audio/cap.h>
Hands over the data streams in a unicast group to a broadcast source.
The streams in the unicast group will be stopped and the unicast group will be deleted. This can only be done for source streams.
CONFIG_BT_CAP_INITIATOR
, CONFIG_BT_AUDIO_UNICAST_CLIENT
and CONFIG_BT_AUDIO_BROADCAST_SOURCE
must be enabled for this function to be enabled.param | The parameters for the handover. |
source | The resulting broadcast source. |
void bt_cap_stream_ops_register | ( | struct bt_cap_stream * | stream, |
struct bt_audio_stream_ops * | ops | ||
) |
#include <include/zephyr/bluetooth/audio/cap.h>
Register Audio operations for a Common Audio Profile stream.
Register Audio operations for a stream.
stream | Stream object. |
ops | Stream operations structure. |