From af30c84d820576c37e57de31bc47d18b6e4b89e1 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Wed, 21 Apr 2021 16:52:34 +0800 Subject: [PATCH] update iotd, test MQTT subscriber ok --- 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