From 2e470160b2df2af956825f72750ab14f3f415e55 Mon Sep 17 00:00:00 2001 From: Hyeongsik Min Date: Sun, 7 May 2017 18:03:51 +0900 Subject: [PATCH] Change argument name and type of i2c gdbus method The i2c methods will pass handle instead of file descriptor. Change-Id: Ia370c2fe4f3284e8d0b8925cc7bd4bb64c5f0df4 Signed-off-by: Hyeongsik Min --- include/peripheral_internal.h | 2 +- src/peripheral_dbus.c | 10 +++++----- src/peripheral_io.xml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/peripheral_internal.h b/include/peripheral_internal.h index f331b57..338f75e 100644 --- a/include/peripheral_internal.h +++ b/include/peripheral_internal.h @@ -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__ */ diff --git a/src/peripheral_dbus.c b/src/peripheral_dbus.c index 3a61390..b9af3d1 100644 --- a/src/peripheral_dbus.c +++ b/src/peripheral_dbus.c @@ -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, diff --git a/src/peripheral_io.xml b/src/peripheral_io.xml index ed9559c..ba2edef 100644 --- a/src/peripheral_io.xml +++ b/src/peripheral_io.xml @@ -58,15 +58,15 @@ - + - + - + @@ -74,7 +74,7 @@ - + -- 2.7.4