gboolean handle_gpio_open(
PeripheralIoGdbusGpio *gpio,
GDBusMethodInvocation *invocation,
+ GUnixFDList *fd_list,
gint pin,
gpointer user_data);
gboolean handle_i2c_open(
PeripheralIoGdbusI2c *i2c,
GDBusMethodInvocation *invocation,
+ GUnixFDList *fd_list,
gint bus,
gint address,
gpointer user_data);
gboolean handle_pwm_open(
PeripheralIoGdbusPwm *pwm,
GDBusMethodInvocation *invocation,
+ GUnixFDList *fd_list,
gint chip,
gint pin,
gpointer user_data);
gboolean handle_spi_open(
PeripheralIoGdbusSpi *spi,
GDBusMethodInvocation *invocation,
+ GUnixFDList *fd_list,
gint bus,
gint cs,
gpointer user_data);
gboolean handle_uart_open(
PeripheralIoGdbusUart *uart,
GDBusMethodInvocation *invocation,
+ GUnixFDList *fd_list,
gint port,
gpointer user_data);
*/
#include <peripheral_io.h>
+#include <gio/gunixfdlist.h>
#include "peripheral_io_gdbus.h"
#include "peripheral_bus.h"
gboolean handle_gpio_open(
PeripheralIoGdbusGpio *gpio,
GDBusMethodInvocation *invocation,
+ GUnixFDList *fd_list,
gint pin,
gpointer user_data)
{
peripheral_bus_s *pb_data = (peripheral_bus_s*)user_data;
pb_data_h gpio_handle = NULL;
+ GUnixFDList *gpio_fd_list = NULL;
+
if ((ret = peripheral_bus_gpio_open(pin, &gpio_handle, user_data)) < PERIPHERAL_ERROR_NONE)
goto out;
_D("gpio : %d, id = %s", gpio_handle->dev.gpio.pin, gpio_handle->client_info.id);
out:
- peripheral_io_gdbus_gpio_complete_open(gpio, invocation, GPOINTER_TO_UINT(gpio_handle), ret);
+ peripheral_io_gdbus_gpio_complete_open(gpio, invocation, gpio_fd_list, GPOINTER_TO_UINT(gpio_handle), ret);
return true;
}
\ No newline at end of file
gboolean handle_i2c_open(
PeripheralIoGdbusI2c *i2c,
GDBusMethodInvocation *invocation,
+ GUnixFDList *fd_list,
gint bus,
gint address,
gpointer user_data)
peripheral_error_e ret = PERIPHERAL_ERROR_NONE;
pb_data_h i2c_handle = NULL;
+ GUnixFDList *i2c_fd_list = NULL;
+
if ((ret = peripheral_bus_i2c_open(bus, address, &i2c_handle, user_data)) < PERIPHERAL_ERROR_NONE)
goto out;
_D("bus : %d, address : 0x%x, id = %s", bus, address, i2c_handle->client_info.id);
out:
- peripheral_io_gdbus_i2c_complete_open(i2c, invocation, GPOINTER_TO_UINT(i2c_handle), ret);
+ peripheral_io_gdbus_i2c_complete_open(i2c, invocation, i2c_fd_list, GPOINTER_TO_UINT(i2c_handle), ret);
return true;
}
gboolean handle_pwm_open(
PeripheralIoGdbusPwm *pwm,
GDBusMethodInvocation *invocation,
+ GUnixFDList *fd_list,
gint chip,
gint pin,
gpointer user_data)
peripheral_error_e ret = PERIPHERAL_ERROR_NONE;
pb_data_h pwm_handle = NULL;
+ GUnixFDList *pwm_fd_list = NULL;
+
if ((ret = peripheral_bus_pwm_open(chip, pin, &pwm_handle, user_data)) < PERIPHERAL_ERROR_NONE)
goto out;
_D("chip : %d, pin : %d, id = %s", chip, pin, pwm_handle->client_info.id);
out:
- peripheral_io_gdbus_pwm_complete_open(pwm, invocation, GPOINTER_TO_UINT(pwm_handle), ret);
+ peripheral_io_gdbus_pwm_complete_open(pwm, invocation, pwm_fd_list, GPOINTER_TO_UINT(pwm_handle), ret);
return true;
}
gboolean handle_spi_open(
PeripheralIoGdbusSpi *spi,
GDBusMethodInvocation *invocation,
+ GUnixFDList *fd_list,
gint bus,
gint cs,
gpointer user_data)
peripheral_error_e ret = PERIPHERAL_ERROR_NONE;
pb_data_h spi_handle = NULL;
+ GUnixFDList *spi_fd_list = NULL;
+
if ((ret = peripheral_bus_spi_open(bus, cs, &spi_handle, user_data)) < PERIPHERAL_ERROR_NONE)
goto out;
_D("bus : %d, cs : %d, id = %s", bus, cs, spi_handle->client_info.id);
out:
- peripheral_io_gdbus_spi_complete_open(spi, invocation, GPOINTER_TO_UINT(spi_handle), ret);
+ peripheral_io_gdbus_spi_complete_open(spi, invocation, spi_fd_list, GPOINTER_TO_UINT(spi_handle), ret);
return true;
}
+
gboolean handle_uart_open(
PeripheralIoGdbusUart *uart,
GDBusMethodInvocation *invocation,
+ GUnixFDList *fd_list,
gint port,
gpointer user_data)
{
peripheral_error_e ret = PERIPHERAL_ERROR_NONE;
pb_data_h uart_handle = NULL;
+ GUnixFDList *uart_fd_list = NULL;
+
if ((ret = peripheral_bus_uart_open(port, &uart_handle, user_data)) < PERIPHERAL_ERROR_NONE)
goto out;
_D("port : %d, id = %s", port, uart_handle->client_info.id);
out:
- peripheral_io_gdbus_uart_complete_open(uart, invocation, GPOINTER_TO_UINT(uart_handle), ret);
+ peripheral_io_gdbus_uart_complete_open(uart, invocation, uart_fd_list, GPOINTER_TO_UINT(uart_handle), ret);
return true;
}
<node>
<interface name="org.tizen.peripheral_io.gpio">
<method name="Open">
+ <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type="i" name="pin" direction="in"/>
<arg type="u" name="handle" direction="out"/>
<arg type="i" name="result" direction="out"/>
</interface>
<interface name="org.tizen.peripheral_io.i2c">
<method name="Open">
+ <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type="i" name="bus" direction="in"/>
<arg type="i" name="address" direction="in"/>
<arg type="u" name="handle" direction="out"/>
</interface>
<interface name="org.tizen.peripheral_io.pwm">
<method name="Open">
+ <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type="i" name="chip" direction="in"/>
<arg type="i" name="pin" direction="in"/>
<arg type="u" name="handle" direction="out"/>
</interface>
<interface name="org.tizen.peripheral_io.uart">
<method name="Open">
+ <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type="i" name="port" direction="in"/>
<arg type="u" name="handle" direction="out"/>
<arg type="i" name="result" direction="out"/>
</interface>
<interface name="org.tizen.peripheral_io.spi">
<method name="Open">
+ <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type="i" name="bus" direction="in"/>
<arg type="i" name="cs" direction="in"/>
<arg type="u" name="handle" direction="out"/>