Allow BLE when ethernet only connected

Allow BLE when ethernet only connected (#10753)
This commit is contained in:
Theo Arends 2021-02-05 14:09:46 +01:00
parent 6836455bbe
commit 5d58eb39cf
2 changed files with 14 additions and 10 deletions

View File

@ -1478,13 +1478,15 @@ static void BLEInit(void) {
if (BLEInitState) { return; }
if (TasmotaGlobal.global_state.wifi_down) { return; }
if (TasmotaGlobal.global_state.wifi_down && TasmotaGlobal.global_state.eth_down) { return; }
if (!TasmotaGlobal.global_state.wifi_down) {
TasmotaGlobal.wifi_stay_asleep = true;
if (WiFi.getSleep() == false) {
AddLog(LOG_LEVEL_DEBUG,PSTR("%s: Put WiFi modem in sleep mode"),"BLE");
AddLog(LOG_LEVEL_DEBUG,PSTR("%s: Put WiFi modem in sleep mode"), "BLE");
WiFi.setSleep(true); // Sleep
}
}
// this is only for testing, does nothin if examples are undefed
installExamples();

View File

@ -789,13 +789,15 @@ void MI32PreInit(void) {
void MI32Init(void) {
if (MI32.mode.init) { return; }
if (TasmotaGlobal.global_state.wifi_down) { return; }
if (TasmotaGlobal.global_state.wifi_down && TasmotaGlobal.global_state.eth_down) { return; }
if (!TasmotaGlobal.global_state.wifi_down) {
TasmotaGlobal.wifi_stay_asleep = true;
if (WiFi.getSleep() == false) {
AddLog(LOG_LEVEL_DEBUG,PSTR("M32: Put WiFi modem in sleep mode"));
WiFi.setSleep(true); // Sleep
}
}
if (!MI32.mode.init) {
NimBLEDevice::init("");