Add parameters to the gpio open method 29/126929/1
authorjino.cho <jino.cho@samsung.com>
Tue, 25 Apr 2017 09:10:09 +0000 (18:10 +0900)
committerjino.cho <jino.cho@samsung.com>
Tue, 25 Apr 2017 09:19:52 +0000 (18:19 +0900)
- 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 <jino.cho@samsung.com>
src/peripheral_dbus.c
src/peripheral_io.xml

index 67c702547513cd94780099fe9b3be94458780562..3c326447b9f612e2de9f1af6b728de1ecb3adc99 100644 (file)
@@ -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;
 }
index 40672ad07bcf25c19f450609e8144e03dbede4be..a99cbbcd1f1b5cf9187c3d280c291101043825ec 100644 (file)
@@ -3,6 +3,8 @@
        <interface name="org.tizen.peripheral_io.gpio">
                <method name="Open">
                        <arg type="i" name="pin" direction="in"/>
+                       <arg type="i" name="edge" direction="out"/>
+                       <arg type="i" name="direction" direction="out"/>
                        <arg type="i" name="result" direction="out"/>
                </method>
                <method name="Close">