Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Data Structures

struct  bt_bap_unicast_group_stream_param
 Parameter struct for each stream in the unicast group. More...
struct  bt_bap_unicast_group_stream_pair_param
 Parameter struct for the unicast group functions. More...
struct  bt_bap_unicast_group_param
 Parameters for the creating unicast groups with bt_bap_unicast_group_create(). More...
struct  bt_bap_unicast_group_info
 Structure holding information of audio stream endpoint. More...
struct  bt_bap_unicast_client_cb
 Unicast Client callback structure. More...

Typedefs

typedef bool(* bt_bap_unicast_group_foreach_stream_func_t) (struct bt_bap_stream *stream, void *user_data)
 Callback function for bt_bap_unicast_group_foreach_stream().

Functions

int bt_bap_unicast_group_create (struct bt_bap_unicast_group_param *param, struct bt_bap_unicast_group **unicast_group)
 Create unicast group.
int bt_bap_unicast_group_reconfig (struct bt_bap_unicast_group *unicast_group, const struct bt_bap_unicast_group_param *param)
 Reconfigure unicast group.
int bt_bap_unicast_group_add_streams (struct bt_bap_unicast_group *unicast_group, struct bt_bap_unicast_group_stream_pair_param params[], size_t num_param)
 Add streams to a unicast group as a unicast client.
int bt_bap_unicast_group_delete (struct bt_bap_unicast_group *unicast_group)
 Delete audio unicast group.
int bt_bap_unicast_group_foreach_stream (struct bt_bap_unicast_group *unicast_group, bt_bap_unicast_group_foreach_stream_func_t func, void *user_data)
 Iterate through all streams in a unicast group.
int bt_bap_unicast_group_get_info (const struct bt_bap_unicast_group *unicast_group, struct bt_bap_unicast_group_info *info)
 Return structure holding information of unicast group.
int bt_bap_unicast_client_register_cb (struct bt_bap_unicast_client_cb *cb)
 Register unicast client callbacks.
int bt_bap_unicast_client_unregister_cb (struct bt_bap_unicast_client_cb *cb)
 Unregister unicast client callbacks.
int bt_bap_unicast_client_discover (struct bt_conn *conn, enum bt_audio_dir dir)
 Discover remote capabilities and endpoints.
int bt_bap_unicast_client_qos_from_group (const struct bt_bap_stream *stream, struct bt_bap_qos_cfg *qos)
 Get a copy of the QoS configured for the group of the stream.
bool bt_bap_qos_cfg_eq (const struct bt_bap_qos_cfg *a, const struct bt_bap_qos_cfg *b)
 Compare two bt_bap_qos_cfg and return whether they are equal.

Detailed Description

Typedef Documentation

◆ bt_bap_unicast_group_foreach_stream_func_t

typedef bool(* bt_bap_unicast_group_foreach_stream_func_t) (struct bt_bap_stream *stream, void *user_data)

#include <zephyr/bluetooth/audio/bap.h>

Callback function for bt_bap_unicast_group_foreach_stream().

Parameters
streamThe audio stream
user_dataUser data
Return values
trueContinue iterating.
falseStop iterating.

Function Documentation

◆ bt_bap_qos_cfg_eq()

bool bt_bap_qos_cfg_eq ( const struct bt_bap_qos_cfg * a,
const struct bt_bap_qos_cfg * b )

#include <zephyr/bluetooth/audio/bap.h>

Compare two bt_bap_qos_cfg and return whether they are equal.

Parameters
aThe first QoS config to compare with
bThe second QoS config to compare with
Return values
truea and b points to the same memory (including NULL), or all fields are identical.
falseEither a or b is NULL or any of the fields are not identical.

◆ bt_bap_unicast_client_discover()

int bt_bap_unicast_client_discover ( struct bt_conn * conn,
enum bt_audio_dir dir )

#include <zephyr/bluetooth/audio/bap.h>

Discover remote capabilities and endpoints.

This procedure is used by a client to discover remote capabilities and endpoints and notifies via params callback.

Parameters
connThe ACL connection. The connection must already conform to the security requirements of the Basic Audio Profile.
dirThe type of remote endpoints and capabilities to discover.
Return values
0Success
-EINVALconn is NULL, not a central connection or does not conform to security requirements, or dir is invalid.
-EBUSYAnother operation is already in progress for this conn
-ENOTCONNconn is not connected
-ENOMEMCould not allocate memory for the request
-ENOEXECUnexpected GATT error

◆ bt_bap_unicast_client_qos_from_group()

int bt_bap_unicast_client_qos_from_group ( const struct bt_bap_stream * stream,
struct bt_bap_qos_cfg * qos )

#include <zephyr/bluetooth/audio/bap.h>

Get a copy of the QoS configured for the group of the stream.

