From 3fe9637e30d9ed38407a95f29eb47be03369410e Mon Sep 17 00:00:00 2001 From: "jino.cho" Date: Tue, 25 Apr 2017 18:10:09 +0900 Subject: [PATCH] Add parameters to the gpio open method - add parameters to the gpio open method. - update the gpio handle when the gpio attributes are changed. Change-Id: I2c2ba69605bcc85c65beeb512c32a4b5d1453f18 Signed-off-by: jino.cho --- src/peripheral_dbus.c | 6 ++++++ src/peripheral_io.xml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/peripheral_dbus.c b/src/peripheral_dbus.c index 67c7025..3c32644 100644 --- a/src/peripheral_dbus.c +++ b/src/peripheral_dbus.c @@ -101,6 +101,8 @@ int peripheral_dbus_gpio_open(peripheral_gpio_h gpio) if (peripheral_io_gdbus_gpio_call_open_sync( gpio_proxy, gpio->pin, + (gint*)&gpio->edge, + (gint*)&gpio->direction, &ret, NULL, &error) == FALSE) { @@ -151,6 +153,7 @@ int peripheral_dbus_gpio_get_direction(peripheral_gpio_h gpio, peripheral_gpio_d g_error_free(error); return PERIPHERAL_ERROR_UNKNOWN; } + gpio->direction = *direction; return ret; } @@ -173,6 +176,7 @@ int peripheral_dbus_gpio_set_direction(peripheral_gpio_h gpio, peripheral_gpio_d g_error_free(error); return PERIPHERAL_ERROR_UNKNOWN; } + gpio->direction = direction; return ret; } @@ -239,6 +243,7 @@ int peripheral_dbus_gpio_get_edge_mode(peripheral_gpio_h gpio, peripheral_gpio_e g_error_free(error); return PERIPHERAL_ERROR_UNKNOWN; } + gpio->edge = *edge; return ret; } @@ -261,6 +266,7 @@ int peripheral_dbus_gpio_set_edge_mode(peripheral_gpio_h gpio, peripheral_gpio_e g_error_free(error); return PERIPHERAL_ERROR_UNKNOWN; } + gpio->edge = edge; return ret; } diff --git a/src/peripheral_io.xml b/src/peripheral_io.xml index 40672ad..a99cbbc 100644 --- a/src/peripheral_io.xml +++ b/src/peripheral_io.xml @@ -3,6 +3,8 @@ + + -- 2.34.1