APUE course source code
guowenxue
2 days ago dde12e90020d6a426ab12c8c1e9dba22f14bcc7e
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);
        }
    }