mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-27 15:37:16 +02:00
95 lines
2.6 KiB
C
95 lines
2.6 KiB
C
![]() |
#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,
|
||
|
|
||
|
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 */
|
||
|
FW_MDOE_O_1PS /** PMS5003T, S8 */
|
||
|
};
|
||
|
const char *AgFirmwareModeName(AgFirmwareMode mode);
|
||
|
|
||
|
#endif /** _APP_DEF_H_ */
|