/// © MiroZ 2024 #include "App.h" #include #include "Settings.h" #include "errors.h" #include "OTA.h" #include "ProvisionSoftAP.h" #define LED_PIN 26 App::App() { } void App::init() { m_led = new Led(LED_PIN); m_wifi = new Wifi(); bool needs_provision = true; if(SETTINGS.wifi.num > 0) { // try connecting m_led->setColor(0, 255, 0); uint32_t status = m_wifi->start(); if(status == WH_OK) { m_led->setColor(0, 0, 0); needs_provision = false; } } if(needs_provision) { m_led->setPulse(0, 0, 255); ProvisionSoftAP provision(80); provision.start(); } ota_update::OTA ota(*this); ota.start(); m_led->setColor(0, 0, 0); } void App::start() { while(true) { vTaskDelay(pdMS_TO_TICKS(10020)); } } void App::readSensors() { } void App::reportSensors() { }