-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Bluetooth: BAP: BA: Refactor discover to not do read #91587
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?
Bluetooth: BAP: BA: Refactor discover to not do read #91587
Conversation
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
This PR refactors bt_bap_broadcast_assistant_discover
to stop performing GATT reads of receive states automatically, requiring users to call bt_bap_broadcast_assistant_read_recv_state
themselves. It simplifies the discovery callback logic and updates the migration guide.
- Removed automatic read loop in
read_recv_state_cb
and caller - Updated
char_discover_func
to complete discovery immediately - Added migration note in documentation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
subsys/bluetooth/audio/bap_broadcast_assistant.c | Simplified read_recv_state_cb , removed automatic read loop, and updated discovery completion logic |
doc/releases/migration-guide-4.2.rst | Added note about manual receive-state reads after discovery |
Comments suppressed due to low confidence (4)
subsys/bluetooth/audio/bap_broadcast_assistant.c:565
- The callback signature no longer includes the
struct bt_gatt_read_params *params
parameter, but the function still referencesparams
inside. Restore theparams
argument or remove its usages to resolve the compile error.
static uint8_t read_recv_state_cb(struct bt_conn *conn, uint8_t err, const void *data, uint16_t length)
subsys/bluetooth/audio/bap_broadcast_assistant.c:568
- [nitpick] Consider renaming
active_recv_state
to something likehas_recv_state
orrecv_state_present
for clearer boolean semantics.
bool active_recv_state = data != NULL && length != 0;
subsys/bluetooth/audio/bap_broadcast_assistant.c:648
- With discovery no longer reading receive states, add or update unit tests to cover the new manual
bt_bap_broadcast_assistant_read_recv_state
flow and verifydiscover_complete
is called correctly.
bap_broadcast_assistant_discover_complete(conn, 0, inst->recv_state_cnt);
doc/releases/migration-guide-4.2.rst:374
- It may help to include a brief example or note about the asynchronous nature of
bt_bap_broadcast_assistant_read_recv_state
so users know to wait for the callback before proceeding.
* :c:func:`bt_bap_broadcast_assistant_discover` will now no longer perform reads of the remote BASS
953bea5
to
ec091ef
Compare
Refactor the bt_bap_broadcast_assistant_discover function to not read receives at the end of discovery. This makes the function more true to what it is supposed to do, and significantly reduces the complexity of the procedure and the read callback. Users will be required to, if wanted, to read the receive state themselves with the existing bt_bap_broadcast_assistant_read_recv_state. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
ec091ef
to
34ffd28
Compare
|
Refactor the bt_bap_broadcast_assistant_discover function to not read receives at the end of discovery.
This makes the function more true to what it is supposed to do, and significantly reduces the complexity of the procedure and the read callback.
Users will be required to, if wanted, to read the
receive state themselves with the existing
bt_bap_broadcast_assistant_read_recv_state.