|
ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
|
Go to the source code of this file.
Functions | |
| IrrigationCommand_State | GetSolenoidState () |
| Get the current solenoid state. | |
| void | SetSolenoidState (IrrigationCommand_State newState) |
| Set the solenoid state. | |
| float | GetCurrentMoisture () |
| void | SetCurrentMoisture (float moisture) |
| void | UpdateTimedOperation () |
| void | HandleOpen () |
| Handles POST requests to /on. | |
| void | HandleClose () |
| Handles POST requests to /off. | |
| void | HandleTimed () |
| Handles POST requests to /timed. | |
| void | HandleAutoIrrigationSetup () |
| Handles auto irrigation configuration. | |
| void | HandleAutoToggle () |
| Handles auto irrigation toggle. | |
| void | HandleStatus () |
| Handles requests to /state. | |
| void | HandleState () |
| Handles requests to /state. | |
| void | HandleMoisture () |
| void | HandleClient () |
| Handle requests from the webserver. | |
| void | SetupServer () |
| Setup endpoints for the webserver. | |
Variables | |
| IrrigationCommand_State | currentSolenoidState = IrrigationCommand_State_CLOSE |
| unsigned long | timedStartTime = 0 |
| unsigned long | timedDuration = 0 |
| bool | timedOperation = false |
| float | moisture_min_threshold |
| float | moisture_max_threshold |
| unsigned long | check_interval |
| float | current_moisture = -1.0 |
| bool | auto_irrigation_enabled |
| unsigned long | last_moisture_check = 0 |
| const unsigned long | MOISTURE_CHECK_INTERVAL = 300000 |
| float GetCurrentMoisture | ( | ) |
Definition at line 39 of file webserver.cpp.
References GetCurrentMoistureFromCache().
Referenced by HandleStatus().
| IrrigationCommand_State GetSolenoidState | ( | ) |
Get the current solenoid state.
Definition at line 30 of file webserver.cpp.
References currentSolenoidState.
Referenced by CheckIrrigationConditions(), HandleState(), and HandleStatus().
| void HandleAutoIrrigationSetup | ( | ) |
Handles auto irrigation configuration.
Definition at line 163 of file webserver.cpp.
References EnableAutoIrrigation(), GetCheckInterval(), and SetCheckInterval().
Referenced by SetupServer().
| void HandleAutoToggle | ( | ) |
Handles auto irrigation toggle.
Definition at line 184 of file webserver.cpp.
References DisableAutoIrrigation(), EnableAutoIrrigation(), GetMaxThreshold(), GetMinThreshold(), and SetSolenoidState().
Referenced by SetupServer().
| void HandleClient | ( | ) |
Handle requests from the webserver.
Definition at line 103 of file webserver.cpp.
References UpdateTimedOperation().
Referenced by loop().
| void HandleClose | ( | ) |
Handles POST requests to /off.
Forces the valve into the closd state.
Definition at line 127 of file webserver.cpp.
References SetSolenoidState(), and timedOperation.
Referenced by SetupServer().
| void HandleMoisture | ( | ) |
Definition at line 233 of file webserver.cpp.
References CheckIrrigationConditions(), IsAutoIrrigationEnabled(), and SetCurrentMoisture().
Referenced by SetupServer().
| void HandleOpen | ( | ) |
Handles POST requests to /on.
Forces the valve into the open state.
Definition at line 120 of file webserver.cpp.
References SetSolenoidState(), and timedOperation.
Referenced by HandleTimed(), and SetupServer().
| void HandleState | ( | ) |
Handles requests to /state.
Gets the current state of the valve.
Definition at line 225 of file webserver.cpp.
References GetSolenoidState().
Referenced by SetupServer().
| void HandleStatus | ( | ) |
Handles requests to /state.
Gets the current status of the auto irrigation.
Definition at line 203 of file webserver.cpp.
References GetCheckInterval(), GetCurrentMoisture(), GetMaxThreshold(), GetMinThreshold(), GetSolenoidState(), and IsAutoIrrigationEnabled().
Referenced by SetupServer().
| void HandleTimed | ( | ) |
Handles POST requests to /timed.
Opens the valve for a specified time. If the valve is already open, it will closed afer the specified amount of time.
Definition at line 134 of file webserver.cpp.
References HandleOpen(), timedDuration, timedOperation, and timedStartTime.
Referenced by SetupServer().
| void SetCurrentMoisture | ( | float | moisture | ) |
Definition at line 41 of file webserver.cpp.
References current_moisture.
Referenced by HandleMoisture().
| void SetSolenoidState | ( | IrrigationCommand_State | newState | ) |
Set the solenoid state.
Definition at line 33 of file webserver.cpp.
References currentSolenoidState.
Referenced by CheckIrrigationConditions(), HandleAutoToggle(), HandleClose(), HandleOpen(), and UpdateTimedOperation().
| void SetupServer | ( | ) |
Setup endpoints for the webserver.
Definition at line 108 of file webserver.cpp.
References HandleAutoIrrigationSetup(), HandleAutoToggle(), HandleClose(), HandleMoisture(), HandleOpen(), HandleState(), HandleStatus(), and HandleTimed().
Referenced by setup().
| void UpdateTimedOperation | ( | ) |
Definition at line 47 of file webserver.cpp.
References SetSolenoidState(), timedDuration, timedOperation, and timedStartTime.
Referenced by HandleClient().
|
extern |
Definition at line 16 of file irrigation.cpp.
Referenced by ModuleIrrigation::CheckAutoIrrigation(), CheckIrrigationConditions(), DisableAutoIrrigation(), EnableAutoIrrigation(), and IsAutoIrrigationEnabled().
|
extern |
Referenced by ModuleIrrigation::CheckAutoIrrigation(), GetCheckInterval(), and SetCheckInterval().
| float current_moisture = -1.0 |
Definition at line 23 of file webserver.cpp.
Referenced by SetCurrentMoisture().
| IrrigationCommand_State currentSolenoidState = IrrigationCommand_State_CLOSE |
Definition at line 10 of file webserver.cpp.
Referenced by GetSolenoidState(), and SetSolenoidState().
| unsigned long last_moisture_check = 0 |
Definition at line 26 of file webserver.cpp.
| const unsigned long MOISTURE_CHECK_INTERVAL = 300000 |
Definition at line 27 of file webserver.cpp.
|
extern |
Referenced by CheckIrrigationConditions(), EnableAutoIrrigation(), and GetMaxThreshold().
|
extern |
Referenced by CheckIrrigationConditions(), EnableAutoIrrigation(), and GetMinThreshold().
| unsigned long timedDuration = 0 |
Definition at line 14 of file webserver.cpp.
Referenced by HandleTimed(), and UpdateTimedOperation().
| bool timedOperation = false |
Definition at line 15 of file webserver.cpp.
Referenced by HandleClose(), HandleOpen(), HandleTimed(), and UpdateTimedOperation().
| unsigned long timedStartTime = 0 |
Definition at line 13 of file webserver.cpp.
Referenced by HandleTimed(), and UpdateTimedOperation().