-
Notifications
You must be signed in to change notification settings - Fork 1
/
StateManager.h
49 lines (39 loc) · 1.04 KB
/
StateManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef _STATEMANAGER_h
#define _STATEMANAGER_h
#include "Arduino.h"
#include "HashMap.h"
#define TIMES_SIZE 200
class StateManager {
private:
unsigned long m_times[TIMES_SIZE];
String m_version;
String m_identity;
String m_hostname;
unsigned long m_loopCount = 0;
unsigned long m_loopTotalTime = 0;
unsigned long m_loopMeasureStart = 0;
unsigned long m_loopStartTime = 0;
uint32_t m_loopMinTime = 64000;
uint32_t m_loopMaxTime = 0;
float m_wifiConnnectTime = 0.0;
uint32_t m_loopDurationMin, m_loopDurationAvg, m_loopDurationMax;
HashMap<String, String, 20> m_values;
bool m_roolOverIsPossible = false;
unsigned int m_uptimeDays = 0;
public:
StateManager();
void SetLoopStart();
void SetLoopEnd();
void SetHostname(String hostname);
String GetHostname();
void Begin(String version, String identity);
String GetHTML();
String GetXML();
String GetVersion();
String GetUpTime();
void Handle();
void SetWiFiConnectTime(float connectTime);
float GetWiFiConnectTime();
void Update();
};
#endif