-
Notifications
You must be signed in to change notification settings - Fork 488
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
Change Advertisement Name "on the fly" does not work. #197
Comments
you could just stop the advertising at anytime (not just disconnect callback). Then change the name and yes, clearData() and re-create the adv/scan_resp packet. Since this is not often used by most user, and it is rather trivial, we don't feel the need to implement this. |
I don't want/need it as a seperate function or call, but currently I can't figure out how to do this. I changed the topic name to better reflect my problem. |
Oops, I thought it worked that way. I will give it a try, meanwhile can you enable debug level to 1 (or 2) to see if there is any error message |
I looked around a little, but I don't know how I enable the debug level. |
it is in in IDE menu "Debug Mode" |
Thanks. Here my functions:
edit: When I read out the name afterwards it shows the correct one, but it's not advertised as such.
|
hi @Splitframe , you didn't re-set the name right. Maybe we didn't make it clear. Advertising and ScanResponse is 2 separate packet.
In your above code, the service is fitted to the advertising packet, and the name is fit to Scan response. If you want to change the name, you only need to clear the scan response e.g
void changeAdvertisementName() {
Bluefruit.Advertising.stop();
Bluefruit.Advertising.clearData();
Bluefruit.ScanResponse.clearData(); // add this
Bluefruit.setName(cname);
setupAdv();
Bluefruit.Advertising.start();
} |
That works, thanks you. Sorry for the inconvenience. |
Glad that work for you |
Hi @hathach , I am trying to do the same procedure to change the name and getting the same. I am getting error when debug mode is enabled:
These are my device details:
|
My code snippets:
... and the flow of code:
|
Hi, I had the same issue and fixed it in this PR: #784 . @hathach would be lovely if you could check it out! |
FIX #197 : Replace varclr with arrclr for BLEAdvertising _data fields
Hi,
I want to change the Advertisement name "on the fly".
Currently I do this on the disconnect callback:
The device is not visible afterwards though.
The text was updated successfully, but these errors were encountered: