Change argument name and type of i2c gdbus method 28/128128/1 submit/tizen/20170508.033648
authorHyeongsik Min <hyeongsik.min@samsung.com>
Sun, 7 May 2017 09:03:51 +0000 (18:03 +0900)
committerHyeongsik Min <hyeongsik.min@samsung.com>
Sun, 7 May 2017 09:32:15 +0000 (18:32 +0900)
The i2c methods will pass handle instead of file descriptor.

Change-Id: Ia370c2fe4f3284e8d0b8925cc7bd4bb64c5f0df4
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
include/peripheral_internal.h
src/peripheral_dbus.c
src/peripheral_io.xml

index f331b57c348fb9c9a5f6696470cc1e61efb664cd..338f75e97a53911c1c24b76f311840e929e2481c 100644 (file)
@@ -30,7 +30,7 @@ struct _peripheral_gpio_s {
  * @brief Internal struct for i2c context
  */
 struct _peripheral_i2c_s {
-       int fd;
+       uint handle;
 };
 
 #endif /* __PERIPHERAL_INTERNAL_H__ */
index 3a61390425798c7325883db29b6159f61458cccb..b9af3d102a5afe1178e95fea4b34347ba6b51d40 100644 (file)
@@ -122,7 +122,7 @@ void handle_gpio_changed(
        if (!gpio)
                return;
 
-       _D("gpio=%d state=%d",pin, state);
+       _D("gpio=%d state=%d", pin, state);
 
        peripheral_gpio_isr_callback(pin);
 }
@@ -360,7 +360,7 @@ int peripheral_dbus_i2c_open(peripheral_i2c_h i2c, int bus, int address)
                        i2c_proxy,
                        bus,
                        address,
-                       &i2c->fd,
+                       &i2c->handle,
                        &ret,
                        NULL,
                        &error) == FALSE) {
@@ -381,7 +381,7 @@ int peripheral_dbus_i2c_close(peripheral_i2c_h i2c)
 
        if (peripheral_io_gdbus_i2c_call_close_sync(
                        i2c_proxy,
-                       i2c->fd,
+                       i2c->handle,
                        &ret,
                        NULL,
                        &error) == FALSE) {
@@ -406,7 +406,7 @@ int peripheral_dbus_i2c_read(peripheral_i2c_h i2c, uint8_t *data, int length)
 
        if (peripheral_io_gdbus_i2c_call_read_sync(
                        i2c_proxy,
-                       i2c->fd,
+                       i2c->handle,
                        length,
                        &data_array,
                        &ret,
@@ -448,7 +448,7 @@ int peripheral_dbus_i2c_write(peripheral_i2c_h i2c, uint8_t *data, int length)
 
        if (peripheral_io_gdbus_i2c_call_write_sync(
                        i2c_proxy,
-                       i2c->fd,
+                       i2c->handle,
                        length,
                        g_data,
                        &ret,
index ed9559cae0b41f154dc556862c3e1441e856dfa0..ba2edefb7c4c9f7d6f96086622b0073eb3a7d4f7 100644 (file)
                <method name="Open">
                        <arg type="i" name="bus" direction="in"/>
                        <arg type="i" name="address" direction="in"/>
-                       <arg type="i" name="fd" direction="out"/>
+                       <arg type="u" name="handle" direction="out"/>
                        <arg type="i" name="result" direction="out"/>
                </method>
                <method name="Close">
-                       <arg type="i" name="fd" direction="in"/>
+                       <arg type="u" name="handle" direction="in"/>
                        <arg type="i" name="result" direction="out"/>
                </method>
                <method name="Read">
-                       <arg type="i" name="fd" direction="in"/>
+                       <arg type="u" name="handle" direction="in"/>
                        <arg type="i" name="length" direction="in"/>
                        <arg type="a(y)" name="data" direction="out">
                                <annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>
@@ -74,7 +74,7 @@
                        <arg type="i" name="result" direction="out"/>
                </method>
                <method name="Write">
-                       <arg type="i" name="fd" direction="in"/>
+                       <arg type="u" name="handle" direction="in"/>
                        <arg type="i" name="length" direction="in"/>
                        <arg type="a(y)" name="data" direction="in">
                                <annotation name="org.gtk.GDBus.C.ForceGVariant" value="true"/>