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

Make UARTService characteristics be at least as large as max MTU-3 #203

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

dhalbert
Copy link
Collaborator

Fixes #94.

Nordic UART Service clients expect that they will be able to send MTU-3 bytes all at once, in a single write. The current code was expecting no more than 20-byte writes.

Currently the maximum MTU-3 used by all CircuitPython ports is 512-3 (which is wrong, it should be 512). Change the max_length for the characteristic to be 512, and also enlarge the PacketBuffer correspondingly.

Tested with UART sends from Adafruit Bluefruit Connect app and nRF Toolbox on iOS on nRF52840 and Metro ESP32-S3. Also tested for regression with an nRF52840 uART client.

@dhalbert
Copy link
Collaborator Author

User Thinman in discord tested and it fixes their problem.

@dhalbert dhalbert requested a review from a team October 18, 2024 03:37
@dhalbert dhalbert requested a review from tannewt October 21, 2024 17:56
@dhalbert dhalbert force-pushed the nus-buffers-at-least-mtu branch from 19fae83 to d1d3fea Compare October 21, 2024 17:57
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@tannewt tannewt merged commit 6afb85a into adafruit:main Oct 21, 2024
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 22, 2024
Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 10.0.9 from 10.0.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#203 from dhalbert/nus-buffers-at-least-mtu
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#206 from dhalbert/pnp_id-defaults
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#204 from adafruit/dhalbert-patch-1
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#202 from ktnyt/device-info-pnp-id

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_USB_Host_Mass_Storage, Adafruit_CircuitPython_USB_Host_MIDI

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
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.

Receiving >20 bytes at once from Bluefruit Connect app not working
2 participants