thermferm/rdconfig.c

changeset 418
0bfe08c7ba6e
parent 397
00ca08f5a6f8
child 492
750f2468dec5
equal deleted inserted replaced
417:9943f49fdb98 418:0bfe08c7ba6e
128 free(simulator); 128 free(simulator);
129 } 129 }
130 Config.simulators = NULL; 130 Config.simulators = NULL;
131 #endif 131 #endif
132 132
133 #ifdef HAVE_WIRINGPI_H
134 Config.lcd_cols = 16; 133 Config.lcd_cols = 16;
135 Config.lcd_rows = 2; 134 Config.lcd_rows = 2;
136 #endif
137 } 135 }
138 136
139 137
140 138
141 int do_wrconfig(void); 139 int do_wrconfig(void);
239 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HUM_VALUE", "%d", Config.hum_value)) < 0) { 237 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HUM_VALUE", "%d", Config.hum_value)) < 0) {
240 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); 238 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
241 return 1; 239 return 1;
242 } 240 }
243 241
244 #ifdef HAVE_WIRINGPI_H
245 /* 242 /*
246 * Start an element named "LCDS" as child of THERMFERM. 243 * Start an element named "LCDS" as child of THERMFERM.
247 */ 244 */
248 if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "LCDS")) < 0) { 245 if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "LCDS")) < 0) {
249 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement"); 246 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
285 */ 282 */
286 if ((rc = xmlTextWriterEndElement(writer)) < 0) { 283 if ((rc = xmlTextWriterEndElement(writer)) < 0) {
287 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement"); 284 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement");
288 return 1; 285 return 1;
289 } 286 }
290 #endif
291 287
292 /* 288 /*
293 * Fermenter units 289 * Fermenter units
294 */ 290 */
295 if (Config.units) { 291 if (Config.units) {
958 954
959 955
960 /* 956 /*
961 * Parse one LCD display 957 * Parse one LCD display
962 */ 958 */
963 #ifdef HAVE_WIRINGPI_H
964 int parseLCD(xmlDocPtr doc, xmlNodePtr cur) 959 int parseLCD(xmlDocPtr doc, xmlNodePtr cur)
965 { 960 {
966 xmlChar *key; 961 xmlChar *key;
967 int ival; 962 int ival;
968 963
1003 } 998 }
1004 cur = cur->next; 999 cur = cur->next;
1005 } 1000 }
1006 return 0; 1001 return 0;
1007 } 1002 }
1008 #endif
1009 1003
1010 1004
1011 1005
1012 /* 1006 /*
1013 * Parse a fermenter unit 1007 * Parse a fermenter unit
2045 Config.temp_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); 2039 Config.temp_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
2046 } 2040 }
2047 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HUM_ADDRESS"))) { 2041 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HUM_ADDRESS"))) {
2048 Config.hum_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); 2042 Config.hum_address = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
2049 } 2043 }
2050 #ifdef HAVE_WIRINGPI_H
2051 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LCDS"))) { 2044 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LCDS"))) {
2052 parseLCDs(doc, cur); 2045 parseLCDs(doc, cur);
2053 } 2046 }
2054 #endif
2055 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FERMENTERS"))) { 2047 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FERMENTERS"))) {
2056 parseFermenters(doc, cur); 2048 parseFermenters(doc, cur);
2057 } 2049 }
2058 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILES"))) { 2050 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILES"))) {
2059 parseProfiles(doc, cur); 2051 parseProfiles(doc, cur);

mercurial