Skip to content
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

bluetooth: tester: audio: Add NULL checks #82530

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

Conversation

alexsven
Copy link
Collaborator

@alexsven alexsven commented Dec 4, 2024

  • Add NULL checks for broadcast_source_stop
  • Add NULL checks for broadcast_source_release
  • Return -ESRCH if trying to stop ext_adv before creation

- Add NULL checks for broadcast_source_stop
- Add NULL checks for broadcast_source_release
- Return -ESRCH if trying to stop ext_adv before creation

Signed-off-by: Alexander Svensen <[email protected]>
Comment on lines +700 to +703
/* If no source has been created yet, there is nothing to release */
if (source == NULL || source->cap_broadcast == NULL) {
return BTP_STATUS_SUCCESS;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@sjanc I think this is a missing part of the existing BTP documentation. The documentation only contain information about what the command and responses contain, but unlike e.g. the HCI specification, it does not describe the expected behavior of commands in error cases.

For example it seems that BlueKitchen will return success when removing or stopping a non-existing source, where Zephyr (until this PR) would return an error.

I think that if we want BTP to be a proper protocol, we need to start expanding with additional status codes as well as expected behavior, otherwise it's basically a guessing game for the DUT when implementing it if the autopts client expects undocumented behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Audio area: Bluetooth Qualification Bluetooth Qualification -related issues and pull requests area: Bluetooth
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

5 participants