--- a/thermferm/thermferm.h Tue Jun 24 22:38:46 2014 +0200 +++ b/thermferm/thermferm.h Wed Jun 25 16:16:47 2014 +0200 @@ -61,38 +61,43 @@ * Each unit can have: * a DS18B20 sensor to measure the air temperature inside the unit. * a DS18B20 sensor to measure the beer temperature. - * a DS2408 for 8 bits I/O to read status, turn heater/cooler on/off etc. + * a DS2413 to turn the cooler and heater on or off. + * a DS2413 to switch the fan and sense the door. */ typedef struct _units_list { struct _units_list *next; - char *uid; /* uid code */ + char *uuid; /* uid code */ char *name; /* friendly name */ float volume; /* Volume of this unit */ char *air_address; /* DS18B20 address */ float air_temp; /* Air temperature */ char *beer_address; /* DS18B20 address */ float beer_temp; /* Beer temperature */ - char *io_address; /* DS2408 address */ - unsigned char io_read; /* I/O ports read state */ + char *io1_address; /* DS2413 address */ + char *io2_address; /* DS2413 address */ int heater_available; /* Heater available */ int heater_state; /* Heater status */ int cooler_available; /* Cooler available */ int cooler_state; /* Cooler status */ int fan_available; /* Fan available */ int fan_state; /* Fan status */ - int light_available; /* Door sensor and int. light */ - int light_state; /* Door and light status */ + int door_state; /* Door and light status */ int mode; /* Unit mode */ + float beer_set; /* Beer temperature setting */ + float fridge_set; /* Fridge temperature setting */ + float temp_set_min; /* Minimum temperature */ + float temp_set_max; /* Maximum temperature */ + float idle_rangeL; /* Idle temperature low */ + float idle_rangeH; /* Idle range high */ char *profile; /* Active profile */ time_t prof_started; /* Profile start time */ } units_list; -#define UNITMODE_NA 0 /* Unit is missing */ -#define UNITMODE_OFF 1 /* Unit turned off */ -#define UNITMODE_NONE 2 /* Unit on but does nothing */ -#define UNITMODE_FRIDGE 3 /* Unit acts as a fridge */ -#define UNITMODE_BEER 4 /* Unit acts as beer cooler */ -#define UNITMODE_PROFILE 5 /* Unit runs in profile mode */ +#define UNITMODE_OFF 0 /* Unit turned off */ +#define UNITMODE_NONE 1 /* Unit on but does nothing */ +#define UNITMODE_FRIDGE 2 /* Unit acts as a fridge */ +#define UNITMODE_BEER 3 /* Unit acts as beer cooler */ +#define UNITMODE_PROFILE 4 /* Unit runs in profile mode */ #define UNITIO_HEATER 0x01 /* Heater bit */ #define UNITIO_COOLER 0x02 /* Cooler bit */