Files
arduino/src/App/AppDef.h

104 lines
2.8 KiB
C
Raw Normal View History

2024-04-03 21:26:04 +07:00
#ifndef _APP_DEF_H_
#define _APP_DEF_H_
/**
* @brief Application state machine state
*
*/
enum AgStateMachineState {
/** 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,
2024-04-07 16:39:01 +07:00
/** CO2 calibration */
AgStateMachineCo2Calibration,
/* LED bar testing */
AgStateMachineLedBarTest,
/** LED: Show working state.
* Display: Show dashboard */
2024-04-03 21:26:04 +07:00
AgStateMachineNormal,
};
/**
* @brief RGB LED bar mode for ONE_INDOOR board
*/
enum LedBarMode {
/** Don't use LED bar */
LedBarModeOff,
/** Use LED bar for show PM2.5 value level */
LedBarModePm,
/** Use LED bar for show CO2 value level */
LedBarModeCO2,
};
enum ConfigurationControl {
/** Allow set configuration from local over device HTTP server */
ConfigurationControlLocal,
/** Allow set configuration from Airgradient cloud */
ConfigurationControlCloud,
/** Allow set configuration from Local and Cloud */
ConfigurationControlBoth
};
enum AgFirmwareMode {
FW_MODE_I_9PSL, /** ONE_INDOOR */
FW_MODE_O_1PST, /** PMS5003T, S8 and SGP41 */
FW_MODE_O_1PPT, /** PMS5003T_1, PMS5003T_2, SGP41 */
FW_MODE_O_1PP, /** PMS5003T_1, PMS5003T_2 */
2024-04-13 20:50:11 +07:00
FW_MODE_O_1PS, /** PMS5003T, S8 */
FW_MODE_O_1P, /** PMS5003T */
2024-04-03 21:26:04 +07:00
};
const char *AgFirmwareModeName(AgFirmwareMode mode);
#endif /** _APP_DEF_H_ */