Skip to content

Conversation

Thalley
Copy link
Contributor

@Thalley Thalley commented Jun 13, 2025

Refactor the bt_bap_broadcast_assistant_discover function to not read receives at the end of discovery.
This makes the function more true to what it is supposed to do, and significantly reduces the complexity of the procedure and the read callback.

Users will be required to, if wanted, to read the
receive state themselves with the existing
bt_bap_broadcast_assistant_read_recv_state.

Copilot

This comment was marked as outdated.

@Thalley Thalley force-pushed the bap_broadcast_assistant_discov_refact branch from 953bea5 to ec091ef Compare June 16, 2025 11:43
@Thalley Thalley force-pushed the bap_broadcast_assistant_discov_refact branch from ec091ef to 34ffd28 Compare July 1, 2025 12:24
@danieldegrasse
Copy link
Contributor

@Thalley can you update this to target 4.3 migration guide?

@Thalley Thalley force-pushed the bap_broadcast_assistant_discov_refact branch from 34ffd28 to d3a7ba6 Compare July 29, 2025 09:19
@larsgk
Copy link
Contributor

larsgk commented Aug 14, 2025

Should the bap_broadcast_assistant sample also be updated?

@Thalley Thalley force-pushed the bap_broadcast_assistant_discov_refact branch from d3a7ba6 to daa2496 Compare August 15, 2025 08:34
@zephyrbot zephyrbot added the area: Samples Samples label Aug 16, 2025
@Thalley
Copy link
Contributor Author

Thalley commented Aug 16, 2025

Should the bap_broadcast_assistant sample also be updated?

Updated the sample

@Thalley Thalley requested a review from Copilot August 16, 2025 10:38
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors the Bluetooth BAP Broadcast Assistant discover function to simplify its behavior by removing automatic receive state reads at the end of discovery. This breaking change requires users to manually read receive states using the existing API if needed.

  • Simplified bt_bap_broadcast_assistant_discover to only perform discovery without automatic receive state reads
  • Removed complex read callback logic that handled both discovery and receive state operations
  • Updated sample application to manually read receive states after discovery completion

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
subsys/bluetooth/audio/bap_broadcast_assistant.c Refactored discover function and simplified read callback by removing automatic receive state reads
samples/bluetooth/bap_broadcast_assistant/src/main.c Added manual receive state reading after discovery to maintain functionality
doc/releases/migration-guide-4.3.rst Documented the breaking change for users

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

larsgk
larsgk previously approved these changes Aug 19, 2025
@Thalley Thalley assigned Thalley and unassigned dkalowsk and danieldegrasse Aug 19, 2025
@Thalley Thalley force-pushed the bap_broadcast_assistant_discov_refact branch from 8cf296d to 03db072 Compare August 22, 2025 13:49
@Thalley
Copy link
Contributor Author

Thalley commented Aug 22, 2025

Rebased to solve merge conflicts

@Thalley Thalley requested a review from larsgk August 22, 2025 13:49
@Thalley Thalley force-pushed the bap_broadcast_assistant_discov_refact branch 2 times, most recently from b8d2459 to 59ddb60 Compare August 22, 2025 15:45
@zephyrbot zephyrbot added the platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim label Aug 22, 2025
@Thalley Thalley force-pushed the bap_broadcast_assistant_discov_refact branch 3 times, most recently from 272229b to 572875b Compare September 8, 2025 09:18
@Thalley
Copy link
Contributor Author

Thalley commented Sep 8, 2025

The failing test passes locally. I've tried a few different offsets and random seeds, but can't really find something that passes locally and in CI :(

@Thalley Thalley force-pushed the bap_broadcast_assistant_discov_refact branch from 572875b to 8f353cb Compare September 9, 2025 10:40
@Thalley Thalley force-pushed the bap_broadcast_assistant_discov_refact branch from 8f353cb to 71f1041 Compare September 17, 2025 09:24
@Thalley Thalley force-pushed the bap_broadcast_assistant_discov_refact branch from 71f1041 to 074a719 Compare October 7, 2025 08:48
@zephyrbot zephyrbot added the area: Tests Issues related to a particular existing or missing test label Oct 7, 2025
Refactor the bt_bap_broadcast_assistant_discover function
to not read receives at the end of discovery.
This makes the function more true to what it is supposed to
do, and significantly reduces the complexity of the
procedure and the read callback.

Users will be required to, if wanted, to read the
receive state themselves with the existing
bt_bap_broadcast_assistant_read_recv_state.

The start_offset had to be modified to avoid issues with
PA sync.

Signed-off-by: Emil Gydesen <[email protected]>
Once the BASS has been discovered, the sample will now attempt
to read all the receive states on the remote device.

The receive states will only be logged, and the sample will
not (yet) perform any logic on them (to e.g. determiner whether
it needs to perform a remove source operation before the add
source, or perform a modify source). That behavior is postponed
to a future commit, as the purpose of this is to showcase
reading the receive states.

Signed-off-by: Emil Gydesen <[email protected]>
Modify and add some printk statements for the tests, as some were
missing the newline.

Signed-off-by: Emil Gydesen <[email protected]>
When using PAST, it is best not to use an ACL that is a multiple
of the PA or ISO interval to avoid overlaps.

Signed-off-by: Emil Gydesen <[email protected]>
@Thalley Thalley force-pushed the bap_broadcast_assistant_discov_refact branch from 074a719 to cbd41a5 Compare October 13, 2025 12:07
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Audio area: Bluetooth area: Samples Samples area: Tests Issues related to a particular existing or missing test platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim Release Notes To be mentioned in the release notes

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

5 participants