39 extern const char UNITmode[5]; |
39 extern const char UNITmode[5]; |
40 extern const char TEMPSTATE[3][8]; |
40 extern const char TEMPSTATE[3][8]; |
41 extern const char DEVTYPE[7][6]; |
41 extern const char DEVTYPE[7][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[4][6]; |
44 extern const char PROFSTATE[5][6]; |
45 |
45 |
46 |
46 |
47 int s; /* connected socket */ |
47 int s; /* connected socket */ |
48 int ls; /* listen socket */ |
48 int ls; /* listen socket */ |
49 |
49 |
1073 srv_send((char *)"DOOR_STATE,%d", unit->door_state); |
1073 srv_send((char *)"DOOR_STATE,%d", unit->door_state); |
1074 srv_send((char *)"MODE,%s", UNITMODE[unit->mode]); |
1074 srv_send((char *)"MODE,%s", UNITMODE[unit->mode]); |
1075 srv_send((char *)"FRIDGE_SET,%.1f", unit->fridge_set); |
1075 srv_send((char *)"FRIDGE_SET,%.1f", unit->fridge_set); |
1076 srv_send((char *)"BEER_SET,%.1f", unit->beer_set); |
1076 srv_send((char *)"BEER_SET,%.1f", unit->beer_set); |
1077 srv_send((char *)"PROFILE,%s", unit->profile); |
1077 srv_send((char *)"PROFILE,%s", unit->profile); |
1078 if (unit->profile) { |
1078 srv_send((char *)"PROF_STARTED,%d", (int)unit->prof_started); |
1079 srv_send((char *)"PROF_STARTED,%d", (int)unit->prof_started); |
1079 srv_send((char *)"PROF_STATE,%s", PROFSTATE[unit->prof_state]); |
1080 srv_send((char *)"PROF_STATE,%s", PROFSTATE[unit->prof_state]); |
1080 srv_send((char *)"PROF_TARGET,%.3f", unit->prof_target); |
1081 srv_send((char *)"PROF_TARGET,%.3f", unit->prof_target); |
|
1082 } |
|
1083 srv_send((char *)"TEMP_SET_MIN,%.1f", unit->temp_set_min); |
1081 srv_send((char *)"TEMP_SET_MIN,%.1f", unit->temp_set_min); |
1084 srv_send((char *)"TEMP_SET_MAX,%.1f", unit->temp_set_max); |
1082 srv_send((char *)"TEMP_SET_MAX,%.1f", unit->temp_set_max); |
1085 srv_send((char *)"IDLE_RANGE_L,%.1f", unit->idle_rangeL); |
1083 srv_send((char *)"IDLE_RANGE_L,%.1f", unit->idle_rangeL); |
1086 srv_send((char *)"IDLE_RANGE_H,%.1f", unit->idle_rangeH); |
1084 srv_send((char *)"IDLE_RANGE_H,%.1f", unit->idle_rangeH); |
1087 srv_send((char *)"."); |
1085 srv_send((char *)"."); |
1266 device_out(unit->cooler_address, unit->cooler_state); |
1264 device_out(unit->cooler_address, unit->cooler_state); |
1267 device_out(unit->fan_address, unit->fan_state); |
1265 device_out(unit->fan_address, unit->fan_state); |
1268 } |
1266 } |
1269 |
1267 |
1270 } else if (val && (strcmp(kwd, (char *)"PROF_STATE") == 0)) { |
1268 } else if (val && (strcmp(kwd, (char *)"PROF_STATE") == 0)) { |
1271 for (i = 0; i < 4; i++) { |
1269 for (i = 0; i < 5; i++) { |
1272 if (strcmp(val, PROFSTATE[i]) == 0) { |
1270 if (strcmp(val, PROFSTATE[i]) == 0) { |
1273 unit->prof_state = i; |
1271 unit->prof_state = i; |
1274 break; |
1272 break; |
1275 } |
1273 } |
1276 } |
1274 } |