Skip to content
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

Fix BLEAdvertising::stop() #5116

Closed
marcidelux opened this issue Apr 27, 2021 · 6 comments
Closed

Fix BLEAdvertising::stop() #5116

marcidelux opened this issue Apr 27, 2021 · 6 comments

Comments

@marcidelux
Copy link

Hardware:

Board: ESP32 Dev Module
Core Installation version: 1.0.4
IDE name: Arduino IDE with Platform.io
Flash Frequency: 40Mhz
Upload Speed: 115200
Computer OS: Windows 10

Description:

Even after this fix: #3034
It still dosnt stop. I found out a misstype caused the issue.
At BLEAdvertising.cpp line 248 :
esp_err_t errRc = ::esp_ble_gap_stop_advertising();
Remove the two semicolons, and it will work afterwards.

@lbernstone
Copy link
Contributor

lbernstone commented Apr 27, 2021

That is not a mistype. The colons there indicate that there are two options for that function name, one in the local namespace, and one at the top level namespace. :: indicates to use the function at the top level namespace.
Note, this is not a critique of your solution, just an explanation of the code.

@marcidelux
Copy link
Author

Sorry even, my solution wasnt good, I reacted faster than I tested it properly.
So sadly the stop() function still dosn't work. I'm gona try some other things too.

@chegewara
Copy link
Contributor

Its weird, because i never saw the problem to stop advertising. You can always call this in you code, without using library:

esp_err_t errRc = esp_ble_gap_stop_advertising();

@marcidelux
Copy link
Author

Thanks for the help, it wasnt the situation in my case.
Now I truly can say that I have found the line what caused Advertising every time after I called stop Advertising, or I disconnected from the device.
At BLEServer.cpp --> Line 209: startAdvertising(); //- do this with some delay from the loop()
Afte I commented it out it works as I wanted to.
What is your opinion about this?

@chegewara
Copy link
Contributor

chegewara commented Apr 28, 2021

I believe you have some old library:
https://github.com/espressif/arduino-esp32/blob/master/libraries/BLE/src/BLEServer.cpp#L209

Oh yes, i see it in v1.0.4, but fixed at some point.

@marcidelux
Copy link
Author

Yep, it was the issue.
I used framework-arduinoespressif32 3.10004.200129 (1.0.4)
After update to 1.0.6 it works fine.
Thanks for your fast help, thumbs up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants