You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As promised a few months back, here is a first draft for enabling connection subrating support on the peripheral connection.
Initial Results
Using a subrating factor of 30 (equivalent to a connection interval of 225ms):
Central: 50–80 µA
Peripheral: ~30 µA
The latency to return to 7.5ms intervals is 225ms + 2×7.5ms (compared to 5–7 seconds when using standard connection updates).
This allows us to use sleep mode much more aggressively, as input lag only impacts the very first keystroke.
Open Questions / Next Steps
Fast Polling Loop (Resolved) #886 introduced a fast polling loop (5ms) leading to 500–700 µA current draw on Central. (Tracked/resolved via #1010).
Central Max Latency
I adjusted Central max latency to match the subrating duration. Unsure what effect this has on OS-level support.
We will use max_latency = 30 for now and leave timing optimization for a later commit.
GATT Buffer Sizing (Resolved) SplitMessage GATT messages were sending the entire buffer rather than just the encoded payload. Truncating to the encoded data allows faster resets of the subrate factor. (Merged via #1011).
#886 introduced a fast polling loop (5ms) which leads to 500-700uA of current draw in central. We should fix that anyway I think.
Yes, the fix looks fine
I changed Central max latency to be similarly long as the subrating. I'm unsure what this does with OS support.
I don't see any issue max_latency = 30
SplitMessage gatt messages always use the full buffer rather than only sending the encoded data, sending only the data might allow for faster resets of the subrate factor, if this was not done on purpose?
Yeah, only encoded buffer should be sent, that needs a fix. to_slice returns the encoded buf so the fix is easy.
The result is quite impressive! Thanks a lot for your effort!
I updated the description. With the work on #1027 and #1028 ongoing, I think I wait for them to merge before fixing conflicts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As promised a few months back, here is a first draft for enabling connection subrating support on the peripheral connection.
Initial Results
Using a subrating factor of 30 (equivalent to a connection interval of 225ms):
The latency to return to 7.5ms intervals is 225ms + 2×7.5ms (compared to 5–7 seconds when using standard connection updates).
This allows us to use sleep mode much more aggressively, as input lag only impacts the very first keystroke.
Open Questions / Next Steps
Fast Polling Loop (Resolved)
#886 introduced a fast polling loop (5ms) leading to 500–700 µA current draw on Central. (Tracked/resolved via #1010).
Central Max Latency
I adjusted Central max latency to match the subrating duration. Unsure what effect this has on OS-level support.
We will use max_latency = 30 for now and leave timing optimization for a later commit.
GATT Buffer Sizing (Resolved)
SplitMessageGATT messages were sending the entire buffer rather than just the encoded payload. Truncating to the encoded data allows faster resets of the subrate factor. (Merged via #1011).rmk/src/split/ble/peripheral.rs#L113-L116andrmk/src/split/ble/central.rs#L449-L450.