Skip to content

Commit

Permalink
Bluetooth: Audio: API for the distribute broadcast code procedure
Browse files Browse the repository at this point in the history
Define the API for the distribute broadcast code CAP procedure

Signed-off-by: Andries Kruithof <[email protected]>
  • Loading branch information
kruithofa committed Nov 5, 2024
1 parent c22233a commit 7ab1fe0
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
44 changes: 43 additions & 1 deletion include/zephyr/bluetooth/audio/cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,6 @@ int bt_cap_commander_broadcast_reception_start(
const struct bt_cap_commander_broadcast_reception_start_param *param);

/** Parameters for stopping broadcast reception */

struct bt_cap_commander_broadcast_reception_stop_member_param {
/** Coordinated or ad-hoc set member. */
union bt_cap_set_member member;
Expand Down Expand Up @@ -982,6 +981,49 @@ struct bt_cap_commander_broadcast_reception_stop_param {
int bt_cap_commander_broadcast_reception_stop(
const struct bt_cap_commander_broadcast_reception_stop_param *param);

/** Parameters for distributing broadcast code */
struct bt_cap_commander_distribute_broadcast_code_member_param {
/** Coordinated or ad-hoc set member. */
union bt_cap_set_member member;

/** Source ID of the receive state. */
uint8_t src_id;
};

struct bt_cap_commander_distribute_broadcast_code_param {
/** The type of the set. */
enum bt_cap_set_type type;

/** The set of devices for this procedure */
struct bt_cap_commander_distribute_broadcast_code_member_param *param;

/** The number of parameters in @p param */
size_t count;

/**
* @brief 16-octet broadcast code.
*
* If the value is a string or a the value is less than 16 octets,
* the remaining octets shall be 0.
*
* Example:
* The string "Broadcast Code" shall be
* [42 72 6F 61 64 63 61 73 74 20 43 6F 64 65 00 00]
*/
uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE];
};

/**
* @brief Distributes the broadcast code on one or more remote Common Audio Profile
* Acceptors
*
* @param param The parameters for distributing the broadcast code
*
* @return 0 on success or negative error value on failure.
*/
int bt_cap_commander_distribute_broadcast_code(
const struct bt_cap_commander_distribute_broadcast_code_param *param);

/** Parameters for changing absolute volume */
struct bt_cap_commander_change_volume_param {
/** The type of the set. */
Expand Down
6 changes: 6 additions & 0 deletions subsys/bluetooth/audio/cap_commander.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,12 @@ int bt_cap_commander_broadcast_reception_stop(
return 0;
}

int bt_cap_commander_distribute_broadcast_code(
const struct bt_cap_commander_distribute_broadcast_code_param *param)
{
return -ENOSYS;
}

#endif /* CONFIG_BT_BAP_BROADCAST_ASSISTANT */

static void cap_commander_proc_complete(void)
Expand Down

0 comments on commit 7ab1fe0

Please sign in to comment.