The parameter('enable') have only two state just like enabled/disabled.
Therefore, change it to a boolean.
Change-Id: Icefe77a4b62d3e63b882c9106a48134f9036fc16
Signed-off-by: jino.cho <jino.cho@samsung.com>
int peripheral_gdbus_pwm_get_period(peripheral_pwm_h pwm, int *period);
int peripheral_gdbus_pwm_set_duty_cycle(peripheral_pwm_h pwm, int duty_cycle);
int peripheral_gdbus_pwm_get_duty_cycle(peripheral_pwm_h pwm, int *duty_cycle);
-int peripheral_gdbus_pwm_set_enable(peripheral_pwm_h pwm, peripheral_pwm_state_e enable);
-int peripheral_gdbus_pwm_get_enable(peripheral_pwm_h pwm, peripheral_pwm_state_e *enable);
+int peripheral_gdbus_pwm_set_enable(peripheral_pwm_h pwm, bool enable);
+int peripheral_gdbus_pwm_get_enable(peripheral_pwm_h pwm, bool *enable);
#endif /* __PERIPHERAL_GDBUS_PWM_H__ */
*/
typedef struct _peripheral_pwm_s *peripheral_pwm_h;
-typedef enum {
- PERIPHERAL_PWM_DISABLE = 0,
- PERIPHERAL_PWM_ENABLE,
-} peripheral_pwm_state_e;
-
int peripheral_pwm_open(int device, int channel, peripheral_pwm_h *pwm);
int peripheral_pwm_close(peripheral_pwm_h pwm);
int peripheral_pwm_get_duty_cycle(peripheral_pwm_h pwm, int *duty_cycle);
-int peripheral_pwm_set_enable(peripheral_pwm_h pwm, peripheral_pwm_state_e enable);
+int peripheral_pwm_set_enable(peripheral_pwm_h pwm, bool enable);
-int peripheral_pwm_get_enable(peripheral_pwm_h pwm, peripheral_pwm_state_e *enable);
+int peripheral_pwm_get_enable(peripheral_pwm_h pwm, bool *enable);
/**
* @}
return ret;
}
-int peripheral_gdbus_pwm_set_enable(peripheral_pwm_h pwm, peripheral_pwm_state_e enable)
+int peripheral_gdbus_pwm_set_enable(peripheral_pwm_h pwm, bool enable)
{
GError *error = NULL;
gint32 ret = PERIPHERAL_ERROR_NONE;
</method>
<method name="SetEnable">
<arg type="u" name="handle" direction="in"/>
- <arg type="i" name="enable" direction="in"/>
+ <arg type="b" name="enable" direction="in"/>
<arg type="i" name="result" direction="out"/>
</method>
<method name="GetEnable">
<arg type="u" name="handle" direction="in"/>
- <arg type="i" name="enable" direction="out"/>
+ <arg type="b" name="enable" direction="out"/>
<arg type="i" name="result" direction="out"/>
</method>
</interface>
return peripheral_gdbus_pwm_get_duty_cycle(pwm, duty_cycle);
}
-int peripheral_pwm_set_enable(peripheral_pwm_h pwm, peripheral_pwm_state_e enable)
+int peripheral_pwm_set_enable(peripheral_pwm_h pwm, bool enable)
{
if (pwm == NULL) return PERIPHERAL_ERROR_INVALID_PARAMETER;
return peripheral_gdbus_pwm_set_enable(pwm, enable);
}
-int peripheral_pwm_get_enable(peripheral_pwm_h pwm, peripheral_pwm_state_e *enable)
+int peripheral_pwm_get_enable(peripheral_pwm_h pwm, bool *enable)
{
if (pwm == NULL) return PERIPHERAL_ERROR_INVALID_PARAMETER;