aioble: Pass additional connection arguments to gap_connect. #906
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.
In my project I am connecting using aioble to a human input device. There is noticeable input lag. Turns out the RTT latency is a little over 200ms (I test this by timing
await char.write(b'foo', response=1)
). I suspect this is because the BLE connection interval is being set to 100ms. The gap_connect function allows settingmin_conn_interval_us
andmax_conn_interval_us
, however there is no way to do so using aioble.This PR allows the following additional arguments to be passed to
device.connect()
:These are passed as-is to
gap_connect()
. The default value for all of these isNone
, which causes gap_connect to use its own defaults.With this change I managed to get the RTT latency down to ~60ms, this feels a lot better in my project.
Package: https://joris-van-der-wel.github.io/micropython-lib/mip/gap_connect_params/