thermferm/server.c

changeset 273
b863e0147296
parent 270
df81d583c2c3
child 274
111b0e9663dc
equal deleted inserted replaced
272:f436d826de4b 273:b863e0147296
1545 } else if (val && (strcmp(kwd, (char *)"HEATER_STATE") == 0)) { 1545 } else if (val && (strcmp(kwd, (char *)"HEATER_STATE") == 0)) {
1546 if ((sscanf(val, "%d", &ival) == 1) && ((ival == 0) || (ival == 100))) 1546 if ((sscanf(val, "%d", &ival) == 1) && ((ival == 0) || (ival == 100)))
1547 unit->heater_state = ival; 1547 unit->heater_state = ival;
1548 1548
1549 } else if (val && (strcmp(kwd, (char *)"HEATER_DELAY") == 0)) { 1549 } else if (val && (strcmp(kwd, (char *)"HEATER_DELAY") == 0)) {
1550 if ((sscanf(val, "%d", &ival) == 1) && ((ival == 0) || (ival == 100))) 1550 if (sscanf(val, "%d", &ival) == 1)
1551 unit->heater_delay = ival; 1551 unit->heater_delay = ival;
1552 1552
1553 } else if (strcmp(kwd, (char *)"COOLER_ADDRESS") == 0) { 1553 } else if (strcmp(kwd, (char *)"COOLER_ADDRESS") == 0) {
1554 if (unit->cooler_address) { 1554 if (unit->cooler_address) {
1555 device_count(FALSE, unit->cooler_address); 1555 device_count(FALSE, unit->cooler_address);
1564 } else if (val && (strcmp(kwd, (char *)"COOLER_STATE") == 0)) { 1564 } else if (val && (strcmp(kwd, (char *)"COOLER_STATE") == 0)) {
1565 if ((sscanf(val, "%d", &ival) == 1) && ((ival == 0) || (ival == 100))) 1565 if ((sscanf(val, "%d", &ival) == 1) && ((ival == 0) || (ival == 100)))
1566 unit->cooler_state = ival; 1566 unit->cooler_state = ival;
1567 1567
1568 } else if (val && (strcmp(kwd, (char *)"COOLER_DELAY") == 0)) { 1568 } else if (val && (strcmp(kwd, (char *)"COOLER_DELAY") == 0)) {
1569 if ((sscanf(val, "%d", &ival) == 1) && ((ival == 0) || (ival == 100))) 1569 if (sscanf(val, "%d", &ival) == 1)
1570 unit->cooler_delay = ival; 1570 unit->cooler_delay = ival;
1571 1571
1572 } else if (strcmp(kwd, (char *)"FAN_ADDRESS") == 0) { 1572 } else if (strcmp(kwd, (char *)"FAN_ADDRESS") == 0) {
1573 if (unit->fan_address) { 1573 if (unit->fan_address) {
1574 device_count(FALSE, unit->fan_address); 1574 device_count(FALSE, unit->fan_address);
1583 } else if (val && (strcmp(kwd, (char *)"FAN_STATE") == 0)) { 1583 } else if (val && (strcmp(kwd, (char *)"FAN_STATE") == 0)) {
1584 if ((sscanf(val, "%d", &ival) == 1) && ((ival == 0) || (ival == 100))) 1584 if ((sscanf(val, "%d", &ival) == 1) && ((ival == 0) || (ival == 100)))
1585 unit->fan_state = ival; 1585 unit->fan_state = ival;
1586 1586
1587 } else if (val && (strcmp(kwd, (char *)"FAN_DELAY") == 0)) { 1587 } else if (val && (strcmp(kwd, (char *)"FAN_DELAY") == 0)) {
1588 if ((sscanf(val, "%d", &ival) == 1) && ((ival == 0) || (ival == 100))) 1588 if (sscanf(val, "%d", &ival) == 1)
1589 unit->fan_delay = ival; 1589 unit->fan_delay = ival;
1590 1590
1591 } else if (strcmp(kwd, (char *)"DOOR_ADDRESS") == 0) { 1591 } else if (strcmp(kwd, (char *)"DOOR_ADDRESS") == 0) {
1592 if (unit->door_address) { 1592 if (unit->door_address) {
1593 device_count(FALSE, unit->door_address); 1593 device_count(FALSE, unit->door_address);

mercurial