Zephyr API 3.6.99
|
Audio codec Config APIs . More...
Functions | |
int | bt_audio_codec_cfg_freq_to_freq_hz (enum bt_audio_codec_cfg_freq freq) |
Convert assigned numbers frequency to frequency value. | |
int | bt_audio_codec_cfg_freq_hz_to_freq (uint32_t freq_hz) |
Convert frequency value to assigned numbers frequency. | |
int | bt_audio_codec_cfg_get_freq (const struct bt_audio_codec_cfg *codec_cfg) |
Extract the frequency from a codec configuration. | |
int | bt_audio_codec_cfg_set_freq (struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_codec_cfg_freq freq) |
Set the frequency of a codec configuration. | |
int | bt_audio_codec_cfg_frame_dur_to_frame_dur_us (enum bt_audio_codec_cfg_frame_dur frame_dur) |
Convert assigned numbers frame duration to duration in microseconds. | |
int | bt_audio_codec_cfg_frame_dur_us_to_frame_dur (uint32_t frame_dur_us) |
Convert frame duration in microseconds to assigned numbers frame duration. | |
int | bt_audio_codec_cfg_get_frame_dur (const struct bt_audio_codec_cfg *codec_cfg) |
Extract frame duration from BT codec config. | |
int | bt_audio_codec_cfg_set_frame_dur (struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_codec_cfg_frame_dur frame_dur) |
Set the frame duration of a codec configuration. | |
int | bt_audio_codec_cfg_get_chan_allocation (const struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_location *chan_allocation, bool fallback_to_default) |
Extract channel allocation from BT codec config. | |
int | bt_audio_codec_cfg_set_chan_allocation (struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_location chan_allocation) |
Set the channel allocation of a codec configuration. | |
int | bt_audio_codec_cfg_get_octets_per_frame (const struct bt_audio_codec_cfg *codec_cfg) |
Extract frame size in octets from BT codec config. | |
int | bt_audio_codec_cfg_set_octets_per_frame (struct bt_audio_codec_cfg *codec_cfg, uint16_t octets_per_frame) |
Set the octets per codec frame of a codec configuration. | |
int | bt_audio_codec_cfg_get_frame_blocks_per_sdu (const struct bt_audio_codec_cfg *codec_cfg, bool fallback_to_default) |
Extract number of audio frame blocks in each SDU from BT codec config. | |
int | bt_audio_codec_cfg_set_frame_blocks_per_sdu (struct bt_audio_codec_cfg *codec_cfg, uint8_t frame_blocks) |
Set the frame blocks per SDU of a codec configuration. | |
int | bt_audio_codec_cfg_get_val (const struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_codec_cfg_type type, const uint8_t **data) |
Lookup a specific codec configuration value. | |
int | bt_audio_codec_cfg_set_val (struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_codec_cfg_type type, const uint8_t *data, size_t data_len) |
Set or add a specific codec configuration value. | |
int | bt_audio_codec_cfg_unset_val (struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_codec_cfg_type type) |
Unset a specific codec configuration value. | |
int | bt_audio_codec_cfg_meta_get_val (const struct bt_audio_codec_cfg *codec_cfg, uint8_t type, const uint8_t **data) |
Lookup a specific metadata value based on type. | |
int | bt_audio_codec_cfg_meta_set_val (struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_metadata_type type, const uint8_t *data, size_t data_len) |
Set or add a specific codec configuration metadata value. | |
int | bt_audio_codec_cfg_meta_unset_val (struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_metadata_type type) |
Unset a specific codec configuration metadata value. | |
int | bt_audio_codec_cfg_meta_get_pref_context (const struct bt_audio_codec_cfg *codec_cfg, bool fallback_to_default) |
Extract preferred contexts. | |
int | bt_audio_codec_cfg_meta_set_pref_context (struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_context ctx) |
Set the preferred context of a codec configuration metadata. | |
int | bt_audio_codec_cfg_meta_get_stream_context (const struct bt_audio_codec_cfg *codec_cfg) |
Extract stream contexts. | |
int | bt_audio_codec_cfg_meta_set_stream_context (struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_context ctx) |
Set the stream context of a codec configuration metadata. | |
int | bt_audio_codec_cfg_meta_get_program_info (const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **program_info) |
Extract program info. | |
int | bt_audio_codec_cfg_meta_set_program_info (struct bt_audio_codec_cfg *codec_cfg, const uint8_t *program_info, size_t program_info_len) |
Set the program info of a codec configuration metadata. | |
int | bt_audio_codec_cfg_meta_get_lang (const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **lang) |
Extract language. | |
int | bt_audio_codec_cfg_meta_set_lang (struct bt_audio_codec_cfg *codec_cfg, const uint8_t lang[3]) |
Set the language of a codec configuration metadata. | |
int | bt_audio_codec_cfg_meta_get_ccid_list (const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **ccid_list) |
Extract CCID list. | |
int | bt_audio_codec_cfg_meta_set_ccid_list (struct bt_audio_codec_cfg *codec_cfg, const uint8_t *ccid_list, size_t ccid_list_len) |
Set the CCID list of a codec configuration metadata. | |
int | bt_audio_codec_cfg_meta_get_parental_rating (const struct bt_audio_codec_cfg *codec_cfg) |
Extract parental rating. | |
int | bt_audio_codec_cfg_meta_set_parental_rating (struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_parental_rating parental_rating) |
Set the parental rating of a codec configuration metadata. | |
int | bt_audio_codec_cfg_meta_get_program_info_uri (const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **program_info_uri) |
Extract program info URI. | |
int | bt_audio_codec_cfg_meta_set_program_info_uri (struct bt_audio_codec_cfg *codec_cfg, const uint8_t *program_info_uri, size_t program_info_uri_len) |
Set the program info URI of a codec configuration metadata. | |
int | bt_audio_codec_cfg_meta_get_audio_active_state (const struct bt_audio_codec_cfg *codec_cfg) |
Extract audio active state. | |
int | bt_audio_codec_cfg_meta_set_audio_active_state (struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_active_state state) |
Set the audio active state of a codec configuration metadata. | |
int | bt_audio_codec_cfg_meta_get_bcast_audio_immediate_rend_flag (const struct bt_audio_codec_cfg *codec_cfg) |
Extract broadcast audio immediate rendering flag. | |
int | bt_audio_codec_cfg_meta_set_bcast_audio_immediate_rend_flag (struct bt_audio_codec_cfg *codec_cfg) |
Set the broadcast audio immediate rendering flag of a codec configuration metadata. | |
int | bt_audio_codec_cfg_meta_get_extended (const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **extended_meta) |
Extract extended metadata. | |
int | bt_audio_codec_cfg_meta_set_extended (struct bt_audio_codec_cfg *codec_cfg, const uint8_t *extended_meta, size_t extended_meta_len) |
Set the extended metadata of a codec configuration metadata. | |
int | bt_audio_codec_cfg_meta_get_vendor (const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **vendor_meta) |
Extract vendor specific metadata. | |
int | bt_audio_codec_cfg_meta_set_vendor (struct bt_audio_codec_cfg *codec_cfg, const uint8_t *vendor_meta, size_t vendor_meta_len) |
Set the vendor specific metadata of a codec configuration metadata. | |
Audio codec Config APIs .
Functions to parse codec config data when formatted as LTV wrapped into Codec config parsing APIs.
int bt_audio_codec_cfg_frame_dur_to_frame_dur_us | ( | enum bt_audio_codec_cfg_frame_dur | frame_dur | ) |
#include <zephyr/bluetooth/audio/audio.h>
Convert assigned numbers frame duration to duration in microseconds.
frame_dur | The assigned numbers frame duration to convert. |
-EINVAL | if arguments are invalid. |
The | converted frame duration value in microseconds. |
int bt_audio_codec_cfg_frame_dur_us_to_frame_dur | ( | uint32_t | frame_dur_us | ) |
#include <zephyr/bluetooth/audio/audio.h>
Convert frame duration in microseconds to assigned numbers frame duration.
frame_dur_us | The frame duration in microseconds to convert. |
-EINVAL | if arguments are invalid. |
The | assigned numbers frame duration (bt_audio_codec_cfg_frame_dur). |
int bt_audio_codec_cfg_freq_hz_to_freq | ( | uint32_t | freq_hz | ) |
#include <zephyr/bluetooth/audio/audio.h>
Convert frequency value to assigned numbers frequency.
freq_hz | The frequency value to convert. |
-EINVAL | if arguments are invalid. |
The | assigned numbers frequency (bt_audio_codec_cfg_freq). |
int bt_audio_codec_cfg_freq_to_freq_hz | ( | enum bt_audio_codec_cfg_freq | freq | ) |
#include <zephyr/bluetooth/audio/audio.h>
Convert assigned numbers frequency to frequency value.
freq | The assigned numbers frequency to convert. |
-EINVAL | if arguments are invalid. |
The | converted frequency value in Hz. |
int bt_audio_codec_cfg_get_chan_allocation | ( | const struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_location * | chan_allocation, | ||
bool | fallback_to_default ) |
#include <zephyr/bluetooth/audio/audio.h>
Extract channel allocation from BT codec config.
The value returned is a bit field representing one or more audio locations as specified by bt_audio_location Shall match one or more of the bits set in BT_PAC_SNK_LOC/BT_PAC_SRC_LOC.
Up to the configured BT_AUDIO_CODEC_CAP_TYPE_CHAN_COUNT number of channels can be present.
codec_cfg | The codec configuration to extract data from. |
chan_allocation | Pointer to the variable to store the extracted value in. |
fallback_to_default | If true this function will provide the default value of BT_AUDIO_LOCATION_MONO_AUDIO if the type is not found when codec_cfg.id is BT_HCI_CODING_FORMAT_LC3. |
0 | if value is found and stored in the pointer provided |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
-EBADMSG | if found value has invalid size or value |
int bt_audio_codec_cfg_get_frame_blocks_per_sdu | ( | const struct bt_audio_codec_cfg * | codec_cfg, |
bool | fallback_to_default ) |
#include <zephyr/bluetooth/audio/audio.h>
Extract number of audio frame blocks in each SDU from BT codec config.
The overall SDU size will be octets_per_frame * frame_blocks_per_sdu * number-of-channels.
If this value is not present a default value of 1 shall be used.
A frame block is one or more frames that represents data for the same period of time but for different channels. If the stream have two audio channels and this value is two there will be four frames in the SDU.
codec_cfg | The codec configuration to extract data from. |
fallback_to_default | If true this function will return the default value of 1 if the type is not found when codec_cfg.id is BT_HCI_CODING_FORMAT_LC3. |
The | count of codec frame blocks in each SDU. |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
-EBADMSG | if found value has invalid size or value |
int bt_audio_codec_cfg_get_frame_dur | ( | const struct bt_audio_codec_cfg * | codec_cfg | ) |
#include <zephyr/bluetooth/audio/audio.h>
Extract frame duration from BT codec config.
codec_cfg | The codec configuration to extract data from. |
A | bt_audio_codec_cfg_frame_dur value |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
-EBADMSG | if found value has invalid size or value |
int bt_audio_codec_cfg_get_freq | ( | const struct bt_audio_codec_cfg * | codec_cfg | ) |
#include <zephyr/bluetooth/audio/audio.h>
Extract the frequency from a codec configuration.
codec_cfg | The codec configuration to extract data from. |
A | bt_audio_codec_cfg_freq value |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
-EBADMSG | if found value has invalid size or value |
int bt_audio_codec_cfg_get_octets_per_frame | ( | const struct bt_audio_codec_cfg * | codec_cfg | ) |
#include <zephyr/bluetooth/audio/audio.h>
Extract frame size in octets from BT codec config.
The overall SDU size will be octets_per_frame * blocks_per_sdu.
The Bluetooth specifications are not clear about this value - it does not state that the codec shall use this SDU size only. A codec like LC3 supports variable bit-rate (per SDU) hence it might be allowed for an encoder to reduce the frame size below this value. Hence it is recommended to use the received SDU size and divide by blocks_per_sdu rather than relying on this octets_per_sdu value to be fixed.
codec_cfg | The codec configuration to extract data from. |
Frame | length in octets |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
-EBADMSG | if found value has invalid size or value |
int bt_audio_codec_cfg_get_val | ( | const struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_codec_cfg_type | type, | ||
const uint8_t ** | data ) |
#include <zephyr/bluetooth/audio/audio.h>
Lookup a specific codec configuration value.
[in] | codec_cfg | The codec data to search in. |
[in] | type | The type id to look for |
[out] | data | Pointer to the data-pointer to update when item is found |
Length | of found data (may be 0) |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
int bt_audio_codec_cfg_meta_get_audio_active_state | ( | const struct bt_audio_codec_cfg * | codec_cfg | ) |
#include <zephyr/bluetooth/audio/audio.h>
Extract audio active state.
See BT_AUDIO_METADATA_TYPE_AUDIO_STATE for more information about this value.
codec_cfg | The codec data to search in. |
The | preferred context type if positive or 0 |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
-EBADMSG | if found value has invalid size |
int bt_audio_codec_cfg_meta_get_bcast_audio_immediate_rend_flag | ( | const struct bt_audio_codec_cfg * | codec_cfg | ) |
#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.
codec_cfg | The codec data to search in. |
0 | if the flag was found |
-EINVAL | if arguments are invalid |
-ENODATA | if the flag was not found |
int bt_audio_codec_cfg_meta_get_ccid_list | ( | const struct bt_audio_codec_cfg * | codec_cfg, |
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.
[in] | codec_cfg | The codec data to search in. |
[out] | ccid_list | Pointer to the array containing 8-bit CCIDs. |
The | length of the ccid_list (may be 0) |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
int bt_audio_codec_cfg_meta_get_extended | ( | const struct bt_audio_codec_cfg * | codec_cfg, |
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.
[in] | codec_cfg | The codec data to search in. |
[out] | extended_meta | Pointer to the extended metadata. |
The | length of the ccid_list (may be 0) |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
int bt_audio_codec_cfg_meta_get_lang | ( | const struct bt_audio_codec_cfg * | codec_cfg, |
const uint8_t ** | lang ) |
#include <zephyr/bluetooth/audio/audio.h>
Extract language.
See BT_AUDIO_METADATA_TYPE_LANG for more information about this value.
[in] | codec_cfg | The codec data to search in. |
[out] | lang | Pointer to the language bytes (of length BT_AUDIO_LANG_SIZE) |
The | language if positive or 0 |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
-EBADMSG | if found value has invalid size |
int bt_audio_codec_cfg_meta_get_parental_rating | ( | const struct bt_audio_codec_cfg * | codec_cfg | ) |
#include <zephyr/bluetooth/audio/audio.h>
Extract parental rating.
See BT_AUDIO_METADATA_TYPE_PARENTAL_RATING for more information about this value.
codec_cfg | The codec data to search in. |
The | parental rating if positive or 0 |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
-EBADMSG | if found value has invalid size |
int bt_audio_codec_cfg_meta_get_pref_context | ( | const struct bt_audio_codec_cfg * | codec_cfg, |
bool | fallback_to_default ) |
#include <zephyr/bluetooth/audio/audio.h>
Extract preferred contexts.
See BT_AUDIO_METADATA_TYPE_PREF_CONTEXT for more information about this value.
codec_cfg | The codec data to search in. |
fallback_to_default | If true this function will provide the default value of BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED if the type is not found when codec_cfg.id is BT_HCI_CODING_FORMAT_LC3. |
The | preferred context type if positive or 0 |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
-EBADMSG | if found value has invalid size |
int bt_audio_codec_cfg_meta_get_program_info | ( | const struct bt_audio_codec_cfg * | codec_cfg, |
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.
[in] | codec_cfg | The codec data to search in. |
[out] | program_info | Pointer to the UTF-8 formatted program info. |
The | length of the program_info (may be 0) |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
int bt_audio_codec_cfg_meta_get_program_info_uri | ( | const struct bt_audio_codec_cfg * | codec_cfg, |
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.
[in] | codec_cfg | The codec data to search in. |
[out] | program_info_uri | Pointer to the UTF-8 formatted program info URI. |
The | length of the ccid_list (may be 0) |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
int bt_audio_codec_cfg_meta_get_stream_context | ( | const struct bt_audio_codec_cfg * | codec_cfg | ) |
#include <zephyr/bluetooth/audio/audio.h>
Extract stream contexts.
See BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT for more information about this value.
codec_cfg | The codec data to search in. |
The | stream context type if positive or 0 |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
-EBADMSG | if found value has invalid size |
int bt_audio_codec_cfg_meta_get_val | ( | const struct bt_audio_codec_cfg * | codec_cfg, |
uint8_t | type, | ||
const uint8_t ** | data ) |
#include <zephyr/bluetooth/audio/audio.h>
Lookup a specific metadata value based on type.
[in] | codec_cfg | The codec data to search in. |
[in] | type | The type id to look for |
[out] | data | Pointer to the data-pointer to update when item is found |
Length | of found data (may be 0) |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
int bt_audio_codec_cfg_meta_get_vendor | ( | const struct bt_audio_codec_cfg * | codec_cfg, |
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.
[in] | codec_cfg | The codec data to search in. |
[out] | vendor_meta | Pointer to the vendor specific metadata. |
The | length of the ccid_list (may be 0) |
-EINVAL | if arguments are invalid |
-ENODATA | if not found |
int bt_audio_codec_cfg_meta_set_audio_active_state | ( | struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_active_state | state ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the audio active state of a codec configuration metadata.
codec_cfg | The codec configuration to set data for. |
state | The audio active state to set. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_set_bcast_audio_immediate_rend_flag | ( | struct bt_audio_codec_cfg * | codec_cfg | ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the broadcast audio immediate rendering flag of a codec configuration metadata.
codec_cfg | The codec configuration to set data for. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_set_ccid_list | ( | struct bt_audio_codec_cfg * | codec_cfg, |
const uint8_t * | ccid_list, | ||
size_t | ccid_list_len ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the CCID list of a codec configuration metadata.
codec_cfg | The codec configuration to set data for. |
ccid_list | The program info to set. |
ccid_list_len | The length of ccid_list . |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_set_extended | ( | struct bt_audio_codec_cfg * | codec_cfg, |
const uint8_t * | extended_meta, | ||
size_t | extended_meta_len ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the extended metadata of a codec configuration metadata.
codec_cfg | The codec configuration to set data for. |
extended_meta | The extended metadata to set. |
extended_meta_len | The length of extended_meta . |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_set_lang | ( | struct bt_audio_codec_cfg * | codec_cfg, |
const uint8_t | lang[3] ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the language of a codec configuration metadata.
codec_cfg | The codec configuration to set data for. |
lang | The 24-bit language to set. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_set_parental_rating | ( | struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_parental_rating | parental_rating ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the parental rating of a codec configuration metadata.
codec_cfg | The codec configuration to set data for. |
parental_rating | The parental rating to set. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_set_pref_context | ( | struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_context | ctx ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the preferred context of a codec configuration metadata.
codec_cfg | The codec configuration to set data for. |
ctx | The preferred context to set. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_set_program_info | ( | struct bt_audio_codec_cfg * | codec_cfg, |
const uint8_t * | program_info, | ||
size_t | program_info_len ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the program info of a codec configuration metadata.
codec_cfg | The codec configuration to set data for. |
program_info | The program info to set. |
program_info_len | The length of program_info . |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_set_program_info_uri | ( | struct bt_audio_codec_cfg * | codec_cfg, |
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 configuration metadata.
codec_cfg | The codec configuration to set data for. |
program_info_uri | The program info URI to set. |
program_info_uri_len | The length of program_info_uri . |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_set_stream_context | ( | struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_context | ctx ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the stream context of a codec configuration metadata.
codec_cfg | The codec configuration to set data for. |
ctx | The stream context to set. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_set_val | ( | struct bt_audio_codec_cfg * | codec_cfg, |
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 configuration metadata value.
codec_cfg | The codec configuration to set the value in. |
type | The type id to set. |
data | Pointer to the data-pointer to set. |
data_len | Length of data . |
The | meta_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_set_vendor | ( | struct bt_audio_codec_cfg * | codec_cfg, |
const uint8_t * | vendor_meta, | ||
size_t | vendor_meta_len ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the vendor specific metadata of a codec configuration metadata.
codec_cfg | The codec configuration to set data for. |
vendor_meta | The vendor specific metadata to set. |
vendor_meta_len | The length of vendor_meta . |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_meta_unset_val | ( | struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_metadata_type | type ) |
#include <zephyr/bluetooth/audio/audio.h>
Unset a specific codec configuration metadata value.
The type and the value will be removed from the codec configuration metadata.
codec_cfg | The codec data to set the value in. |
type | The type id to unset. |
The | meta_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
int bt_audio_codec_cfg_set_chan_allocation | ( | struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_location | chan_allocation ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the channel allocation of a codec configuration.
codec_cfg | The codec configuration to set data for. |
chan_allocation | The channel allocation to set. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_set_frame_blocks_per_sdu | ( | struct bt_audio_codec_cfg * | codec_cfg, |
uint8_t | frame_blocks ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the frame blocks per SDU of a codec configuration.
codec_cfg | The codec configuration to set data for. |
frame_blocks | The frame blocks per SDU to set. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_set_frame_dur | ( | struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_codec_cfg_frame_dur | frame_dur ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the frame duration of a codec configuration.
codec_cfg | The codec configuration to set data for. |
frame_dur | The assigned numbers frame duration to set. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_set_freq | ( | struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_codec_cfg_freq | freq ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the frequency of a codec configuration.
codec_cfg | The codec configuration to set data for. |
freq | The assigned numbers frequency to set. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_set_octets_per_frame | ( | struct bt_audio_codec_cfg * | codec_cfg, |
uint16_t | octets_per_frame ) |
#include <zephyr/bluetooth/audio/audio.h>
Set the octets per codec frame of a codec configuration.
codec_cfg | The codec configuration to set data for. |
octets_per_frame | The octets per codec frame to set. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_set_val | ( | struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_codec_cfg_type | type, | ||
const uint8_t * | data, | ||
size_t | data_len ) |
#include <zephyr/bluetooth/audio/audio.h>
Set or add a specific codec configuration value.
codec_cfg | The codec data to set the value in. |
type | The type id to set |
data | Pointer to the data-pointer to set |
data_len | Length of data |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |
-ENOMEM | if the new value could not set or added due to memory |
int bt_audio_codec_cfg_unset_val | ( | struct bt_audio_codec_cfg * | codec_cfg, |
enum bt_audio_codec_cfg_type | type ) |
#include <zephyr/bluetooth/audio/audio.h>
Unset a specific codec configuration value.
The type and the value will be removed from the codec configuration.
codec_cfg | The codec data to set the value in. |
type | The type id to unset. |
The | data_len of codec_cfg on success |
-EINVAL | if arguments are invalid |