Skip to content

tests: Bluetooth: Audio: Add common start_broadcast_adv #90434

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

Merged
merged 1 commit into from
Jul 1, 2025

Conversation

Thalley
Copy link
Collaborator

@Thalley Thalley commented May 24, 2025

Add a common function, start_broadcast_adv, to start
broadcast advertisement in the LE Audio BSIM tests.

@Thalley Thalley marked this pull request as ready for review May 24, 2025 16:22
@Thalley Thalley marked this pull request as draft May 24, 2025 16:23
@Thalley Thalley force-pushed the bsim_start_broadcast_adv branch 4 times, most recently from 0b37aa5 to a1090c5 Compare June 19, 2025 10:15
@Thalley Thalley marked this pull request as ready for review June 23, 2025 20:03
@Thalley Thalley requested a review from Copilot June 23, 2025 20:05
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 PR consolidates the logic for starting broadcast advertising in the LE Audio BSIM tests by introducing a common utility function, start_broadcast_adv, to replace duplicated implementations across test files.

  • Remove duplicated start_extended_adv functions.
  • Update test files (pbp_public_broadcast_source_test.c, gmap_ugg_test.c, and cap_initiator_broadcast_test.c) to invoke the common function.
  • Add the declaration in common.h and the implementation in common.c.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/bsim/bluetooth/audio/src/pbp_public_broadcast_source_test.c Replaced start_extended_adv with start_broadcast_adv call
tests/bsim/bluetooth/audio/src/gmap_ugg_test.c Replaced start_extended_adv with start_broadcast_adv call
tests/bsim/bluetooth/audio/src/common.h Added declaration of start_broadcast_adv
tests/bsim/bluetooth/audio/src/common.c Added implementation for start_broadcast_adv
tests/bsim/bluetooth/audio/src/cap_initiator_broadcast_test.c Replaced start_extended_adv with start_broadcast_adv call (multiple sites)
Comments suppressed due to low confidence (4)

tests/bsim/bluetooth/audio/src/common.c:250

  • Consider adding inline documentation for start_broadcast_adv specifying its error handling strategy and its reliance on the FAIL macro, so that future maintainers understand that it does not return error codes.
void start_broadcast_adv(struct bt_le_ext_adv *adv)

tests/bsim/bluetooth/audio/src/pbp_public_broadcast_source_test.c:269

  • Replacing start_extended_adv with start_broadcast_adv here is fine as long as the internal error handling (using FAIL) meets the test failure requirements. Please verify that the change does not alter the intended test behavior.
		start_broadcast_adv(adv);

tests/bsim/bluetooth/audio/src/gmap_ugg_test.c:1206

  • Ensure that replacing start_extended_adv with start_broadcast_adv maintains consistent error handling behavior, as the new function handles errors internally via FAIL without returning an error code.
	start_broadcast_adv(adv);

tests/bsim/bluetooth/audio/src/cap_initiator_broadcast_test.c:646

  • Since multiple call sites now use start_broadcast_adv instead of start_extended_adv, please ensure that the internal error handling via FAIL meets all test scenarios across this file.
	start_broadcast_adv(adv);

Add a common function, start_broadcast_adv, to start
broadcast advertisement in the LE Audio BSIM tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
@Thalley Thalley force-pushed the bsim_start_broadcast_adv branch from a1090c5 to 6553c9b Compare July 1, 2025 12:22
Copy link

sonarqubecloud bot commented Jul 1, 2025

@Thalley Thalley added this to the v4.2.0 milestone Jul 1, 2025
@dkalowsk dkalowsk merged commit 2298ec4 into zephyrproject-rtos:main Jul 1, 2025
28 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in Bluetooth LE Audio Jul 1, 2025
@Thalley Thalley deleted the bsim_start_broadcast_adv branch July 1, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants