Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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];
Comment on lines +1003 to +1013
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope of this PR, but perhaps we should consider defining a type for the broadcast code (similar to the UUID type in #77884), so that we don't have to write the explanation of how a broadcast code should be formatted all the places it is used, and can just add that to the type instead

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, since this piece of code is in 3 files: iso.h, bap.h, and cap.h and the description is (more or less) copied to all places

};

/**
* @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
Loading