Skip to content

Bluetooth: CAP: Add cap_unicast_group API #86014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Thalley
Copy link
Collaborator

@Thalley Thalley commented Feb 19, 2025

Adds a new abstract struct for unicast group that is specific for CAP. The difference between this and the BAP unicast group, is that the parameters are CAP streams and thus ensuring that the streams in the group adhere to the additional requirements that CAP has on top of BAP.

Various samples, modules and tests have been updated to use the CAP struct and API.

@fabiobaltieri fabiobaltieri added this to the v4.2.0 milestone Feb 26, 2025
@Thalley Thalley assigned Thalley and unassigned kartben Mar 6, 2025
@Thalley Thalley force-pushed the cap_unicast_group branch 8 times, most recently from 4a3d5d5 to 8d2a059 Compare March 13, 2025 21:29
@Thalley Thalley force-pushed the cap_unicast_group branch from 8d2a059 to f2709a5 Compare March 24, 2025 13:34
@Thalley Thalley force-pushed the cap_unicast_group branch from f2709a5 to 8e21d26 Compare April 7, 2025 08:53
@Thalley Thalley requested a review from Copilot April 7, 2025 08:53
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.

Copilot reviewed 11 out of 13 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • doc/releases/release-notes-4.2.rst: Language not supported
  • tests/bluetooth/audio/cap_initiator/CMakeLists.txt: Language not supported

Comment on lines +106 to +108
free(group_param->params[0].rx_param->stream);
free(group_param->params[0].rx_param);
Copy link
Preview

Copilot AI Apr 7, 2025

Choose a reason for hiding this comment

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

The cleanup in the test fixture frees only the first parameter's allocations. If multiple stream parameters are allocated, this may lead to memory leaks. Consider iterating over all allocated stream parameters for proper deallocation.

Suggested change
free(group_param->params[0].rx_param->stream);
free(group_param->params[0].rx_param);
for (size_t i = 0; i < group_param->params_count; i++) {
free(group_param->params[i].rx_param->stream);
free(group_param->params[i].rx_param);
}

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is only a single call to calloc for these, so there should only be a single call to free for these

@Thalley Thalley force-pushed the cap_unicast_group branch from 8e21d26 to bafc7cc Compare May 5, 2025 11:00
@Thalley Thalley force-pushed the cap_unicast_group branch 2 times, most recently from 1f6a399 to 6407e31 Compare May 19, 2025 09:30
jthm-ot
jthm-ot previously approved these changes May 20, 2025
Adds a new abstract struct for unicast group that is
specific for CAP. The difference between this and the BAP
unicast group, is that the parameters are CAP streams and
thus ensuring that the streams in the group adhere to the
additional requirements that CAP has on top of BAP.

This also adds foreach functions for both CAP and BAP
to allow users to iterate on the streams in the
abstract groups.

Various samples, modules and tests have been updated
to use the CAP struct and API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
@Thalley
Copy link
Collaborator Author

Thalley commented May 23, 2025

Added 2 new functions to iterate on the streams in the BAP and CAP groups as well. Used by #85642

Copy link

@Thalley Thalley requested a review from jthm-ot May 23, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

5 participants