From d4d42c9f6d4d926188e75fbfb0f944ce4a5add40 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Thu, 15 Oct 2020 17:21:44 +0200 Subject: [PATCH] fixed keep alive --- vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp b/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp index 979dbee..64c6bb5 100644 --- a/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp +++ b/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp @@ -15,8 +15,10 @@ OmobiLedDisplay::OmobiLedDisplay(String deviceName, Adafruit_NeoMatrix *ledDispl } void OmobiLedDisplay::loop() { - if(millis() - lastKeepAlive > this->maximumKeepAliveDelay) + if(millis() - lastKeepAlive > this->maximumKeepAliveDelay) { + this->lastKeepAlive = millis(); this->bleServer->disconnectCurrentDevice(); + } } void OmobiLedDisplay::onDeviceConnectedChanged(bool deviceConnected)