thermferm/server.c

changeset 566
776a605befa5
parent 564
3fc61dd28656
child 570
1e0192b295b9
--- a/thermferm/server.c	Mon Aug 06 17:04:57 2018 +0200
+++ b/thermferm/server.c	Fri Aug 24 14:14:31 2018 +0200
@@ -36,7 +36,7 @@
 extern int		run_hold;
 extern sys_config       Config;
 extern const char	UNITMODE[5][8];
-extern const char	UNITSTAGE[3][10];
+extern const char	UNITSTAGE[4][12];
 extern const char	TEMPSTATE[3][8];
 extern const char	DEVTYPE[8][6];
 extern const char	DEVPRESENT[4][6];
@@ -1950,7 +1950,11 @@
     if ((strcmp(opt, (char *)"LIST") == 0) && (param == NULL)) {
 	srv_send((char *)"212 Fermenter list follows:");
 	for (unit = Config.units; unit; unit = unit->next) {
-	    srv_send((char *)"%s,%s,%s", unit->uuid, unit->alias, UNITMODE[unit->mode]);
+	    if (strlen(unit->product_code) && strlen(unit->product_name)) {
+		srv_send((char *)"%s,%s %s,%s", unit->uuid, unit->product_code, unit->product_name, UNITMODE[unit->mode]);
+	    } else {
+	    	srv_send((char *)"%s,%s,%s", unit->uuid, unit->alias, UNITMODE[unit->mode]);
+	    }
 	}
 	srv_send((char *)".");
 	return 0;
@@ -2455,7 +2459,7 @@
 				}
 
 			    } else if (val && (strcmp(kwd, (char *)"STAGE") == 0)) {
-				for (i = 0; i < 3; i++) {
+				for (i = 0; i < 4; i++) {
 				    if (strcmp(val, UNITSTAGE[i]) == 0) {
 					if (i != unit->stage) {
 					    syslog(LOG_NOTICE, "Fermenter unit %s stage %s to %s", unit->uuid, UNITSTAGE[unit->stage], UNITSTAGE[i]);

mercurial