reinit BLE each time we launch a scan to avoid BLE stop

#173
This commit is contained in:
1technophile committed 2018-03-01 07:49:18 +01:00
1 parent 597a18165f
commit 638817678d
1 file changed
+1 -1
+1 -1
View File
@@ -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);