Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Codec capability parsing APIs

Audio codec capabilities APIs . More...

Functions

int bt_audio_codec_cap_get_val (const struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_type type, const uint8_t **data)
 Lookup a specific value based on type.
 
int bt_audio_codec_cap_set_val (struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_type type, const uint8_t *data, size_t data_len)
 Set or add a specific codec capability value.
 
int bt_audio_codec_cap_unset_val (struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_type type)
 Unset a specific codec capability value.
 
int bt_audio_codec_cap_get_freq (const struct bt_audio_codec_cap *codec_cap)
 Extract the frequency from a codec capability.
 
int bt_audio_codec_cap_set_freq (struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_freq freq)
 Set the supported frequencies of a codec capability.
 
int bt_audio_codec_cap_get_frame_dur (const struct bt_audio_codec_cap *codec_cap)
 Extract the frequency from a codec capability.
 
int bt_audio_codec_cap_set_frame_dur (struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_frame_dur frame_dur)
 Set the frame duration of a codec capability.
 
int bt_audio_codec_cap_get_supported_audio_chan_counts (const struct bt_audio_codec_cap *codec_cap, bool fallback_to_default)
 Extract the frequency from a codec capability.
 
int bt_audio_codec_cap_set_supported_audio_chan_counts (struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_chan_count chan_count)
 Set the channel count of a codec capability.
 
int bt_audio_codec_cap_get_octets_per_frame (const struct bt_audio_codec_cap *codec_cap, struct bt_audio_codec_octets_per_codec_frame *codec_frame)
 Extract the supported octets per codec frame from a codec capability.
 
int bt_audio_codec_cap_set_octets_per_frame (struct bt_audio_codec_cap *codec_cap, const struct bt_audio_codec_octets_per_codec_frame *codec_frame)
 Set the octets per codec frame of a codec capability.
 
int bt_audio_codec_cap_get_max_codec_frames_per_sdu (const struct bt_audio_codec_cap *codec_cap, bool fallback_to_default)
 Extract the maximum codec frames per SDU from a codec capability.
 
int bt_audio_codec_cap_set_max_codec_frames_per_sdu (struct bt_audio_codec_cap *codec_cap, uint8_t codec_frames_per_sdu)
 Set the maximum codec frames per SDU of a codec capability.
 
int bt_audio_codec_cap_meta_get_val (const struct bt_audio_codec_cap *codec_cap, uint8_t type, const uint8_t **data)
 Lookup a specific metadata value based on type.
 
int bt_audio_codec_cap_meta_set_val (struct bt_audio_codec_cap *codec_cap, enum bt_audio_metadata_type type, const uint8_t *data, size_t data_len)
 Set or add a specific codec capability metadata value.
 
int bt_audio_codec_cap_meta_unset_val (struct bt_audio_codec_cap *codec_cap, enum bt_audio_metadata_type type)
 Unset a specific codec capability metadata value.
 
int bt_audio_codec_cap_meta_get_pref_context (const struct bt_audio_codec_cap *codec_cap)
 Extract preferred contexts.
 
int bt_audio_codec_cap_meta_set_pref_context (struct bt_audio_codec_cap *codec_cap, enum bt_audio_context ctx)
 Set the preferred context of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_stream_context (const struct bt_audio_codec_cap *codec_cap)
 Extract stream contexts.
 
int bt_audio_codec_cap_meta_set_stream_context (struct bt_audio_codec_cap *codec_cap, enum bt_audio_context ctx)
 Set the stream context of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_program_info (const struct bt_audio_codec_cap *codec_cap, const uint8_t **program_info)
 Extract program info.
 
int bt_audio_codec_cap_meta_set_program_info (struct bt_audio_codec_cap *codec_cap, const uint8_t *program_info, size_t program_info_len)
 Set the program info of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_lang (const struct bt_audio_codec_cap *codec_cap, const uint8_t **lang)
 Extract language.
 
int bt_audio_codec_cap_meta_set_lang (struct bt_audio_codec_cap *codec_cap, const uint8_t lang[3])
 Set the language of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_ccid_list (const struct bt_audio_codec_cap *codec_cap, const uint8_t **ccid_list)
 Extract CCID list.
 
