APUE course source code
guowenxue
18 hours ago ff970152123acde6084e9de1b3bad134922fc9c2
project/4.mqttd/iotd.c
@@ -230,9 +230,9 @@
            if( !item )
                continue;
            if( strcasecmp(item->valuestring, "on") )
            if( !strcasecmp(item->valuestring, "on") )
                turn_relay(which, ON);
            else if( strcasecmp(item->valuestring, "off") )
            else if( !strcasecmp(item->valuestring, "off") )
                turn_relay(which, OFF);
        }
    }
@@ -246,9 +246,9 @@
            if( !item )
                continue;
            if( strcasecmp(item->valuestring, "on") )
            if( !strcasecmp(item->valuestring, "on") )
                turn_led(which, ON);
            else if( strcasecmp(item->valuestring, "off") )
            else if( !strcasecmp(item->valuestring, "off") )
                turn_led(which, OFF);
        }
    }