48 lines
830 B
C++
48 lines
830 B
C++
#pragma once
|
|
#include "secrets.h"
|
|
#include "defines.h"
|
|
#include "process.h"
|
|
#include "config.h"
|
|
#include "power.h"
|
|
|
|
#include "ArduinoOTA.h"
|
|
#include "JC_Button.h"
|
|
#include "LITTLEFS.h"
|
|
|
|
#define WIFICONNECTINTERVAL 1000
|
|
|
|
typedef enum{
|
|
otaInit,
|
|
otaScan,
|
|
otaConnect,
|
|
otaSetup,
|
|
otaInitDone,
|
|
otaStart,
|
|
otaBusy,
|
|
otaDone,
|
|
otaError
|
|
}OTASTATES;
|
|
class OtaProcess_class : public processClass
|
|
{
|
|
uint32_t m_lastconnectTime;
|
|
String m_psk = "";
|
|
String m_ssid = "";
|
|
|
|
void active(void);
|
|
bool initialize(void);
|
|
void idle(void);
|
|
void halted(void);
|
|
void disabled(void);
|
|
void stopped(void);
|
|
|
|
public:
|
|
OtaProcess_class(uint32_t timeout):processClass(timeout){}
|
|
|
|
OTASTATES m_otaState = otaInit;
|
|
|
|
};
|
|
|
|
void initOta(void);
|
|
void handleOta(void);
|
|
OTASTATES getOtaState(void);
|
|
void otaEnable(void); |