APUE course source code
guowenxue
2026-05-12 805b28fc2e633bcd9c823a4b23614378ebfd50a1
project/4.mqttd/iotd.c
@@ -230,10 +230,7 @@
            if( !item )
                continue;
            if( strcasecmp(item->valuestring, "on") )
                turn_relay(which, ON);
            else if( strcasecmp(item->valuestring, "off") )
                turn_relay(which, OFF);
            turn_relay(which, item->valueint);
        }
    }
@@ -246,10 +243,7 @@
            if( !item )
                continue;
            if( strcasecmp(item->valuestring, "on") )
                turn_led(which, ON);
            else if( strcasecmp(item->valuestring, "off") )
                turn_led(which, OFF);
            turn_led(which, item->valueint);
        }
    }