#include "peripheral_gdbus_common.h"
-int peripheral_gdbus_gpio_open(peripheral_gpio_h gpio);
+int peripheral_gdbus_gpio_open(peripheral_gpio_h gpio, int pin);
int peripheral_gdbus_gpio_close(void);
#endif /* __PERIPHERAL_GDBUS_GPIO_H__ */
return PERIPHERAL_ERROR_NONE;
}
-int peripheral_gdbus_gpio_open(peripheral_gpio_h gpio)
+int peripheral_gdbus_gpio_open(peripheral_gpio_h gpio, int pin)
{
int ret;
GError *error = NULL;
if (peripheral_io_gdbus_gpio_call_open_sync(
gpio_proxy,
- gpio->pin,
+ pin,
NULL,
&gpio->handle,
&ret,
/* Initialize */
handle = (peripheral_gpio_h)calloc(1, sizeof(struct _peripheral_gpio_s));
-
if (handle == NULL) {
_E("Failed to allocate peripheral_gpio_h");
return PERIPHERAL_ERROR_OUT_OF_MEMORY;
}
- handle->pin = gpio_pin;
-
- ret = peripheral_gdbus_gpio_open(handle);
+ ret = peripheral_gdbus_gpio_open(handle, gpio_pin);
if (ret != PERIPHERAL_ERROR_NONE) {
_E("Failed to open the gpio pin, ret : %d", ret);
free(handle);