Skip to content

Conversation

@Thalley
Copy link
Contributor

@Thalley Thalley commented Dec 16, 2025

The implementation only used the receive state's PA sync state to determine whether to call the PA sync req or PA sync term req, but that state does not include the syncing state.

Rather than using the receive state's PA sync state, we add a local boolean to keep track of whether the PA sync was requested, so if we receive a mod_src with PA sync == BT_BAP_BASS_PA_REQ_NO_SYNC then we request a termination, even if the PA sync was not established yet.

Some cleanup in the mutex handling was also done as part of this.

@Thalley Thalley requested a review from Copilot December 16, 2025 15:40
Copy link

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 PR fixes issues with PA (Periodic Advertising) sync request handling in the Bluetooth BAP scan delegator by introducing a local boolean flag to track sync requests independently of the PA sync state. This addresses a gap where the syncing state was not properly tracked, leading to incorrect behavior when handling PA sync termination requests.

Key Changes:

  • Added pa_sync_requested boolean flag to track whether a PA sync has been requested, independent of the actual sync state
  • Refactored mutex handling to be more robust when callback operations fail
  • Consolidated receive state cleanup logic into a reusable free_recv_state() function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Thalley Thalley requested a review from Copilot December 16, 2025 16:35
Copy link

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The implementation only used the receive state's PA sync state
to determine whether to call the PA sync req or PA sync term req,
but that state does not include the syncing state.

Rather than using the receive state's PA sync state, we add a local
boolean to keep track of whether the PA sync was requested, so if
we receive a mod_src with PA sync == BT_BAP_BASS_PA_REQ_NO_SYNC then
we request a termination, even if the PA sync was not established yet.

Some cleanup in the mutex handling was also done as part of this.

Signed-off-by: Emil Gydesen <[email protected]>
@sonarqubecloud
Copy link

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

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants