thermometers/rdconfig.c

changeset 144
3446371e0bdb
parent 51
a03b6dac5398
child 145
1396350141cf
--- a/thermometers/rdconfig.c	Tue Jul 29 20:11:23 2014 +0200
+++ b/thermometers/rdconfig.c	Tue Jul 29 20:42:02 2014 +0200
@@ -23,7 +23,7 @@
 #include "thermometers.h"
 
 
-bool		debug = FALSE;
+int		debug = FALSE;
 static char	*mypath;
 static char	*k, *v;
 static int	linecnt = 0;
@@ -31,10 +31,10 @@
 
 
 
+static int getw1(char **);
+#ifdef HAVE_WIRINGPI_H
 static int getstr(char **);
 static int getint(char **);
-static int getw1(char **);
-#ifdef HAVE_WIRINGPI_H
 static int getrcs(char **);
 #endif
 //static int getbyt(char **);
@@ -47,8 +47,6 @@
  * System configuration table
  */
 key_list keytab[] = {
-    {(char *)"mosq_host",	getstr,		&Config.mosq_host},
-    {(char *)"mosq_port",	getint,		(char **)&Config.mosq_port},
     {(char *)"w1therm",		getw1,		(char **)&Config.w1therms},
 #ifdef HAVE_WIRINGPI_H
     {(char *)"lcd_cols",	getint,		(char **)&Config.lcd_cols},
@@ -73,11 +71,6 @@
 	free(Config.name);
     Config.name = NULL;
 
-    if (Config.mosq_host)
-	free(Config.mosq_host);
-    Config.mosq_host= (char *)"localhost";
-    Config.mosq_port = 1883;
-
     for (tmp1 = Config.w1therms; tmp1; tmp1 = old1) {
 	old1 = tmp1->next;
 	if (tmp1->master)
@@ -199,6 +192,7 @@
 
 
 
+#ifdef HAVE_WIRINGPI_H
 static int getstr(char **dest)
 {
     if (debug)
@@ -221,6 +215,7 @@
 	*((int*)dest)=atoi(v);
     return 0;
 }
+#endif
 
 
 

mercurial