int bt_audio_codec_cap_meta_set_ccid_list (struct bt_audio_codec_cap *codec_cap, const uint8_t *ccid_list, size_t ccid_list_len)
 Set the CCID list of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_parental_rating (const struct bt_audio_codec_cap *codec_cap)
 Extract parental rating.
 
int bt_audio_codec_cap_meta_set_parental_rating (struct bt_audio_codec_cap *codec_cap, enum bt_audio_parental_rating parental_rating)
 Set the parental rating of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_program_info_uri (const struct bt_audio_codec_cap *codec_cap, const uint8_t **program_info_uri)
 Extract program info URI.
 
int bt_audio_codec_cap_meta_set_program_info_uri (struct bt_audio_codec_cap *codec_cap, const uint8_t *program_info_uri, size_t program_info_uri_len)
 Set the program info URI of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_audio_active_state (const struct bt_audio_codec_cap *codec_cap)
 Extract audio active state.
 
int bt_audio_codec_cap_meta_set_audio_active_state (struct bt_audio_codec_cap *codec_cap, enum bt_audio_active_state state)
 Set the audio active state of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_bcast_audio_immediate_rend_flag (const struct bt_audio_codec_cap *codec_cap)
 Extract broadcast audio immediate rendering flag.
 
int bt_audio_codec_cap_meta_set_bcast_audio_immediate_rend_flag (struct bt_audio_codec_cap *codec_cap)
 Set the broadcast audio immediate rendering flag of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_assisted_listening_stream (const struct bt_audio_codec_cap *codec_cap)
 Extract assisted listening stream.
 
int bt_audio_codec_cap_meta_set_assisted_listening_stream (struct bt_audio_codec_cap *codec_cap, enum bt_audio_assisted_listening_stream val)
 Set the assisted listening stream value of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_broadcast_name (const struct bt_audio_codec_cap *codec_cap, const uint8_t **broadcast_name)
 Extract broadcast name.
 
int bt_audio_codec_cap_meta_set_broadcast_name (struct bt_audio_codec_cap *codec_cap, const uint8_t *broadcast_name, size_t broadcast_name_len)
 Set the broadcast name of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_extended (const struct bt_audio_codec_cap *codec_cap, const uint8_t **extended_meta)
 Extract extended metadata.
 
int bt_audio_codec_cap_meta_set_extended (struct bt_audio_codec_cap *codec_cap, const uint8_t *extended_meta, size_t extended_meta_len)
 Set the extended metadata of a codec capability metadata.
 
int bt_audio_codec_cap_meta_get_vendor (const struct bt_audio_codec_cap *codec_cap, const uint8_t **vendor_meta)
 Extract vendor specific metadata.
 
int bt_audio_codec_cap_meta_set_vendor (struct bt_audio_codec_cap *codec_cap, const uint8_t *vendor_meta, size_t vendor_meta_len)
 Set the vendor specific metadata of a codec capability metadata.
 

Detailed Description

Audio codec capabilities APIs .

Functions to parse codec capability data when formatted as LTV wrapped into Codec capability parsing APIs.

Function Documentation

◆ bt_audio_codec_cap_get_frame_dur()

int bt_audio_codec_cap_get_frame_dur ( const struct bt_audio_codec_cap * codec_cap)

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

Extract the frequency from a codec capability.

Parameters
codec_capThe codec capabilities to extract data from.
Return values
Bitfieldof supported frame durations if 0 or positive
-EINVALif arguments are invalid
-ENODATAif not found
-EBADMSGif found value has invalid size or value

◆ bt_audio_codec_cap_get_freq()

int bt_audio_codec_cap_get_freq ( const struct bt_audio_codec_cap * codec_cap)

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

Extract the frequency from a codec capability.

Parameters
codec_capThe codec capabilities to extract data from.
Return values
Bitfieldof supported frequencies (bt_audio_codec_cap_freq) if 0 or positive
-EINVALif arguments are invalid
-ENODATAif not found
-EBADMSGif found value has invalid size or value

