From: jino.cho Date: Thu, 18 May 2017 07:33:10 +0000 (+0900) Subject: Rearrange the order of pwm functions X-Git-Tag: submit/tizen/20170602.034029~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=147b51cddb519bfcc5f8e60296e7f8046d3b58f0;p=platform%2Fcore%2Fsystem%2Fperipheral-bus.git Rearrange the order of pwm functions Change-Id: Idc658f2c159d820add8d328073f4d297b6f46d86 Signed-off-by: jino.cho --- diff --git a/src/daemon/peripheral_bus.c b/src/daemon/peripheral_bus.c index b2a67df..04f2bee 100644 --- a/src/daemon/peripheral_bus.c +++ b/src/daemon/peripheral_bus.c @@ -275,50 +275,50 @@ gboolean handle_pwm_close( return true; } -gboolean handle_pwm_set_duty_cycle( +gboolean handle_pwm_set_period( PeripheralIoGdbusPwm *pwm, GDBusMethodInvocation *invocation, gint handle, - gint duty_cycle, + gint period, gpointer user_data) { peripheral_error_e ret = PERIPHERAL_ERROR_NONE; pb_pwm_data_h pwm_handle = GUINT_TO_POINTER(handle); - ret = peripheral_bus_pwm_set_duty_cycle(pwm_handle, duty_cycle); - peripheral_io_gdbus_pwm_complete_set_duty_cycle(pwm, invocation, ret); + ret = peripheral_bus_pwm_set_period(pwm_handle, period); + peripheral_io_gdbus_pwm_complete_set_period(pwm, invocation, ret); return true; } -gboolean handle_pwm_set_period( +gboolean handle_pwm_get_period( PeripheralIoGdbusPwm *pwm, GDBusMethodInvocation *invocation, gint handle, - gint period, gpointer user_data) { peripheral_error_e ret = PERIPHERAL_ERROR_NONE; pb_pwm_data_h pwm_handle = GUINT_TO_POINTER(handle); + int period; - ret = peripheral_bus_pwm_set_period(pwm_handle, period); - peripheral_io_gdbus_pwm_complete_set_period(pwm, invocation, ret); + ret = peripheral_bus_pwm_get_period(pwm_handle, &period); + peripheral_io_gdbus_pwm_complete_get_period(pwm, invocation, period, ret); return true; } -gboolean handle_pwm_set_enable( +gboolean handle_pwm_set_duty_cycle( PeripheralIoGdbusPwm *pwm, GDBusMethodInvocation *invocation, gint handle, - gint enable, + gint duty_cycle, gpointer user_data) { peripheral_error_e ret = PERIPHERAL_ERROR_NONE; pb_pwm_data_h pwm_handle = GUINT_TO_POINTER(handle); - ret = peripheral_bus_pwm_set_enable(pwm_handle, enable); - peripheral_io_gdbus_pwm_complete_set_enable(pwm, invocation, ret); + ret = peripheral_bus_pwm_set_duty_cycle(pwm_handle, duty_cycle); + peripheral_io_gdbus_pwm_complete_set_duty_cycle(pwm, invocation, ret); return true; } @@ -339,18 +339,18 @@ gboolean handle_pwm_get_duty_cycle( return true; } -gboolean handle_pwm_get_period( +gboolean handle_pwm_set_enable( PeripheralIoGdbusPwm *pwm, GDBusMethodInvocation *invocation, gint handle, + gint enable, gpointer user_data) { peripheral_error_e ret = PERIPHERAL_ERROR_NONE; pb_pwm_data_h pwm_handle = GUINT_TO_POINTER(handle); - int period; - ret = peripheral_bus_pwm_get_period(pwm_handle, &period); - peripheral_io_gdbus_pwm_complete_get_period(pwm, invocation, period, ret); + ret = peripheral_bus_pwm_set_enable(pwm_handle, enable); + peripheral_io_gdbus_pwm_complete_set_enable(pwm, invocation, ret); return true; } @@ -747,25 +747,25 @@ static gboolean __pwm_init(peripheral_bus_s *pb_data) "handle-close", G_CALLBACK(handle_pwm_close), pb_data); - g_signal_connect(pb_data->pwm_skeleton, - "handle-set-duty-cycle", - G_CALLBACK(handle_pwm_set_duty_cycle), - pb_data); g_signal_connect(pb_data->pwm_skeleton, "handle-set-period", G_CALLBACK(handle_pwm_set_period), pb_data); g_signal_connect(pb_data->pwm_skeleton, - "handle-set-enable", - G_CALLBACK(handle_pwm_set_enable), + "handle-get-period", + G_CALLBACK(handle_pwm_get_period), + pb_data); + g_signal_connect(pb_data->pwm_skeleton, + "handle-set-duty-cycle", + G_CALLBACK(handle_pwm_set_duty_cycle), pb_data); g_signal_connect(pb_data->pwm_skeleton, "handle-get-duty-cycle", G_CALLBACK(handle_pwm_get_duty_cycle), pb_data); g_signal_connect(pb_data->pwm_skeleton, - "handle-get-period", - G_CALLBACK(handle_pwm_get_period), + "handle-set-enable", + G_CALLBACK(handle_pwm_set_enable), pb_data); manager = g_dbus_object_manager_server_new(PERIPHERAL_GDBUS_PWM_PATH); diff --git a/src/daemon/peripheral_bus_pwm.c b/src/daemon/peripheral_bus_pwm.c index 6fcb205..8c39a4f 100644 --- a/src/daemon/peripheral_bus_pwm.c +++ b/src/daemon/peripheral_bus_pwm.c @@ -129,19 +129,19 @@ int peripheral_bus_pwm_close(pb_pwm_data_h pwm, gpointer user_data) return PERIPHERAL_ERROR_NONE; } -int peripheral_bus_pwm_set_duty_cycle(pb_pwm_data_h pwm, int duty_cycle) +int peripheral_bus_pwm_set_period(pb_pwm_data_h pwm, int period) { - return pwm_set_duty_cycle(pwm->device, pwm->channel, duty_cycle); + return pwm_set_period(pwm->device, pwm->channel, period); } -int peripheral_bus_pwm_set_period(pb_pwm_data_h pwm, int period) +int peripheral_bus_pwm_get_period(pb_pwm_data_h pwm, int *period) { - return pwm_set_period(pwm->device, pwm->channel, period); + return pwm_get_period(pwm->device, pwm->channel, period); } -int peripheral_bus_pwm_set_enable(pb_pwm_data_h pwm, int enable) +int peripheral_bus_pwm_set_duty_cycle(pb_pwm_data_h pwm, int duty_cycle) { - return pwm_set_enable(pwm->device, pwm->channel, enable); + return pwm_set_duty_cycle(pwm->device, pwm->channel, duty_cycle); } int peripheral_bus_pwm_get_duty_cycle(pb_pwm_data_h pwm, int *duty_cycle) @@ -149,7 +149,8 @@ int peripheral_bus_pwm_get_duty_cycle(pb_pwm_data_h pwm, int *duty_cycle) return pwm_get_duty_cycle(pwm->device, pwm->channel, duty_cycle); } -int peripheral_bus_pwm_get_period(pb_pwm_data_h pwm, int *period) +int peripheral_bus_pwm_set_enable(pb_pwm_data_h pwm, int enable) { - return pwm_get_period(pwm->device, pwm->channel, period); + return pwm_set_enable(pwm->device, pwm->channel, enable); } + diff --git a/src/daemon/peripheral_bus_pwm.h b/src/daemon/peripheral_bus_pwm.h index c7ebf83..14a92f2 100644 --- a/src/daemon/peripheral_bus_pwm.h +++ b/src/daemon/peripheral_bus_pwm.h @@ -19,10 +19,10 @@ int peripheral_bus_pwm_open(int device, int channel, pb_pwm_data_h *pwm, gpointer user_data); int peripheral_bus_pwm_close(pb_pwm_data_h pwm, gpointer user_data); -int peripheral_bus_pwm_set_duty_cycle(pb_pwm_data_h pwm, int duty_cycle); int peripheral_bus_pwm_set_period(pb_pwm_data_h pwm, int period); -int peripheral_bus_pwm_set_enable(pb_pwm_data_h pwm, int enable); -int peripheral_bus_pwm_get_duty_cycle(pb_pwm_data_h pwm, int *duty_cycle); int peripheral_bus_pwm_get_period(pb_pwm_data_h pwm, int *period); +int peripheral_bus_pwm_set_duty_cycle(pb_pwm_data_h pwm, int duty_cycle); +int peripheral_bus_pwm_get_duty_cycle(pb_pwm_data_h pwm, int *duty_cycle); +int peripheral_bus_pwm_set_enable(pb_pwm_data_h pwm, int enable); #endif /* __PERIPHERAL_BUS_PWM_H__ */ diff --git a/src/daemon/peripheral_io.xml b/src/daemon/peripheral_io.xml index 1987f8e..8783128 100644 --- a/src/daemon/peripheral_io.xml +++ b/src/daemon/peripheral_io.xml @@ -93,24 +93,24 @@ - + - + - + - + - + - + - + - +