50 #define FALSE 0 |
50 #define FALSE 0 |
51 |
51 |
52 #define MBSE_SS(x) (x)?(x):"(null)" |
52 #define MBSE_SS(x) (x)?(x):"(null)" |
53 |
53 |
54 /* rdconfig.c */ |
54 /* rdconfig.c */ |
55 typedef struct _key_list { |
55 //typedef struct _key_list { |
56 char *key; |
56 // char *key; |
57 int (*prc)(char **); |
57 // int (*prc)(char **); |
58 char **dest; |
58 // char **dest; |
59 } key_list; |
59 //} key_list; |
60 |
60 |
61 /* |
61 /* |
62 * Fermenter units. These units are connected via the 1-wire bus. |
62 * Fermenter units. These units are connected via the 1-wire bus. |
63 * Each unit can have: |
63 * Each unit can have: |
64 * a DS18B20 sensor to measure the air temperature inside the unit. |
64 * a DS18B20 sensor to measure the air temperature inside the unit. |
66 * a DS2413 to turn the cooler and heater on or off. |
66 * a DS2413 to turn the cooler and heater on or off. |
67 * a DS2413 to switch the fan and sense the door. |
67 * a DS2413 to switch the fan and sense the door. |
68 */ |
68 */ |
69 typedef struct _units_list { |
69 typedef struct _units_list { |
70 struct _units_list *next; |
70 struct _units_list *next; |
|
71 int version; /* Record version */ |
71 char *uuid; /* uid code */ |
72 char *uuid; /* uid code */ |
72 char *name; /* friendly name */ |
73 char *name; /* friendly name */ |
73 float volume; /* Volume of this unit */ |
74 float volume; /* Volume of this unit */ |
74 char *air_address; /* DS18B20 address */ |
75 char *air_address; /* DS18B20 address */ |
75 float air_temp; /* Air temperature */ |
76 float air_temp; /* Air temperature */ |
91 float temp_set_max; /* Maximum temperature */ |
92 float temp_set_max; /* Maximum temperature */ |
92 float idle_rangeL; /* Idle temperature low */ |
93 float idle_rangeL; /* Idle temperature low */ |
93 float idle_rangeH; /* Idle range high */ |
94 float idle_rangeH; /* Idle range high */ |
94 char *profile; /* Active profile */ |
95 char *profile; /* Active profile */ |
95 time_t prof_started; /* Profile start time */ |
96 time_t prof_started; /* Profile start time */ |
|
97 int prof_state; /* Profile OFF|PAUSE|RUN|DONE */ |
96 } units_list; |
98 } units_list; |
97 |
99 |
98 #define UNITMODE_OFF 0 /* Unit turned off */ |
100 #define UNITMODE_OFF 0 /* Unit turned off */ |
99 #define UNITMODE_NONE 1 /* Unit on but does nothing */ |
101 #define UNITMODE_NONE 1 /* Unit on but does nothing */ |
100 #define UNITMODE_FRIDGE 2 /* Unit acts as a fridge */ |
102 #define UNITMODE_FRIDGE 2 /* Unit acts as a fridge */ |
101 #define UNITMODE_BEER 3 /* Unit acts as beer cooler */ |
103 #define UNITMODE_BEER 3 /* Unit acts as beer cooler */ |
102 #define UNITMODE_PROFILE 4 /* Unit runs in profile mode */ |
104 #define UNITMODE_PROFILE 4 /* Unit runs in profile mode */ |
103 |
105 |
104 #define UNITIO_HEATER 0x01 /* Heater bit */ |
106 #define UNITIO1_HEATER 0x01 /* Heater bit */ |
105 #define UNITIO_COOLER 0x02 /* Cooler bit */ |
107 #define UNITIO1_COOLER 0x02 /* Cooler bit */ |
106 #define UNITIO_FAN 0x04 /* Fan bit */ |
108 #define UNITIO2_FAN 0x01 /* Fan bit */ |
107 #define UNITIO_LIGHT 0x08 /* Light bit */ |
109 #define UNITIO2_DOOR 0x02 /* Door status */ |
108 #define UNITIO_DOOR 0x10 /* Door status */ |
110 |
|
111 #define PROFILE_OFF 0 /* Profile not active */ |
|
112 #define PROFILE_PAUSE 1 /* Profile pause */ |
|
113 #define PROFILE_RUN 2 /* Profile is running */ |
|
114 #define PROFILE_DONE 3 /* Profile is finished */ |
|
115 |
109 |
116 |
110 typedef struct _w1_therm { |
117 typedef struct _w1_therm { |
111 struct _w1_therm *next; |
118 struct _w1_therm *next; |
112 char *master; /* Master for this device */ |
119 char *master; /* Master for this device */ |
113 int bus; /* Reserved for ds2482-800 */ |
120 int bus; /* Reserved for ds2482-800 */ |