Commit 1dd59ea2 authored by Emil Gydesen's avatar Emil Gydesen Committed by David Leach
Browse files

Bluetooth: Audio: Remove BT_AUDIO_BROADCAST_CODE_SIZE



Removed the LE Audio specific definition and instead
refer to the value defined by iso.h as it is ISO/Core
that defines this size, and not BAP/Audio.

Signed-off-by: default avatarEmil Gydesen <emil.gydesen@nordicsemi.no>
parent 0705a630
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -395,6 +395,9 @@ Bluetooth Audio
  instances of :c:func:`bt_cap_initiator_broadcast_get_id` and
  :c:func:`bt_bap_broadcast_source_get_id` has been removed(:github:`80228`)

* ``BT_AUDIO_BROADCAST_CODE_SIZE`` has been removed and ``BT_ISO_BROADCAST_CODE_SIZE`` should be
  used instead. (:github:`80217`)

Bluetooth Classic
=================

+0 −3
Original line number Diff line number Diff line
@@ -49,9 +49,6 @@ extern "C" {
#define BT_AUDIO_PD_MAX                          0xFFFFFFU
/** Indicates that the unicast server does not have a preference for any retransmission number */
#define BT_AUDIO_RTN_PREF_NONE                   0xFFU
/** Maximum size of the broadcast code in octets */
#define BT_AUDIO_BROADCAST_CODE_SIZE             16

/** The minimum size of a Broadcast Name as defined by Bluetooth Assigned Numbers */
#define BT_AUDIO_BROADCAST_NAME_LEN_MIN          4
/** The maximum size of a Broadcast Name as defined by Bluetooth Assigned Numbers */
+6 −5
Original line number Diff line number Diff line
@@ -572,7 +572,7 @@ struct bt_bap_scan_delegator_recv_state {
	 *
	 * Only valid if encrypt_state is @ref BT_BAP_BIG_ENC_STATE_BCODE_REQ
	 */
	uint8_t bad_code[BT_AUDIO_BROADCAST_CODE_SIZE];
	uint8_t bad_code[BT_ISO_BROADCAST_CODE_SIZE];

	/** Number of subgroups */
	uint8_t num_subgroups;
@@ -652,7 +652,7 @@ struct bt_bap_scan_delegator_cb {
	 */
	void (*broadcast_code)(struct bt_conn *conn,
			       const struct bt_bap_scan_delegator_recv_state *recv_state,
			       const uint8_t broadcast_code[BT_AUDIO_BROADCAST_CODE_SIZE]);
			       const uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE]);
	/**
	 * @brief Broadcast Isochronous Stream synchronize request
	 *
@@ -2058,7 +2058,7 @@ struct bt_bap_broadcast_source_param {
	 *   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_AUDIO_BROADCAST_CODE_SIZE];
	uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE];

#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__)
	/**
@@ -2298,7 +2298,8 @@ int bt_bap_broadcast_sink_create(struct bt_le_per_adv_sync *pa_sync, uint32_t br
 * @return 0 in case of success or negative value in case of error.
 */
int bt_bap_broadcast_sink_sync(struct bt_bap_broadcast_sink *sink, uint32_t indexes_bitfield,
			       struct bt_bap_stream *streams[], const uint8_t broadcast_code[16]);
			       struct bt_bap_stream *streams[],
			       const uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE]);

/**
 * @brief Stop audio broadcast sink.
@@ -2799,7 +2800,7 @@ int bt_bap_broadcast_assistant_mod_src(
 */
int bt_bap_broadcast_assistant_set_broadcast_code(
	struct bt_conn *conn, uint8_t src_id,
	const uint8_t broadcast_code[BT_AUDIO_BROADCAST_CODE_SIZE]);
	const uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE]);

/**
 * @brief Remove a source from the server.
+1 −1
Original line number Diff line number Diff line
@@ -482,7 +482,7 @@ struct bt_cap_initiator_broadcast_create_param {
	 *   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_AUDIO_BROADCAST_CODE_SIZE];
	uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE];

#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__)
	/**
+3 −3
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ static const struct bt_audio_codec_cap codec_cap = BT_AUDIO_CODEC_CAP_LC3(
static const uint32_t bis_index_mask = BIT_MASK(ARRAY_SIZE(streams));
static uint32_t requested_bis_sync;
static uint32_t bis_index_bitfield;
static uint8_t sink_broadcast_code[BT_AUDIO_BROADCAST_CODE_SIZE];
static uint8_t sink_broadcast_code[BT_ISO_BROADCAST_CODE_SIZE];

uint64_t total_rx_iso_packet_count; /* This value is exposed to test code */

@@ -966,13 +966,13 @@ static int pa_sync_term_req_cb(struct bt_conn *conn,

static void broadcast_code_cb(struct bt_conn *conn,
			      const struct bt_bap_scan_delegator_recv_state *recv_state,
			      const uint8_t broadcast_code[BT_AUDIO_BROADCAST_CODE_SIZE])
			      const uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE])
{
	printk("Broadcast code received for %p\n", recv_state);

	req_recv_state = recv_state;

	(void)memcpy(sink_broadcast_code, broadcast_code, BT_AUDIO_BROADCAST_CODE_SIZE);
	(void)memcpy(sink_broadcast_code, broadcast_code, BT_ISO_BROADCAST_CODE_SIZE);

	k_sem_give(&sem_broadcast_code_received);
}
Loading