Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Audio Stream Control Service (ASCS)

Audio Stream Control Service (ASCS). More...

Data Structures

struct  bt_bap_ascs_rsp
 Structure storing values of fields of ASE Control Point notification. More...
struct  bt_bap_qos_cfg_pref
 Audio Stream Quality of Service Preference structure. More...
struct  bt_ascs_cb
 ASCS callback structure. More...
struct  bt_ascs_register_param
 Parameters for registering the Audio Stream Control Service (ASCS). More...

Macros

#define BT_BAP_ASCS_RSP(c, r)
 Macro used to initialise the object storing values of ASE Control Point notification.
#define BT_BAP_QOS_CFG_PREF(_unframed_supported, _phy, _rtn, _latency, _pd_min, _pd_max, _pref_pd_min, _pref_pd_max)
 Helper to declare elements of bt_bap_qos_cfg_pref.

Enumerations

enum  bt_bap_ascs_rsp_code {
  BT_BAP_ASCS_RSP_CODE_SUCCESS = 0x00U , BT_BAP_ASCS_RSP_CODE_NOT_SUPPORTED = 0x01U , BT_BAP_ASCS_RSP_CODE_INVALID_LENGTH = 0x02U , BT_BAP_ASCS_RSP_CODE_INVALID_ASE = 0x03U ,
  BT_BAP_ASCS_RSP_CODE_INVALID_ASE_STATE = 0x04U , BT_BAP_ASCS_RSP_CODE_INVALID_DIR = 0x05U , BT_BAP_ASCS_RSP_CODE_CAP_UNSUPPORTED = 0x06U , BT_BAP_ASCS_RSP_CODE_CONF_UNSUPPORTED = 0x07U ,
  BT_BAP_ASCS_RSP_CODE_CONF_REJECTED = 0x08U , BT_BAP_ASCS_RSP_CODE_CONF_INVALID = 0x09U , BT_BAP_ASCS_RSP_CODE_METADATA_UNSUPPORTED = 0x0AU , BT_BAP_ASCS_RSP_CODE_METADATA_REJECTED = 0x0BU ,
  BT_BAP_ASCS_RSP_CODE_METADATA_INVALID = 0x0CU , BT_BAP_ASCS_RSP_CODE_NO_MEM = 0x0DU , BT_BAP_ASCS_RSP_CODE_UNSPECIFIED = 0x0EU
}
 Response Status Code. More...
enum  bt_bap_ascs_reason {
  BT_BAP_ASCS_REASON_NONE = 0x00U , BT_BAP_ASCS_REASON_CODEC = 0x01U , BT_BAP_ASCS_REASON_CODEC_DATA = 0x02U , BT_BAP_ASCS_REASON_INTERVAL = 0x03U ,
  BT_BAP_ASCS_REASON_FRAMING = 0x04U , BT_BAP_ASCS_REASON_PHY = 0x05U , BT_BAP_ASCS_REASON_SDU = 0x06U , BT_BAP_ASCS_REASON_RTN = 0x07U ,
  BT_BAP_ASCS_REASON_LATENCY = 0x08U , BT_BAP_ASCS_REASON_PD = 0x09U , BT_BAP_ASCS_REASON_CIS = 0x0AU
}
 Response Reasons. More...

Functions

int bt_ascs_register (const struct bt_ascs_register_param *param)
 Register the Audio Stream Control Service (ASCS).
int bt_ascs_unregister (void)
 Unregister the Audio Stream Control Service (ASCS).

Detailed Description

Audio Stream Control Service (ASCS).

Since
4.5
Version
0.1.0

The Audio Stream Control Service (ASCS) exposes Audio Stream Endpoints (ASEs), which enables clients to control the ASEs and their associated unicast audio streams.

Macro Definition Documentation

◆ BT_BAP_ASCS_RSP

#define BT_BAP_ASCS_RSP ( c,
r )

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

Value:
(struct bt_bap_ascs_rsp) \
{ \
.code = c, .reason = r \
}
Structure storing values of fields of ASE Control Point notification.
Definition ascs.h:116

Macro used to initialise the object storing values of ASE Control Point notification.

Parameters
cResponse Code field
rReason field - bt_bap_ascs_reason or bt_audio_metadata_type (see notes in bt_bap_ascs_rsp).

◆ BT_BAP_QOS_CFG_PREF

#define BT_BAP_QOS_CFG_PREF ( _unframed_supported,
_phy,
_rtn,
_latency,
_pd_min,
_pd_max,
_pref_pd_min,
_pref_pd_max )

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

