*/
typedef enum
{
- HAPTIC_MODULE_STATE_PLAYING = 0,
- HAPTIC_MODULE_STATE_STOP,
+ HAPTIC_MODULE_STATE_STOP = 0,
+ HAPTIC_MODULE_STATE_PLAYING,
} haptic_module_state;
/* Error and Return value codes */
DBusMessageIter iter;
DBusMessage *reply;
DBusError err;
- unsigned int handle;
- int state, ret;
+ int index, state, ret;
if (!plugin_intf || !plugin_intf->get_device_state) {
ret = -EFAULT;
}
dbus_error_init(&err);
- if (!dbus_message_get_args(msg, &err, DBUS_TYPE_UINT32, &handle, DBUS_TYPE_INVALID)) {
+ if (!dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID)) {
ret = -EINVAL;
goto exit;
}
- ret = plugin_intf->get_device_state(handle, &state);
+ ret = plugin_intf->get_device_state(index, &state);
if (ret < 0)
_E("fail to get device state : %d", ret);
else
{ "StopDevice", "u", "i", edbus_stop_device },
{ "VibrateMonotone", "uiii", "i", edbus_vibrate_monotone },
{ "VibrateBuffer", "uayiii", "i", edbus_vibrate_buffer },
- { "GetState", "u", "i", edbus_get_state },
+ { "GetState", "i", "i", edbus_get_state },
{ "GetDuration", "uay", "i", edbus_get_duration },
{ "CreateEffect", "iayi", "ayi", edbus_create_effect },
{ "SaveBinary", "sis", "i", edbus_save_binary },
{
DBusError err;
DBusMessage *msg;
- char str_handle[32];
+ char str_index[32];
char *arr[1];
int ret, ret_val;
return HAPTIC_ERROR_INVALID_PARAMETER;
}
- snprintf(str_handle, sizeof(str_handle), "%u", device_handle);
- arr[0] = str_handle;
+ snprintf(str_index, sizeof(str_index), "%d", HAPTIC_DEVICE_0);
+ arr[0] = str_index;
/* request to deviced to open haptic device */
msg = deviced_dbus_method_sync(BUS_NAME, DEVICED_PATH_HAPTIC, DEVICED_INTERFACE_HAPTIC,
- METHOD_GET_STATE, "u", arr);
+ METHOD_GET_STATE, "i", arr);
if (!msg)
return HAPTIC_ERROR_OPERATION_FAILED;