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

Handle BLE disconnects #2

@Valeria

Description

@Valeria

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions