[SYS][BREAKING] Add gateway states, Offline mode and refactor sleep (#2020)

Gaterway states to improve LED management
Make the sleep function accessible outside BT
BREAKING remove sleep for ESP8266
BREAKING lowpowermode API changed to powermode and new mode definition

Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
FlorianandFlorian authored and GitHub committed 2024-08-23 16:55:04 -05:00
1 parent 068c2e457a
commit f9a5c6961a
16 files changed
+367 -443

No files matched your search

+3
View File
@@ -66,6 +66,7 @@ static void example_event_callback(esp_blufi_cb_event_t event, esp_blufi_cb_para
break;
case ESP_BLUFI_EVENT_BLE_CONNECT:
Log.trace(F("BLUFI BLE connect" CR));
gatewayState = GatewayState::ONBOARDING;
omg_blufi_ble_connected = true;
esp_blufi_adv_stop();
blufi_security_init();
@@ -75,11 +76,13 @@ static void example_event_callback(esp_blufi_cb_event_t event, esp_blufi_cb_para
omg_blufi_ble_connected = false;
blufi_security_deinit();
if (WiFi.isConnected()) {
gatewayState = GatewayState::NTWK_CONNECTED;
esp_blufi_deinit();
# ifndef ESPWifiManualSetup
wifiManager.stopConfigPortal();
# endif
} else {
gatewayState = GatewayState::WAITING_ONBOARDING;
esp_blufi_adv_start();
}
break;