Added logging of the room temperature.

Wed, 01 Apr 2015 23:13:08 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 01 Apr 2015 23:13:08 +0200
changeset 355
8f946f9d125a
parent 354
5ff387f4d6b7
child 356
44bcfe087f9e

Added logging of the room temperature.

thermferm/logger.c file | annotate | diff | comparison | revisions
thermferm/thermferm.c file | annotate | diff | comparison | revisions
--- a/thermferm/logger.c	Wed Apr 01 22:54:27 2015 +0200
+++ b/thermferm/logger.c	Wed Apr 01 23:13:08 2015 +0200
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * Copyright (C) 2014
+ * Copyright (C) 2014-2015
  *   
  * Michiel Broek <mbroek at mbse dot eu>
  *
@@ -30,7 +30,7 @@
 {
     char	buf[128], *filename;
 
-    snprintf(buf, 127, "Mode,Air,Beer,Target,S_Heater,S_Cooler,S_Fan,S_Door,U_Heater,U_Cooler,U_Fan");
+    snprintf(buf, 127, "Mode,Air,Beer,Target,S_Heater,S_Cooler,S_Fan,S_Door,U_Heater,U_Cooler,U_Fan,Room");
     filename = xstrcpy(unit);
     filename = xstrcat(filename, (char *)".log");
     logger(filename, buf);
--- a/thermferm/thermferm.c	Wed Apr 01 22:54:27 2015 +0200
+++ b/thermferm/thermferm.c	Wed Apr 01 23:13:08 2015 +0200
@@ -834,7 +834,7 @@
 int server(void)
 {
     char                buf[1024], *filename, target[40], heater[40], cooler[40], fan[40], door[40];
-    char		use_heater[40], use_cooler[40], use_fan[40];
+    char		use_heater[40], use_cooler[40], use_fan[40], room_temp[40];
     time_t		now, last = (time_t)0;
     units_list		*unit;
     profiles_list	*profile;
@@ -1570,7 +1570,7 @@
 			snprintf(use_heater, 39, "NA");
 			snprintf(use_cooler, 39, "NA");
 			snprintf(use_fan, 39, "NA");
-
+			snprintf(room_temp, 39, "NA");
 
 			if (unit->mode == UNITMODE_BEER)
 			    snprintf(target, 39, "%.1f", unit->beer_set);
@@ -1594,10 +1594,13 @@
 			if (unit->door_address) {
 			    snprintf(door, 39, "%d", unit->door_state);
 			}
+			if (Config.temp_address) {
+			    snprintf(room_temp, 39, "%.3f", Config.temp_value / 1000.0);
+			}
 
-			snprintf(buf, 1023, "%s,%.3f,%.3f,%s,%s,%s,%s,%s,%s,%s,%s", 
+			snprintf(buf, 1023, "%s,%.3f,%.3f,%s,%s,%s,%s,%s,%s,%s,%s,%s", 
 					UNITMODE[unit->mode], unit->air_temperature / 1000.0, 
-					unit->beer_temperature / 1000.0, target, heater, cooler, fan, door, use_heater, use_cooler, use_fan);
+					unit->beer_temperature / 1000.0, target, heater, cooler, fan, door, use_heater, use_cooler, use_fan, room_temp);
 			filename = xstrcpy(unit->name);
 			filename = xstrcat(filename, (char *)".log");
 			logger(filename, buf);

mercurial