[temporary commit]

This commit is contained in:
Phat Nguyen
2024-04-03 07:04:55 +07:00
parent f52eab87d2
commit 8e032927c6
11 changed files with 1029 additions and 8 deletions

60
src/AgStateMachine.h Normal file
View File

@ -0,0 +1,60 @@
#ifndef _AG_STATE_MACHINE_H_
#define _AG_STATE_MACHINE_H_
/**
* @brief Application state machine state
*
*/
enum AgStateMachine {
/** In WiFi Manger Mode */
AgStateMachineWiFiManagerMode,
/** WiFi Manager has connected to mobile phone */
AgStateMachineWiFiManagerPortalActive,
/** After SSID and PW entered and OK clicked, connection to WiFI network is
attempted*/
AgStateMachineWiFiManagerStaConnecting,
/** Connecting to WiFi worked */
AgStateMachineWiFiManagerStaConnected,
/** Once connected to WiFi an attempt to reach the server is performed */
AgStateMachineWiFiOkServerConnecting,
/** Server is reachable, all fine */
AgStateMachineWiFiOkServerConnected,
/** =================================== *
* Exceptions during WIFi Setup *
* =================================== **/
/** Cannot connect to WiFi (e.g. wrong password, WPA Enterprise etc.) */
AgStateMachineWiFiManagerConnectFailed,
/** Connected to WiFi but server not reachable, e.g. firewall
block/whitelisting needed etc. */
AgStateMachineWiFiOkServerConnectFailed,
/** Server reachable but sensor not configured correctly*/
AgStateMachineWiFiOkServerOkSensorConfigFailed,
/** =================================== *
* During Normal Operation *
* =================================== **/
/** Connection to WiFi network failed credentials incorrect encryption not
supported etc. */
AgStateMachineWiFiLost,
/** Connected to WiFi network but the server cannot be reached through the
internet, e.g. blocked by firewall */
AgStateMachineServerLost,
/** Server is reachable but there is some configuration issue to be fixed on
the server side */
AgStateMachineSensorConfigFailed,
AgStateMachineNormal,
};
#endif /** _AG_STATE_MACHINE_H_ */