Skip to content
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

sd: MTU exchange #295

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

sd: MTU exchange #295

wants to merge 7 commits into from

Conversation

rdnt
Copy link

@rdnt rdnt commented Oct 1, 2024

This PR adds the capability to perform an MTU Exchange procedure from the central (gatt client - usually), and the ability to configure an ATT_MTU up to 247 bytes (allowing 244 bytes of application data).

  • The nrf Adapter interface has been adapted to include a Configure(cfg Config) error method that allows setting some initialization options for the SoftDevice before it is enabled.
  • An ExchangeMTU(mtu uint16) (uint16, error) function was added to the Device interface, that can be called from the gatt client to initiate an MTU exchange procedure.
  • The bluetooth adapter can still operate without these two function calls, in which case it will use the default configuration {EventLength=2, AttMtu=23}.

I have tested this implementation on two nicenano_v2 boards.
In my tests, I have found updating the event length can allow for increased bandwidth, so I also implemented a way to configure it.
I have made some experiments with adding Data Length Extension as well, but I reckon some initial feedback would be welcome before I delve into starting a proper implementation of DLE.

Do let me know if you would like to have a working example (maybe also in the source code?) with a 247 MTU exchange + throughput test of sorts.

Lastly, I can only test on s140v7, so I can't really verify that the peripheral-only variant (s113v7) works as expected. If someone else could lend a hand I would appreciate that.

Refs:

Relevant: #200 (comment), #142 (comment)

@rdnt rdnt marked this pull request as ready for review October 6, 2024 21:53
@rdnt
Copy link
Author

rdnt commented Oct 6, 2024

Heya folks! I'm marking this as ready-for-review, hoping for an initial review pass.
I am not very familiar with BLE, so any feedback, positive or negative, is welcome.

I reckon I saw somewhere (edit: #142 (comment)) that such a change requires implementation for two different platforms. I am not sure if I can commit to implementing this also for e.g. Linux, but if required I will see what I can do. Otherwise this PR can be left open as a working POC until someone contributes a relevant implementation for some other platform.

@rdnt rdnt changed the title sd: MTU exchange (draft) sd: MTU exchange Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant