Skip to content

Setting custom Advertising Data #28

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

Closed
akikarhu opened this issue Sep 15, 2019 · 2 comments
Closed

Setting custom Advertising Data #28

akikarhu opened this issue Sep 15, 2019 · 2 comments
Labels
status: waiting for information More information must be provided before work can proceed

Comments

@akikarhu
Copy link

Creating temperature sensor on Arduino Namo 33 IoT, and to save battery, non-connected broadcast would do fine. Otherwise great library, but I cannot figure out how to set custom Advertising Data (those 31 octets). Maybe using the setLocalName(name)? Am I missing something or has this a feature not yet been implemented? If not, could you please implement something like BLE.setAdvertisingData(byte[])?

@sandeepmistry
Copy link
Contributor

Hi @akikarhu,

If not, could you please implement something like BLE.setAdvertisingData(byte[])?

I'm not very keen on exposing this, as people will have to manually EIR encode the array.

However here are some other suggestions:

  1. Put the data in the manufacturer data, using BLE.setManufacturerData(...) and call stop/start advertising when changing

  2. Use service data, you'll need the changes from PR Fix for advertised service data not working #29 - I've included a test sketch in the comment of the pull request.

Please let us know your thoughts on this.

@sandeepmistry sandeepmistry added the status: waiting for information More information must be provided before work can proceed label Sep 18, 2019
@polldo
Copy link
Contributor

polldo commented Nov 2, 2020

@akikarhu
It is now possible to configure both advertising and scan response data given an already encoded raw data packet.
Implemented here #117
Examples here #134

@polldo polldo closed this as completed Nov 2, 2020
cparata added a commit to cparata/ArduinoBLE that referenced this issue Feb 11, 2021
mbox_write returns the nb of bytes actually written
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for information More information must be provided before work can proceed
Projects
None yet
Development

No branches or pull requests

3 participants