-
Notifications
You must be signed in to change notification settings - Fork 217
Add enhanced advertising examples #134
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
Add enhanced advertising examples #134
Conversation
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.
@polldo Interesting. Does it affect the performance? If so, how? |
Hi @sebromero
The aspect I'm mostly concerned about in terms of performance is that each time the |
Hello, That's an interesting concept but I see no updates for a long time. Is the PR ready to be merged? If not, what is still missing? |
@manchoz @giulcioffi can we merge it? |
@facchinm LGTM. Tested working. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@Nasrino17 this is not an appropriate place to request assistance. If you want help, make a topic on Arduino Forum: I'm sure we'll be able to help you solve the problem over there. |
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.
Example
EnhancedAdvertising.ino
shows how to build generic advertising and scan response packets.Example
RawDataAdvertising.ino
shows how to configure an advertising packet given an already encoded raw advertising packet