add a controller deinit to earn some ble stability (#472)

discussed here
https://community.openmqttgateway.com/t/esp32-doesnt-stay-online/570
This commit is contained in:
Florian authored and GitHub committed 2019-10-22 19:22:57 +02:00
1 parent 4d0ed354f7
commit 6af57f1db5
1 file changed
+3 -1
+3 -1
View File
@@ -390,13 +390,15 @@ void MiScaleDiscovery(char * mac){
TIMERG0.wdt_wprotect=TIMG_WDT_WKEY_VALUE;
TIMERG0.wdt_feed=1;
TIMERG0.wdt_wprotect=0;
trc(F("Scan begin"));
BLEDevice::init("");
BLEScan* pBLEScan = BLEDevice::getScan(); //create new scan
MyAdvertisedDeviceCallbacks myCallbacks;
pBLEScan->setAdvertisedDeviceCallbacks(&myCallbacks);
pBLEScan->setActiveScan(true); //active scan uses more power, but get results faster
BLEScanResults foundDevices = pBLEScan->start(Scan_duration);
trc(F("Scan end, deinit controller"));
esp_bt_controller_deinit();
}
void coreTask( void * pvParameters ){