Value:
{ \
.unframed_supported = _unframed_supported, \
.phy = _phy, \
.rtn = _rtn, \
.latency = _latency, \
.pd_min = _pd_min, \
.pd_max = _pd_max, \
.pref_pd_min = _pref_pd_min, \
.pref_pd_max = _pref_pd_max, \
}

Helper to declare elements of bt_bap_qos_cfg_pref.

Parameters
_unframed_supportedUnframed PDUs supported
_phyPreferred Target PHY
_rtnPreferred Retransmission number
_latencyPreferred Maximum Transport Latency (msec)
_pd_minMinimum Presentation Delay (usec)
_pd_maxMaximum Presentation Delay (usec)
_pref_pd_minPreferred Minimum Presentation Delay (usec)
_pref_pd_maxPreferred Maximum Presentation Delay (usec)

Enumeration Type Documentation

◆ bt_bap_ascs_reason

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

Response Reasons.

These are used if the bt_bap_ascs_rsp_code value is BT_BAP_ASCS_RSP_CODE_CONF_UNSUPPORTED, BT_BAP_ASCS_RSP_CODE_CONF_REJECTED or BT_BAP_ASCS_RSP_CODE_CONF_INVALID.

Enumerator
BT_BAP_ASCS_REASON_NONE 

No reason.

BT_BAP_ASCS_REASON_CODEC 

Codec ID.

BT_BAP_ASCS_REASON_CODEC_DATA 

Codec configuration.

BT_BAP_ASCS_REASON_INTERVAL 

SDU interval.

BT_BAP_ASCS_REASON_FRAMING 

Framing.

BT_BAP_ASCS_REASON_PHY 

PHY.

BT_BAP_ASCS_REASON_SDU 

Maximum SDU size.

BT_BAP_ASCS_REASON_RTN 

Retransmission number.

BT_BAP_ASCS_REASON_LATENCY 

Max transport latency.

BT_BAP_ASCS_REASON_PD 

Presentation delay.

BT_BAP_ASCS_REASON_CIS 

Invalid CIS mapping.

◆ bt_bap_ascs_rsp_code

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

Response Status Code.

These are sent by the server to the client when a stream operation is requested.

Enumerator
BT_BAP_ASCS_RSP_CODE_SUCCESS 

Server completed operation successfully.

BT_BAP_ASCS_RSP_CODE_NOT_SUPPORTED 

Server did not support operation by client.

BT_BAP_ASCS_RSP_CODE_INVALID_LENGTH 

Server rejected due to invalid operation length.

BT_BAP_ASCS_RSP_CODE_INVALID_ASE 

Invalid ASE ID.

BT_BAP_ASCS_RSP_CODE_INVALID_ASE_STATE 

Invalid ASE state.

BT_BAP_ASCS_RSP_CODE_INVALID_DIR 

Invalid operation for direction.

BT_BAP_ASCS_RSP_CODE_CAP_UNSUPPORTED 

Capabilities not supported by server.

BT_BAP_ASCS_RSP_CODE_CONF_UNSUPPORTED 

Configuration parameters not supported by server.

BT_BAP_ASCS_RSP_CODE_CONF_REJECTED 

Configuration parameters rejected by server.

BT_BAP_ASCS_RSP_CODE_CONF_INVALID 

Invalid Configuration parameters.

BT_BAP_ASCS_RSP_CODE_METADATA_UNSUPPORTED 

Unsupported metadata.

BT_BAP_ASCS_RSP_CODE_METADATA_REJECTED 

Metadata rejected by server.

BT_BAP_ASCS_RSP_CODE_METADATA_INVALID 

Invalid metadata.

BT_BAP_ASCS_RSP_CODE_NO_MEM 

Server has insufficient resources.

BT_BAP_ASCS_RSP_CODE_UNSPECIFIED 

Unspecified error.

Function Documentation

◆ bt_ascs_register()

int bt_ascs_register ( const struct bt_ascs_register_param * param)

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

Register the Audio Stream Control Service (ASCS).

This will initialize the service and expose it in the GATT database, as well as the provided number of sink and source ASE characteristics.

Parameters
paramParameters for the service
Return values
0Success.
-EINVALparam is NULL or contains invalid values, or bt_gatt_service_register() failed.
-EALREADYASCS already registered.
-EADDRINUSEISO server is already registered with bt_iso_server_register().
-ENOTSUPController does not support ISO.

◆ bt_ascs_unregister()

int bt_ascs_unregister ( void )

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

Unregister the Audio Stream Control Service (ASCS).

This will release all streams and remove the service from the GATT database.

Return values
0Success.
-ENOENTif bt_gatt_service_unregister() failed to unregister the service.
-EALREADYASCS already unregistered.