◆ bt_audio_codec_cap_get_max_codec_frames_per_sdu()

int bt_audio_codec_cap_get_max_codec_frames_per_sdu ( const struct bt_audio_codec_cap * codec_cap,
bool fallback_to_default )

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

Extract the maximum codec frames per SDU from a codec capability.

Parameters
codec_capThe codec capabilities to extract data from.
fallback_to_defaultIf true this function will provide the default value of 1 if the type is not found when codec_cap.id is BT_HCI_CODING_FORMAT_LC3.
Return values
Maximumnumber of codec frames per SDU supported
-EINVALif arguments are invalid
-ENODATAif not found
-EBADMSGif found value has invalid size or value

◆ bt_audio_codec_cap_get_octets_per_frame()

int bt_audio_codec_cap_get_octets_per_frame ( const struct bt_audio_codec_cap * codec_cap,
struct bt_audio_codec_octets_per_codec_frame * codec_frame )

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

Extract the supported octets per codec frame from a codec capability.

Parameters
[in]codec_capThe codec capabilities to extract data from.
[out]codec_frameStruct to place the resulting values in
Return values
0on success
-EINVALif arguments are invalid
-ENODATAif not found
-EBADMSGif found value has invalid size or value

◆ bt_audio_codec_cap_get_supported_audio_chan_counts()

int bt_audio_codec_cap_get_supported_audio_chan_counts ( const struct bt_audio_codec_cap * codec_cap,
bool fallback_to_default )

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

Extract the frequency from a codec capability.

Parameters
codec_capThe codec capabilities to extract data from.
fallback_to_defaultIf true this function will provide the default value of 1 if the type is not found when codec_cap.id is BT_HCI_CODING_FORMAT_LC3.
Return values
Numberof supported channel counts if 0 or positive
-EINVALif arguments are invalid
-ENODATAif not found
-EBADMSGif found value has invalid size or value

◆ bt_audio_codec_cap_get_val()

int bt_audio_codec_cap_get_val ( const struct bt_audio_codec_cap * codec_cap,
enum bt_audio_codec_cap_type type,
const uint8_t ** data )

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

Lookup a specific value based on type.

Parameters
[in]codec_capThe codec data to search in.
[in]typeThe type id to look for
[out]dataPointer to the data-pointer to update when item is found
Return values
Lengthof found data (may be 0)
-EINVALif arguments are invalid
-ENODATAif not found

◆ bt_audio_codec_cap_meta_get_assisted_listening_stream()

int bt_audio_codec_cap_meta_get_assisted_listening_stream ( const struct bt_audio_codec_cap * codec_cap)

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

Extract assisted listening stream.

See BT_AUDIO_METADATA_TYPE_ASSISTED_LISTENING_STREAM for more information about this value.

Parameters
codec_capThe codec data to search in.
Return values
valueThe assisted listening stream value if positive or 0
-EINVALif arguments are invalid
-ENODATAif not found
-EBADMSGif found value has invalid size

◆ bt_audio_codec_cap_meta_get_audio_active_state()

int bt_audio_codec_cap_meta_get_audio_active_state ( const struct bt_audio_codec_cap * codec_cap)

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

Extract audio active state.

See BT_AUDIO_METADATA_TYPE_AUDIO_STATE for more information about this value.

Parameters
codec_capThe codec data to search in.
Return values
Thepreferred context type if positive or 0
-EINVALif arguments are invalid
-ENODATAif not found
-EBADMSGif found value has invalid size

◆ bt_audio_codec_cap_meta_get_bcast_audio_immediate_rend_flag()

int bt_audio_codec_cap_meta_get_bcast_audio_immediate_rend_flag ( const struct bt_audio_codec_cap * codec_cap)

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

Extract broadcast audio immediate rendering flag.

See BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE for more information about this value.

Parameters
codec_capThe codec data to search in.
Return values
0if the flag was found
-EINVALif arguments are invalid
-ENODATAif not the flag was not found

◆ bt_audio_codec_cap_meta_get_broadcast_name()

int bt_audio_codec_cap_meta_get_broadcast_name ( const struct bt_audio_codec_cap * codec_cap,
const uint8_t ** broadcast_name )

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

