-
Notifications
You must be signed in to change notification settings - Fork 217
Enhance build of advertising data #117
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
Merged
facchinm
merged 8 commits into
arduino-libraries:master
from
polldo:advertising_scanresponse_data
Oct 29, 2020
Merged
Enhance build of advertising data #117
facchinm
merged 8 commits into
arduino-libraries:master
from
polldo:advertising_scanresponse_data
Oct 29, 2020
Conversation
This file contains hidden or 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
… data more flexible
Now all the set methods of advertising data parameters return a bool value. This bool indicates whether the parameter has been correctly set or not, depending on the size of the passed value. A remaining length parameter of advertising data has been introduced. It can be publicly read, it indicates how many bytes can be still written into the packet.
In BLELocalDevice constructor, the flags field of the advertising data is set to a default value. If a new advertising data is passed to BLELocalDevice, then: if it has no flags -> default flags are set (if there is enough space) if it already has flags -> nothing happens, the already set flags are used
Add raw data class. When an AdvertisingData object has a rawData parameter set, the only advertised data will be the rawData parameter itself.
If the new value for the parameter is not valid, because too large, then the old value will remain the actual value of the parameter.
02d189a
to
19e8d72
Compare
This was referenced Nov 2, 2020
Closed
If I didn't misunderstand all this implementation is for peripheral mode. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
While the old way of preparing advertising data is still supported, an alternative enhanced method to build advertising packets is now available.
It consists in defining and configuring an object of type 'BLEAdvertisingData' to build the desired packet.
When it has been configured, by setting the appropriate parameters, it can be used to populate the advertising data packet or the scan response data packet.
Following this way, the user can decide in which packet each parameter should be put.
Also, it is now possible to configure an advertising packet (advertising or scan response) by passing a raw data packet.
If an advertising packet has a raw data parameter set, all its other parameters will be ignored.
Also, advertising parameters such as manufacturer data, service data or raw data should have a GLOBAL scope, because they are passed as pointers and are not copied internally.