Skip to content
This repository was archived by the owner on Dec 5, 2021. It is now read-only.

Handle BLE disconnects #2

Closed
Valeria opened this issue Aug 13, 2021 · 2 comments
Closed

Handle BLE disconnects #2

Valeria opened this issue Aug 13, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Valeria
Copy link

Valeria commented Aug 13, 2021

Hello, thanks for this wonderful project.

I'm having an issue: If I disconnect BLE connection manually, I can't reconnect to the device until I manually reset it.

Is there a way to handle disconnects so that after one the device starts advertising again? Or even better, a way to check in loop() if there's a disconnect and start advertising?

I fixed it by changing:

void BlynkTransportEsp32_BLE::onDisconnect(BLEServer* pServer) {
  BLYNK_LOG1(BLYNK_F("BLEDisCon"));
  Blynk_BLE.disconnect();
  disconnect();
      // Start advertising
      pServer->getAdvertising()->start();
}

But there's most definitely a better way.
Thank you.

@khoih-prog khoih-prog added the enhancement New feature or request label Aug 13, 2021
khoih-prog added a commit that referenced this issue Aug 13, 2021
### Releases v1.2.1

1. Add auto-reconnect feature for BLE. Check [Handle BLE disconnects #2](#2)
khoih-prog added a commit that referenced this issue Aug 13, 2021
### Releases v1.2.1

1. Add auto-reconnect feature for BLE. Check [Handle BLE disconnects #2](#2)
@khoih-prog
Copy link
Owner

The new release has just been published. Your contribution is noted in Contributions and Thanks


Releases v1.2.1

  1. Add auto-reconnect feature for BLE. Check Handle BLE disconnects #2

khoih-prog added a commit to khoih-prog/BlynkESP32_BT_WF that referenced this issue Aug 13, 2021
### Releases v1.2.1

1. Add auto-reconnect feature for BLE. Check [Handle BLE disconnects #2](khoih-prog/Blynk_Async_ESP32_BT_WF#2)
khoih-prog added a commit to khoih-prog/BlynkESP32_BT_WF that referenced this issue Aug 13, 2021
### Releases v1.2.1

1. Add auto-reconnect feature for BLE. Check [Handle BLE disconnects #2](khoih-prog/Blynk_Async_ESP32_BT_WF#2)
@khoih-prog
Copy link
Owner

The new release of the twin library BlynkESP32_BT_WF has just been published. Your contribution is also noted in Contributions and Thanks


Releases v1.2.1

  1. Add auto-reconnect feature for BLE. Check Handle BLE disconnects #2

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants