Merge pull request #9814 from Staars/development

MI_ESP32: more secure check, if modem sleep is enabled
This commit is contained in:
Theo Arends 2020-11-11 21:31:39 +01:00 committed by GitHub
commit f041ac80f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -764,8 +764,10 @@ void MI32PreInit(void) {
void MI32Init(void) {
if (MI32.mode.init) return;
if (Wifi.status == 0) return;
if(WiFi.getSleep() == false){
AddLog_P(LOG_LEVEL_DEBUG,PSTR("MI32: WiFi modem not in sleep mode, BLE cannot start yet"));
return;
}
if (!MI32.mode.init) {
NimBLEDevice::init("");
AddLog_P(LOG_LEVEL_INFO,PSTR("MI32: init BLE device"));