-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCommon.h
61 lines (45 loc) · 1.39 KB
/
Common.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
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Created on: 30.03.2017
* Author: GSinne
*/
/*
* Common.h
*
* Created on: 21.03.2017
* Author: gsi
*/
#ifndef COMMON_H_
#define COMMON_H_
const char version[] PROGMEM = __DATE__ " " __TIME__;
char magicEEKey[] ={"1Q3bJ"}; // no magic: just the sign, that we have initialised the EE. Its very unlikely that the EE is delivered with this char seq.
struct Config {
char magicKey [sizeof (magicEEKey)];
char localIP [ 16 ] ;
int readingIntervallTemp = 60; // in secs, not #ifdef 'ed to keep config common
char MqttId [ 20 ];
char mqttServer [ 20 ];
int resetTimeMaxMinHr ; // hh:mm:ss. easier to display
int resetTimeMaxMinMin ;
char hostname [ 30 ] ;
}
config;
enum TEMP_SENS_OFS { // ofsets into ts below
OFS_DHT =0,
OFS_WIRE =1,
OFS_SI702=2,
OFS_LAST =3 // dummy to fill loops and dim fields
} TEMP_SENS_OFS;
typedef struct TempStatusType {
char MqttPubTopic [ sizeof (config.MqttId) + 10 ] ; // the topic for MQTT publishing. Also serves as presence indicator of sensor
float temp;
bool tempValid;
float tempMax, tempMin;
char displayTemp [20];
int hum; // hum with decimals makes no sense
bool humValid;
int humMax, humMin;
char displayHum [20]; // what to show
char errMsg [20];
int errCode; // 0 =ok
}TempStatus;
#endif /* COMMON_H_ */