Commit 8acada06 authored by Emil Gydesen's avatar Emil Gydesen Committed by Anas Nashif
Browse files

Bluetooth: Audio: Shell: clear static buffers for ad data



The buffers for the PBP advertising data as well as the
buffers for the BASE periodic advertising data were
not cleared, so calling the functions multiple times
would simply append the data rather than just setting
the new data.

Signed-off-by: default avatarEmil Gydesen <emil.gydesen@nordicsemi.no>
parent d229b89a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3740,6 +3740,8 @@ ssize_t audio_pa_data_add(struct bt_data *data_array,
		NET_BUF_SIMPLE_DEFINE_STATIC(base_buf, UINT8_MAX);
		int err;

		net_buf_simple_reset(&base_buf);

		err = bt_bap_broadcast_source_get_base(default_source.bap_source, &base_buf);
		if (err != 0) {
			printk("Unable to get BASE: %d\n", err);
+2 −0
Original line number Diff line number Diff line
@@ -1459,6 +1459,8 @@ ssize_t cap_initiator_pa_data_add(struct bt_data *data_array, const size_t data_
		NET_BUF_SIMPLE_DEFINE_STATIC(base_buf, UINT8_MAX);
		int err;

		net_buf_simple_reset(&base_buf);

		err = bt_cap_initiator_broadcast_get_base(default_source.cap_source, &base_buf);
		if (err != 0) {
			printk("Unable to get BASE: %d\n", err);
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ size_t pbp_ad_data_add(struct bt_data data[], size_t data_size)
{
	int err;

	net_buf_simple_reset(&pbp_ad_buf);

	err = bt_pbp_get_announcement(pba_metadata,
				      ARRAY_SIZE(pba_metadata),
				      pbp_features,