-
Notifications
You must be signed in to change notification settings - Fork 8k
Bluetooth: BAP: BASE: Split bt_bap_base_get_base_from_ad #95594
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
base: main
Are you sure you want to change the base?
Conversation
8929aae
to
b3dfde8
Compare
subsys/bluetooth/audio/bap_base.c
Outdated
} | ||
|
||
if (net_buf->len < BASE_CODEC_ID_SIZE) { | ||
LOG_DBG("Invalid BASE length: %u", net_buf->size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we have a lot of duplicate LOG_DBG("Invalid BASE length: %u", net_buf->size);
, it would be hard to identify which one it is from debug log.
It would be better to add more info, such as:
LOG_DBG("Invalid BASE length: %u, for codec id", net_buf->size);
b3dfde8
to
8095eb1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors the bt_bap_base_get_base_from_ad
function by extracting subgroup validation logic into a separate base_pull_subgroup
function to reduce complexity and address Sonarcloud code quality concerns.
- Extracts subgroup parsing logic into a new static function
base_pull_subgroup
- Simplifies the main function by replacing inline validation with function calls
- Updates
bt_bap_base_foreach_subgroup
to use the new helper function
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
8095eb1
to
d02d698
Compare
d02d698
to
4ce7557
Compare
Split the subgroup validation from bt_bap_base_get_base_from_ad into a new function base_pull_subgroup to make the function simpler and make Sonarcloud happy. The new function, base_pull_subgroup, is also used in the bt_bap_base_foreach_subgroup to reduce code duplication. Signed-off-by: Emil Gydesen <[email protected]>
4ce7557
to
e5b3d68
Compare
|
Split the subgroup validation from
bt_bap_base_get_base_from_ad into a new function
base_pull_subgroup to make the function simpler and make Sonarcloud happy.