Skip to content

Central "is still connected" after calling BLE.end() and BLE.begin() #167

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

Open
mcxiv opened this issue Mar 24, 2021 · 1 comment
Open

Central "is still connected" after calling BLE.end() and BLE.begin() #167

mcxiv opened this issue Mar 24, 2021 · 1 comment
Labels
type: imperfection Perceived defect in any part of project

Comments

@mcxiv
Copy link

mcxiv commented Mar 24, 2021

Hi,

I'm working with a MKR1010 and I realised something was wrong with the detection of a connected central.

In my code, I'm using ArduinoLowPower and ArduinoBLE library.

Let's say my smartphone is connected to my MKR1010.

After X seconds, I'm putting the duino in deepsleep where I shut down everything, including the BLE, with BLE.end().
The duino wakes up if a button (attach to pin 5) is pressed and I turn on everything back again.

And here comes the problem :
In my loop() there is a condition if (central.connected()) which will be true even though nothing is connected. (Assuming BLE.end() disconnect everything.)
The only solution I found is to use central.disconnect() before going into sleep mode.

It looks familiar with #33.

@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Mar 24, 2021
@polldo
Copy link
Contributor

polldo commented May 24, 2021

Hi @mcxiv ,
this is related to #127
An end function should be added to the ATT class, in order to clean up the library's state. However your workaround seems nice to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants