Disconnect after a timeout (#842)

So as to save the devices battery
This commit is contained in:
Florian authored and GitHub committed 2021-01-30 15:32:53 -06:00
1 parent 2c6526fcdb
commit 717bdb1f06
2 files changed
+3

No files matched your search

+2
View File
@@ -569,6 +569,8 @@ void BLEconnect() {
if (pRemoteCharacteristic->canNotify()) {
Log.trace(F("Registering notification" CR));
pRemoteCharacteristic->subscribe(true, notifyCB);
delay(BLE_CNCT_TIMEOUT);
pClient->disconnect();
} else {
Log.notice(F("Failed registering notification" CR));
pClient->disconnect();
+1
View File
@@ -56,6 +56,7 @@ extern void MQTTtoBT(char* topicOri, JsonObject& RFdata);
#define BLEdelimiterLength 16
#define CRLR "0d0a"
#define CRLR_Length 4
#define BLE_CNCT_TIMEOUT 3000
#define ServicedataMinLength 29