From 638817678dd700f99d092929ea17f0c439c0ec5b Mon Sep 17 00:00:00 2001 From: 1technophile Date: Thu, 1 Mar 2018 07:49:18 +0100 Subject: [PATCH] reinit BLE each time we launch a scan to avoid BLE stop #173 --- ZgatewayBT.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZgatewayBT.ino b/ZgatewayBT.ino index 30f77ea..4402e7b 100644 --- a/ZgatewayBT.ino +++ b/ZgatewayBT.ino @@ -118,7 +118,6 @@ Thanks to wolass https://github.com/wolass for suggesting me HM 10 and dinosd ht NULL, /* Task handle. */ taskCore); /* Core where the task should run */ trc(F("ZgatewayBT ESP32 setup done ")); - BLEDevice::init(""); } void coreTask( void * pvParameters ){ @@ -129,6 +128,7 @@ Thanks to wolass https://github.com/wolass for suggesting me HM 10 and dinosd ht while(true){ trc(taskMessage); delay(TimeBtw_Read); + BLEDevice::init(""); BLEScan* pBLEScan = BLEDevice::getScan(); //create new scan MyAdvertisedDeviceCallbacks myCallbacks; pBLEScan->setAdvertisedDeviceCallbacks(&myCallbacks);