Skip to content

Commit 7ab1fe0

Browse files
author
Andries Kruithof
committed
Bluetooth: Audio: API for the distribute broadcast code procedure
Define the API for the distribute broadcast code CAP procedure Signed-off-by: Andries Kruithof <[email protected]>
1 parent c22233a commit 7ab1fe0

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

include/zephyr/bluetooth/audio/cap.h

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,6 @@ int bt_cap_commander_broadcast_reception_start(
948948
const struct bt_cap_commander_broadcast_reception_start_param *param);
949949

950950
/** Parameters for stopping broadcast reception */
951-
952951
struct bt_cap_commander_broadcast_reception_stop_member_param {
953952
/** Coordinated or ad-hoc set member. */
954953
union bt_cap_set_member member;
@@ -982,6 +981,49 @@ struct bt_cap_commander_broadcast_reception_stop_param {
982981
int bt_cap_commander_broadcast_reception_stop(
983982
const struct bt_cap_commander_broadcast_reception_stop_param *param);
984983

984+
/** Parameters for distributing broadcast code */
985+
struct bt_cap_commander_distribute_broadcast_code_member_param {
986+
/** Coordinated or ad-hoc set member. */
987+
union bt_cap_set_member member;
988+
989+
/** Source ID of the receive state. */
990+
uint8_t src_id;
991+
};
992+
993+
struct bt_cap_commander_distribute_broadcast_code_param {
994+
/** The type of the set. */
995+
enum bt_cap_set_type type;
996+
997+
/** The set of devices for this procedure */
998+
struct bt_cap_commander_distribute_broadcast_code_member_param *param;
999+
1000+
/** The number of parameters in @p param */
1001+
size_t count;
1002+
1003+
/**
1004+
* @brief 16-octet broadcast code.
1005+
*
1006+
* If the value is a string or a the value is less than 16 octets,
1007+
* the remaining octets shall be 0.
1008+
*
1009+
* Example:
1010+
* The string "Broadcast Code" shall be
1011+
* [42 72 6F 61 64 63 61 73 74 20 43 6F 64 65 00 00]
1012+
*/
1013+
uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE];
1014+
};
1015+
1016+
/**
1017+
* @brief Distributes the broadcast code on one or more remote Common Audio Profile
1018+
* Acceptors
1019+
*
1020+
* @param param The parameters for distributing the broadcast code
1021+
*
1022+
* @return 0 on success or negative error value on failure.
1023+
*/
1024+
int bt_cap_commander_distribute_broadcast_code(
1025+
const struct bt_cap_commander_distribute_broadcast_code_param *param);
1026+
9851027
/** Parameters for changing absolute volume */
9861028
struct bt_cap_commander_change_volume_param {
9871029
/** The type of the set. */

subsys/bluetooth/audio/cap_commander.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,12 @@ int bt_cap_commander_broadcast_reception_stop(
671671
return 0;
672672
}
673673

674+
int bt_cap_commander_distribute_broadcast_code(
675+
const struct bt_cap_commander_distribute_broadcast_code_param *param)
676+
{
677+
return -ENOSYS;
678+
}
679+
674680
#endif /* CONFIG_BT_BAP_BROADCAST_ASSISTANT */
675681

676682
static void cap_commander_proc_complete(void)

0 commit comments

Comments
 (0)