This may be different from stream->qos if the stream has not been QoS configured or if group has been reconfigured with bt_bap_unicast_group_reconfig(). The QoS returned from this is what will be applied when bt_bap_stream_qos() is called for the group.

Parameters
[in]streamThe stream to get the QoS configuration information from
[out]qosThe copy of the QoS configuration data
Return values
0Success
-EINVALstream or qos are NULL, or stream is not part of a group.

◆ bt_bap_unicast_client_register_cb()

int bt_bap_unicast_client_register_cb ( struct bt_bap_unicast_client_cb * cb)

#include <zephyr/bluetooth/audio/bap.h>

Register unicast client callbacks.

Parameters
cbUnicast client callback structure to register.
Return values
0Success
-EINVALcb is NULL.
-EEXISTcb is already registered.

◆ bt_bap_unicast_client_unregister_cb()

int bt_bap_unicast_client_unregister_cb ( struct bt_bap_unicast_client_cb * cb)

#include <zephyr/bluetooth/audio/bap.h>

Unregister unicast client callbacks.

Parameters
cbUnicast client callback structure to unregister.
Return values
0Success
-EINVALcb is NULL or cb was not registered

◆ bt_bap_unicast_group_add_streams()

int bt_bap_unicast_group_add_streams ( struct bt_bap_unicast_group * unicast_group,
struct bt_bap_unicast_group_stream_pair_param params[],
size_t num_param )

#include <zephyr/bluetooth/audio/bap.h>

Add streams to a unicast group as a unicast client.

This function can be used to add additional streams to a bt_bap_unicast_group.

This can be called at any time before any of the streams in the group has been started (see bt_bap_stream_ops.started()). This can also be called after the streams have been stopped (see bt_bap_stream_ops.stopped()).

Once a stream has been added to a unicast group, it cannot be removed. To remove a stream from a group, the group must be deleted with bt_bap_unicast_group_delete(), but this will require all streams in the group to be released first.

Parameters
unicast_groupPointer to the unicast group
paramsArray of stream parameters with streams being added to the group.
num_paramNumber of parameters in params.
Returns
0 in case of success or negative value in case of error.

◆ bt_bap_unicast_group_create()

int bt_bap_unicast_group_create ( struct bt_bap_unicast_group_param * param,
struct bt_bap_unicast_group ** unicast_group )

#include <zephyr/bluetooth/audio/bap.h>

Create unicast group.

Create a new audio unicast group with one or more audio streams as a unicast client. All streams shall share the same framing. All streams in the same direction shall share the same interval and latency (see bt_bap_qos_cfg).

Parameters
[in]paramThe unicast group create parameters.
[out]unicast_groupPointer to the unicast group created.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_bap_unicast_group_delete()

int bt_bap_unicast_group_delete ( struct bt_bap_unicast_group * unicast_group)

#include <zephyr/bluetooth/audio/bap.h>

Delete audio unicast group.

Delete a audio unicast group as a client. All streams in the group shall be in the idle or configured state.

Parameters
unicast_groupPointer to the unicast group to delete
Returns
Zero on success or (negative) error code otherwise.

◆ bt_bap_unicast_group_foreach_stream()

int bt_bap_unicast_group_foreach_stream ( struct bt_bap_unicast_group * unicast_group,
bt_bap_unicast_group_foreach_stream_func_t func,
void * user_data )

#include <zephyr/bluetooth/audio/bap.h>

Iterate through all streams in a unicast group.

Parameters
unicast_groupThe unicast group
funcThe callback function
user_dataUser specified data that sent to the callback function
Return values
0Success (even if no streams exists in the group).
-ECANCELEDIteration was stopped by the callback function before complete.
-EINVALunicast_group or func were NULL.

◆ bt_bap_unicast_group_get_info()

int bt_bap_unicast_group_get_info ( const struct bt_bap_unicast_group * unicast_group,
struct bt_bap_unicast_group_info * info )

#include <zephyr/bluetooth/audio/bap.h>

Return structure holding information of unicast group.

Parameters
unicast_groupThe unicast group object.
infoThe structure object to be filled with the info.
Return values
0Success
-EINVALunicast_group or info are NULL

◆ bt_bap_unicast_group_reconfig()

int bt_bap_unicast_group_reconfig ( struct bt_bap_unicast_group * unicast_group,
const struct bt_bap_unicast_group_param * param )

#include <zephyr/bluetooth/audio/bap.h>

Reconfigure unicast group.

Reconfigure a unicast group with one or more audio streams as a unicast client. All streams shall share the same framing. All streams in the same direction shall share the same interval and latency (see bt_bap_qos_cfg). All streams in param shall already belong to unicast_group. Use bt_bap_unicast_group_add_streams() to add additional streams.

Parameters
unicast_groupPointer to the unicast group created.
paramThe unicast group reconfigure parameters.
Returns
Zero on success or (negative) error code otherwise.