Extract broadcast name.

See BT_AUDIO_METADATA_TYPE_BROADCAST_NAME for more information about this value.

Parameters
[in]codec_capThe codec data to search in.
[out]broadcast_namePointer to the UTF-8 formatted broadcast name.
Return values
lengthThe length of the broadcast_name (may be 0)
-EINVALif arguments are invalid
-ENODATAif not found

◆ bt_audio_codec_cap_meta_get_ccid_list()

int bt_audio_codec_cap_meta_get_ccid_list ( const struct bt_audio_codec_cap * codec_cap,
const uint8_t ** ccid_list )

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

Extract CCID list.

See BT_AUDIO_METADATA_TYPE_CCID_LIST for more information about this value.

Parameters
[in]codec_capThe codec data to search in.
[out]ccid_listPointer to the array containing 8-bit CCIDs.
Return values
Thelength of the ccid_list (may be 0)
-EINVALif arguments are invalid
-ENODATAif not found

◆ bt_audio_codec_cap_meta_get_extended()

int bt_audio_codec_cap_meta_get_extended ( const struct bt_audio_codec_cap * codec_cap,
const uint8_t ** extended_meta )

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

Extract extended metadata.

See BT_AUDIO_METADATA_TYPE_EXTENDED for more information about this value.

Parameters
[in]codec_capThe codec data to search in.
[out]extended_metaPointer to the extended metadata.
Return values
Thelength of the ccid_list (may be 0)
-EINVALif arguments are invalid
-ENODATAif not found

◆ bt_audio_codec_cap_meta_get_lang()

int bt_audio_codec_cap_meta_get_lang ( const struct bt_audio_codec_cap * codec_cap,
const uint8_t ** lang )

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

Extract language.

See BT_AUDIO_METADATA_TYPE_LANG for more information about this value.

Parameters
[in]codec_capThe codec data to search in.
[out]langPointer to the language bytes (of length BT_AUDIO_LANG_SIZE)
Return values
0On success
-EINVALif arguments are invalid
-ENODATAif not found
-EBADMSGif found value has invalid size

◆ bt_audio_codec_cap_meta_get_parental_rating()

int bt_audio_codec_cap_meta_get_parental_rating ( const struct bt_audio_codec_cap * codec_cap)

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

Extract parental rating.

See BT_AUDIO_METADATA_TYPE_PARENTAL_RATING for more information about this value.

Parameters
codec_capThe codec data to search in.
Return values
Theparental rating if positive or 0
-EINVALif arguments are invalid
-ENODATAif not found
-EBADMSGif found value has invalid size

◆ bt_audio_codec_cap_meta_get_pref_context()

int bt_audio_codec_cap_meta_get_pref_context ( const struct bt_audio_codec_cap * codec_cap)

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

Extract preferred contexts.

See BT_AUDIO_METADATA_TYPE_PREF_CONTEXT for more information about this value.

Parameters
codec_capThe codec data to search in.
Return values
Thepreferred context type if positive or 0
-EINVALif arguments are invalid
-ENODATAif not found
-EBADMSGif found value has invalid size

◆ bt_audio_codec_cap_meta_get_program_info()

int bt_audio_codec_cap_meta_get_program_info ( const struct bt_audio_codec_cap * codec_cap,
const uint8_t ** program_info )

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

Extract program info.

See BT_AUDIO_METADATA_TYPE_PROGRAM_INFO for more information about this value.

Parameters
[in]codec_capThe codec data to search in.
[out]program_infoPointer to the UTF-8 formatted program info.
Return values
Thelength of the program_info (may be 0)
-EINVALif arguments are invalid
-ENODATAif not found

◆ bt_audio_codec_cap_meta_get_program_info_uri()

int bt_audio_codec_cap_meta_get_program_info_uri ( const struct bt_audio_codec_cap * codec_cap,
const uint8_t ** program_info_uri )

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

Extract program info URI.

See BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI for more information about this value.

