From 99ecb3dc2f1c7b093e89e50c8f50718541da59ea Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Wed, 21 Apr 2021 22:23:53 +0800 Subject: [PATCH] update iotd.conf --- iotd/hal/gpio.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iotd/hal/gpio.c b/iotd/hal/gpio.c index bd050b1..a5532a5 100644 --- a/iotd/hal/gpio.c +++ b/iotd/hal/gpio.c @@ -117,7 +117,7 @@ gpiod_chip_close(s_chip); } -void gpio_out(char *name, int cmd) +void gpio_out(char *name, char *cmd) { int i; int found = 0; @@ -137,11 +137,11 @@ return ; } - if( OFF == cmd ) + if( strstr(cmd, "on") ) { gpiod_line_set_value(s_gpio->output[i].line, s_gpio->output[i].active_level); } - else + else if( strstr(cmd, "off") ) { gpiod_line_set_value(s_gpio->output[i].line, !s_gpio->output[i].active_level); } -- Gitblit v1.9.1