34 extern int debug; |
34 extern int debug; |
35 extern int run_pause; |
35 extern int run_pause; |
36 extern int run_hold; |
36 extern int run_hold; |
37 extern sys_config Config; |
37 extern sys_config Config; |
38 extern const char UNITMODE[5][8]; |
38 extern const char UNITMODE[5][8]; |
39 extern const char UNITSTAGE[3][10]; |
39 extern const char UNITSTAGE[4][12]; |
40 extern const char TEMPSTATE[3][8]; |
40 extern const char TEMPSTATE[3][8]; |
41 extern const char DEVTYPE[8][6]; |
41 extern const char DEVTYPE[8][6]; |
42 extern const char DEVPRESENT[4][6]; |
42 extern const char DEVPRESENT[4][6]; |
43 extern const char DEVDIR[7][11]; |
43 extern const char DEVDIR[7][11]; |
44 extern const char PROFSTATE[5][6]; |
44 extern const char PROFSTATE[5][6]; |
1948 } |
1948 } |
1949 |
1949 |
1950 if ((strcmp(opt, (char *)"LIST") == 0) && (param == NULL)) { |
1950 if ((strcmp(opt, (char *)"LIST") == 0) && (param == NULL)) { |
1951 srv_send((char *)"212 Fermenter list follows:"); |
1951 srv_send((char *)"212 Fermenter list follows:"); |
1952 for (unit = Config.units; unit; unit = unit->next) { |
1952 for (unit = Config.units; unit; unit = unit->next) { |
1953 srv_send((char *)"%s,%s,%s", unit->uuid, unit->alias, UNITMODE[unit->mode]); |
1953 if (strlen(unit->product_code) && strlen(unit->product_name)) { |
|
1954 srv_send((char *)"%s,%s %s,%s", unit->uuid, unit->product_code, unit->product_name, UNITMODE[unit->mode]); |
|
1955 } else { |
|
1956 srv_send((char *)"%s,%s,%s", unit->uuid, unit->alias, UNITMODE[unit->mode]); |
|
1957 } |
1954 } |
1958 } |
1955 srv_send((char *)"."); |
1959 srv_send((char *)"."); |
1956 return 0; |
1960 return 0; |
1957 } |
1961 } |
1958 |
1962 |
2453 syslog(LOG_NOTICE, "Fermenter unit %s psu idx %d to %d", unit->uuid, unit->psu_idx, ival); |
2457 syslog(LOG_NOTICE, "Fermenter unit %s psu idx %d to %d", unit->uuid, unit->psu_idx, ival); |
2454 unit->psu_idx = ival; |
2458 unit->psu_idx = ival; |
2455 } |
2459 } |
2456 |
2460 |
2457 } else if (val && (strcmp(kwd, (char *)"STAGE") == 0)) { |
2461 } else if (val && (strcmp(kwd, (char *)"STAGE") == 0)) { |
2458 for (i = 0; i < 3; i++) { |
2462 for (i = 0; i < 4; i++) { |
2459 if (strcmp(val, UNITSTAGE[i]) == 0) { |
2463 if (strcmp(val, UNITSTAGE[i]) == 0) { |
2460 if (i != unit->stage) { |
2464 if (i != unit->stage) { |
2461 syslog(LOG_NOTICE, "Fermenter unit %s stage %s to %s", unit->uuid, UNITSTAGE[unit->stage], UNITSTAGE[i]); |
2465 syslog(LOG_NOTICE, "Fermenter unit %s stage %s to %s", unit->uuid, UNITSTAGE[unit->stage], UNITSTAGE[i]); |
2462 unit->mqtt_flag |= MQTT_FLAG_DATA; |
2466 unit->mqtt_flag |= MQTT_FLAG_DATA; |
2463 } |
2467 } |