56 lines
658 B
C++
56 lines
658 B
C++
/// © MiroZ 2024
|
|
|
|
#include "App.h"
|
|
|
|
#include <Arduino.h>
|
|
#include "Settings.h"
|
|
#include "errors.h"
|
|
|
|
#include "ProvisionSoftAP.h"
|
|
|
|
#define LED_PIN 26
|
|
|
|
App::App()
|
|
{
|
|
|
|
}
|
|
|
|
void App::init()
|
|
{
|
|
m_led = new Led(LED_PIN);
|
|
m_wifi = new Wifi();
|
|
|
|
if(SETTINGS.wifi.num > 0)
|
|
{
|
|
// try connecting
|
|
m_led->setPulse(0, 255, 0);
|
|
uint32_t status = m_wifi->connect();
|
|
if(status == WH_OK)
|
|
{
|
|
m_led->setColor(0, 0, 0);
|
|
return;
|
|
}
|
|
}
|
|
|
|
m_led->setPulse(0, 0, 255);
|
|
ProvisionSoftAP p(80);
|
|
p.init("wellhub", "12345678");
|
|
}
|
|
|
|
void App::start()
|
|
{
|
|
while(true)
|
|
{
|
|
vTaskDelay(pdMS_TO_TICKS(10000));
|
|
}
|
|
}
|
|
|
|
void App::readSensors()
|
|
{
|
|
|
|
}
|
|
|
|
void App::reportSensors()
|
|
{
|
|
|
|
} |