Zephyr Project API  3.2.0
A Scalable Open Source RTOS
bt_audio_pacs_cb Struct Reference

Callback structure for the Public Audio Capabilities Service (PACS) More...

#include <audio.h>

Data Fields

int(* get_available_contexts )(struct bt_conn *conn, enum bt_audio_dir dir, enum bt_audio_context *context)
 Get available audio contexts callback. More...
 
int(* publish_capability )(struct bt_conn *conn, uint8_t type, uint8_t index, struct bt_codec *const codec)
 Publish Capability callback. More...
 

Detailed Description

Callback structure for the Public Audio Capabilities Service (PACS)

This is used for the Unicast Server ( CONFIG_BT_AUDIO_UNICAST_SERVER ) and Broadcast Sink ( CONFIG_BT_AUDIO_BROADCAST_SINK ) roles.

Field Documentation

◆ get_available_contexts

int(* bt_audio_pacs_cb::get_available_contexts) (struct bt_conn *conn, enum bt_audio_dir dir, enum bt_audio_context *context)

Get available audio contexts callback.

Get available audio contexts callback is called whenever a remote client requests to read the value of Published Audio Capabilities (PAC) Available Audio Contexts, or if the value needs to be notified.

Parameters
[in]connThe connection that requests the available audio contexts. Will be NULL if requested for sending a notification, as a result of calling bt_pacs_available_contexts_changed().
[in]dirDirection of the endpoint.
[out]contextPointer to the contexts that needs to be set.
Returns
0 in case of success or negative value in case of error.

◆ publish_capability

int(* bt_audio_pacs_cb::publish_capability) (struct bt_conn *conn, uint8_t type, uint8_t index, struct bt_codec *const codec)

Publish Capability callback.

Publish Capability callback is called whenever a remote client requests to read the Published Audio Capabilities (PAC) records. The callback will be called iteratively until it returns an error, increasing the index each time. Once an error value (non-zero) is returned, the previously returned codec values (if any) will be sent to the client that requested the value.

Parameters
connThe connection that requests the capabilities. Will be NULL if the capabilities is requested for sending a notification, as a result of calling bt_audio_capability_register() or bt_audio_capability_unregister().
typeType of the endpoint.
indexIndex of the codec object requested. Multiple objects may be returned, and this value keep tracks of how many have previously been returned.
codecCodec object that shall be populated if returning success (0). Ignored if returning non-zero.
Returns
0 in case of success or negative value in case of error.

The documentation for this struct was generated from the following file: