Skip to content

Commit

Permalink
nimble/audio: Add initial audio broadcast sink implementation
Browse files Browse the repository at this point in the history
This adds initial implementation of audio broadcast sink.
  • Loading branch information
MariuszSkamra committed Apr 23, 2024
1 parent e5a346b commit 05e1e3c
Show file tree
Hide file tree
Showing 15 changed files with 4,112 additions and 1 deletion.
28 changes: 28 additions & 0 deletions nimble/host/audio/include/audio/ble_audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
/** Broadcast Audio Broadcast Code Size. */
#define BLE_AUDIO_BROADCAST_CODE_SIZE 16

/** Basic Audio Announcement Service UUID. */
#define BLE_BASIC_AUDIO_ANNOUNCEMENT_SVC_UUID 0x1851

/** Broadcast Audio Announcement Service UUID. */
#define BLE_BROADCAST_AUDIO_ANNOUNCEMENT_SVC_UUID 0x1852

Expand Down Expand Up @@ -539,6 +542,9 @@ struct ble_audio_broadcast_name {
/** BLE Audio event: BASS - Set Broadcast Code */
#define BLE_AUDIO_EVENT_BASS_SET_BROADCAST_CODE 5

/** BLE Audio event: Broadcast Sink - Metadata Updated */
#define BLE_AUDIO_EVENT_BROADCAST_SINK_METADATA 6

/** @} */

/** @brief Broadcast Announcement */
Expand Down Expand Up @@ -589,6 +595,21 @@ struct ble_audio_event_bass_set_broadcast_code {
uint8_t broadcast_code[BLE_AUDIO_BROADCAST_CODE_SIZE];
};

/** @brief BASS Source Removed */
struct ble_audio_event_broadcast_sink_metadata {
/** Source ID */
uint8_t source_id;

/** BIS Index Mask */
uint8_t bis_sync;

/** Scan Delegator Subgroup: Metadata */
const uint8_t *metadata;

/** Scan Delegator Subgroup: Metadata length */
uint8_t metadata_length;
};

/**
* Represents a BLE Audio related event. When such an event occurs, the host
* notifies the application by passing an instance of this structure to an
Expand Down Expand Up @@ -647,6 +668,13 @@ struct ble_audio_event {
* Represents a Broadcast Code baing set in BASS.
*/
struct ble_audio_event_bass_set_broadcast_code bass_set_broadcast_code;

/**
* @ref BLE_AUDIO_EVENT_BROADCAST_SINK_METADATA
*
* Represents an update in Broadcast Sink Metadata.
*/
struct ble_audio_event_broadcast_sink_metadata broadcast_sink_metadata;
};
};

Expand Down
Loading

0 comments on commit 05e1e3c

Please sign in to comment.