feat(ble): Enable Bluetooth LE Connection Subrating for split communication - #1008
Conversation
Size Report
|
Yes, the fix looks fine
I don't see any issue max_latency = 30
Yeah, only encoded buffer should be sent, that needs a fix. The result is quite impressive! Thanks a lot for your effort! |
30443eb to
f0ef276
Compare
|
The pull request should be ready:
|
HaoboGu
left a comment
There was a problem hiding this comment.
Fantastic! It looks great.
Could you also add a table of the default connection parameters/subrating parameters somewhere?
Thanks.
Of course, where should I put it? In the docs? or in split/ble/central.rs? I also did some measurements: |
|
I prefer to put it in split/ble/central.rs because it's a developer oriented info |
|
And the result is quite impressive! Could you also test the avg current when SC=10? |
|
@tompre I'm merging it now, thanks very much for bringing this feature to RMK! |
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.