-
Notifications
You must be signed in to change notification settings - Fork 216
Allow valueSize changes after initialization to adjust to MTU size #391
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
Open
matpowel
wants to merge
3
commits into
arduino-libraries:master
Choose a base branch
from
matpowel:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #391 +/- ##
=========================================
- Coverage 9.62% 9.56% -0.07%
=========================================
Files 28 28
Lines 3656 3679 +23
=========================================
Hits 352 352
- Misses 3304 3327 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Memory usage change @ d22a91c
Click for full report table
Click for full report CSV
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
When trying to implement a BLE MIDI wrapper on top of ArduinoBLE I was losing data because the MTU negotiated with the server (in this case Apple Mac or iOS devices) was not matching the valueSize / buffer. Normally this might not be an issue but in the particular case of MIDI over BLE, the official spec and parsing of the data requires that packets are handled discreetly, so if the server thinks the packet size is X and we (the client) think it's Y then messages are sent incorrectly.
I suspect there are also other situations where matching the buffer size in the BLE parsing code and the MTU is better, more efficient and/or the only way to be accurate.
This implementation adds the methods necessary to resize, check the MTU size and be notified of MTU negotiation changes, but leaves the decision to resize up to the user of the library.