APUE course source code
guowenxue
2025-11-20 c8234c0b72e173ea59bffa72457623970f698c4b
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);
        }
    }