Zephyr API Documentation 4.3.0-rc1
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.

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
trueStop iterating.
falseContinue iterating.

Function Documentation

◆ 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
connConnection object
dirThe type of remote endpoints and capabilities to discover.

◆ 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.