Parameters
[in]codec_capThe codec data to search in.
[out]program_info_uriPointer to the UTF-8 formatted program info URI.
Return values
Thelength of the ccid_list (may be 0)
-EINVALif arguments are invalid
-ENODATAif not found

◆ bt_audio_codec_cap_meta_get_stream_context()

int bt_audio_codec_cap_meta_get_stream_context ( const struct bt_audio_codec_cap * codec_cap)

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

Extract stream contexts.

See BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT for more information about this value.

Parameters
codec_capThe codec data to search in.
Return values
Thestream context type if positive or 0
-EINVALif arguments are invalid
-ENODATAif not found
-EBADMSGif found value has invalid size

◆ bt_audio_codec_cap_meta_get_val()

int bt_audio_codec_cap_meta_get_val ( const struct bt_audio_codec_cap * codec_cap,
uint8_t type,
const uint8_t ** data )

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

Lookup a specific metadata value based on type.

Parameters
[in]codec_capThe codec data to search in.
[in]typeThe type id to look for
[out]dataPointer to the data-pointer to update when item is found
Return values
Lengthof found data (may be 0)
-EINVALif arguments are invalid
-ENODATAif not found

◆ bt_audio_codec_cap_meta_get_vendor()

int bt_audio_codec_cap_meta_get_vendor ( const struct bt_audio_codec_cap * codec_cap,
const uint8_t ** vendor_meta )

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

Extract vendor specific metadata.

See BT_AUDIO_METADATA_TYPE_VENDOR for more information about this value.

Parameters
[in]codec_capThe codec data to search in.
[out]vendor_metaPointer to the vendor specific metadata.
Return values
Thelength of the ccid_list (may be 0)
-EINVALif arguments are invalid
-ENODATAif not found

◆ bt_audio_codec_cap_meta_set_assisted_listening_stream()

int bt_audio_codec_cap_meta_set_assisted_listening_stream ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_assisted_listening_stream val )

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

Set the assisted listening stream value of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
valThe assisted listening stream value to set.
Return values
lengthThe data_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_audio_active_state()

int bt_audio_codec_cap_meta_set_audio_active_state ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_active_state state )

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

Set the audio active state of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
stateThe audio active state to set.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_bcast_audio_immediate_rend_flag()

int bt_audio_codec_cap_meta_set_bcast_audio_immediate_rend_flag ( struct bt_audio_codec_cap * codec_cap)

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

Set the broadcast audio immediate rendering flag of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_broadcast_name()

int bt_audio_codec_cap_meta_set_broadcast_name ( struct bt_audio_codec_cap * codec_cap,
const uint8_t * broadcast_name,
size_t broadcast_name_len )

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

Set the broadcast name of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
broadcast_nameThe broadcast name to set.
broadcast_name_lenThe length of broadcast_name.
Return values
lengthThe data_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_ccid_list()

int bt_audio_codec_cap_meta_set_ccid_list ( struct bt_audio_codec_cap * codec_cap,
const uint8_t * ccid_list,
size_t ccid_list_len )

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

Set the CCID list of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
ccid_listThe program info to set.
ccid_list_lenThe length of ccid_list.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_extended()

int bt_audio_codec_cap_meta_set_extended ( struct bt_audio_codec_cap * codec_cap,
const uint8_t * extended_meta,
size_t extended_meta_len )

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

Set the extended metadata of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
extended_metaThe extended metadata to set.
extended_meta_lenThe length of extended_meta.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_lang()

int bt_audio_codec_cap_meta_set_lang ( struct bt_audio_codec_cap * codec_cap,
const uint8_t lang[3] )

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

Set the language of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
langThe 24-bit language to set.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_parental_rating()

int bt_audio_codec_cap_meta_set_parental_rating ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_parental_rating parental_rating )

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

Set the parental rating of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
parental_ratingThe parental rating to set.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_pref_context()

int bt_audio_codec_cap_meta_set_pref_context ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_context ctx )

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

Set the preferred context of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
ctxThe preferred context to set.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_program_info()

int bt_audio_codec_cap_meta_set_program_info ( struct bt_audio_codec_cap * codec_cap,
const uint8_t * program_info,
size_t program_info_len )

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

