pw_bluetooth_sapphire: Refactor TxEngine to allow queueing SDUs
This change allows SDUs to be queued in the channel itself rather than
maintaining an internal queue in each engine. This is currently only a
refactor and should NOT change any actual behavior.
The change can be summarized as:
* `TxEngine::TxChannel::SendFrame` is now used instead of callbacks.
* `TxEngine::TxChannel::GetNextQueuedSdu` has been added to allow
TxEngines to retrieve SDUs from the channel queue.
* `TxEngine::QueueSdu` has been removed entirely, instead the channel
will notify the TxEngine that a new SDU is available for processing
by calling `TxEngine::NotifySduQueued()`. The engine can then make a
decision on whether it is ready to process the SDU immediately or
wait until some other state changes for flow control or similar.
The enhanced retransmission mode does not (yet) use this queueing
functionality as of this CL, this is for two reasons, both of which are
intended to minimize the risk of this change breaking existing
functionality:
1. The intent of this CL is to be a refactor only, so actual behavioral
changes are considered out of scope for this change. Behavioral
changes will be introduced in a future CL.
2. The enhanced retransmission mode has some complexity that needs to
be accounted for in a more detailed CL.
Test: fx test with all tests under src/connectivity/bluetooth
Test: Manual of A2DP source/sink and AVRCP.
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/988215
GitOrigin-RevId: 6760ecebd67139e37d0b207ca5c70fa8583f6059
Change-Id: Ibb0af949ce75ef26c92275ec76329186f93e6f47
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/218915
Reviewed-by: Faraaz Sareshwala <fsareshwala@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Jason Graffius <jgraff@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.