nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
le_audio.h File Reference
#include <zephyr/bluetooth/audio/bap.h>
#include <zephyr/bluetooth/audio/cap.h>
#include <zephyr/net_buf.h>
#include <audio_defines.h>

Go to the source code of this file.

Data Structures

struct  stream_index
 Stream index structure for identifying audio streams. More...
 

Macros

#define LE_AUDIO_ZBUS_EVENT_WAIT_TIME   K_MSEC(5)
 
#define LE_AUDIO_SDU_SIZE_OCTETS(bitrate, dur_us)
 
#define BT_BAP_LC3_PRESET_CONFIGURABLE(_loc, _stream_context, _bitrate)
 

Typedefs

typedef void(* le_audio_receive_cb) (struct net_buf *audio_frame, struct audio_metadata *meta, uint8_t location_index)
 Callback for receiving Bluetooth LE Audio data.
 

Functions

int le_audio_concurrent_sync_num_get (uint8_t *num_streams, enum bt_audio_location *locations)
 Get the number of active streams.
 
int le_audio_metadata_populate (struct audio_metadata *meta, const struct bt_bap_stream *stream, const struct bt_iso_recv_info *info, const struct net_buf *audio_frame)
 Function to populate the audio metadata.
 
int le_audio_ep_state_get (struct bt_bap_ep const *const ep, uint8_t *state)
 Get the current state of an endpoint.
 
bool le_audio_ep_state_check (struct bt_bap_ep const *const ep, enum bt_bap_ep_state state)
 Check if an endpoint is in the given state. If the endpoint is NULL, it is not in the given state, and this function returns false.
 
bool le_audio_ep_qos_configured (struct bt_bap_ep const *const ep)
 Check if an endpoint has had the QoS configured. If the endpoint is NULL, it is not in the state, and this function returns false.
 
int le_audio_freq_hz_get (const struct bt_audio_codec_cfg *codec, int *freq_hz)
 Decode the audio sampling frequency in the codec configuration.
 
int le_audio_duration_us_get (const struct bt_audio_codec_cfg *codec, int *frame_dur_us)
 Decode the audio frame duration in us in the codec configuration.
 
int le_audio_octets_per_frame_get (const struct bt_audio_codec_cfg *codec, uint32_t *octets_per_sdu)
 Decode the number of octets per frame in the codec configuration.
 
int le_audio_frame_blocks_per_sdu_get (const struct bt_audio_codec_cfg *codec, uint32_t *frame_blks_per_sdu)
 Decode the number of frame blocks per SDU in the codec configuration.
 
int le_audio_bitrate_get (const struct bt_audio_codec_cfg *const codec, uint32_t *bitrate)
 Get the bitrate for the codec configuration.
 
int le_audio_stream_dir_get (struct bt_bap_stream const *const stream)
 Get the direction of the stream provided.
 
bool le_audio_bitrate_check (const struct bt_audio_codec_cfg *codec)
 Check that the bitrate is within the supported range.
 
bool le_audio_freq_check (const struct bt_audio_codec_cfg *codec)
 Check that the sample rate is supported.
 
void le_audio_print_codec (const struct bt_audio_codec_cfg *codec, enum bt_audio_dir dir)
 Print the codec configuration.
 
int le_audio_print_qos_from_stream (struct bt_bap_stream const *const stream)
 Print the QoS configuration for a stream.
 
int le_audio_print_unicast_group (struct bt_cap_unicast_group const *const unicast_group)
 Print the unicast group information.