Set the program info of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
program_infoThe program info to set.
program_info_lenThe length of program_info.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_program_info_uri()

int bt_audio_codec_cap_meta_set_program_info_uri ( struct bt_audio_codec_cap * codec_cap,
const uint8_t * program_info_uri,
size_t program_info_uri_len )

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

Set the program info URI of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
program_info_uriThe program info URI to set.
program_info_uri_lenThe length of program_info_uri.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_stream_context()

int bt_audio_codec_cap_meta_set_stream_context ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_context ctx )

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

Set the stream context of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
ctxThe stream context to set.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_val()

int bt_audio_codec_cap_meta_set_val ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_metadata_type type,
const uint8_t * data,
size_t data_len )

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

Set or add a specific codec capability metadata value.

Parameters
codec_capThe codec capability to set the value in.
typeThe type id to set.
dataPointer to the data-pointer to set.
data_lenLength of data.
Return values
Themeta_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_set_vendor()

int bt_audio_codec_cap_meta_set_vendor ( struct bt_audio_codec_cap * codec_cap,
const uint8_t * vendor_meta,
size_t vendor_meta_len )

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

Set the vendor specific metadata of a codec capability metadata.

Parameters
codec_capThe codec capability to set data for.
vendor_metaThe vendor specific metadata to set.
vendor_meta_lenThe length of vendor_meta.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_meta_unset_val()

int bt_audio_codec_cap_meta_unset_val ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_metadata_type type )

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

Unset a specific codec capability metadata value.

The type and the value will be removed from the codec capability metadata.

Parameters
codec_capThe codec data to set the value in.
typeThe type id to unset.
Return values
Themeta_len of codec_cap on success
-EINVALif arguments are invalid

◆ bt_audio_codec_cap_set_frame_dur()

int bt_audio_codec_cap_set_frame_dur ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_codec_cap_frame_dur frame_dur )

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

Set the frame duration of a codec capability.

Parameters
codec_capThe codec capabilities to set data for.
frame_durThe frame duration to set.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_set_freq()

int bt_audio_codec_cap_set_freq ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_codec_cap_freq freq )

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

Set the supported frequencies of a codec capability.

Parameters
codec_capThe codec capabilities to set data for.
freqThe supported frequencies to set.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_set_max_codec_frames_per_sdu()

int bt_audio_codec_cap_set_max_codec_frames_per_sdu ( struct bt_audio_codec_cap * codec_cap,
uint8_t codec_frames_per_sdu )

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

Set the maximum codec frames per SDU of a codec capability.

Parameters
codec_capThe codec capabilities to set data for.
codec_frames_per_sduThe maximum codec frames per SDU to set.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_set_octets_per_frame()

int bt_audio_codec_cap_set_octets_per_frame ( struct bt_audio_codec_cap * codec_cap,
const struct bt_audio_codec_octets_per_codec_frame * codec_frame )

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

Set the octets per codec frame of a codec capability.

Parameters
codec_capThe codec capabilities to set data for.
codec_frameThe octets per codec frame to set.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_set_supported_audio_chan_counts()

int bt_audio_codec_cap_set_supported_audio_chan_counts ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_codec_cap_chan_count chan_count )

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

Set the channel count of a codec capability.

Parameters
codec_capThe codec capabilities to set data for.
chan_countThe channel count frequency to set.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_set_val()

int bt_audio_codec_cap_set_val ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_codec_cap_type type,
const uint8_t * data,
size_t data_len )

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

Set or add a specific codec capability value.

Parameters
codec_capThe codec data to set the value in.
typeThe type id to set
dataPointer to the data-pointer to set
data_lenLength of data
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid
-ENOMEMif the new value could not set or added due to memory

◆ bt_audio_codec_cap_unset_val()

int bt_audio_codec_cap_unset_val ( struct bt_audio_codec_cap * codec_cap,
enum bt_audio_codec_cap_type type )

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

Unset a specific codec capability value.

The type and the value will be removed from the codec capability.

Parameters
codec_capThe codec data to set the value in.
typeThe type id to unset.
Return values
Thedata_len of codec_cap on success
-EINVALif arguments are invalid