#define METHOD_HAPTIC_CLOSEDEVICE "CloseDevice"
#define METHOD_HAPTIC_STOPDEVICE "StopDevice"
#define METHOD_HAPTIC_VIBRATEMONOTONE "VibrateMonotone"
-#define METHOD_HAPTIC_VIBRATEEFFECT "VibrateEffect"
+#define METHOD_HAPTIC_VIBRATEEFFECT "VibratePattern"
#define METHOD_HAPTIC_GETSTATE "GetState"
#define METHOD_HAPTIC_SHOWHANDLELIST "ShowHandleList"
#define METHOD_HAPTIC_ISSUPPORTED "IsSupported"
return request_haptic_method(METHOD_HAPTIC_VIBRATEMONOTONE, g_variant_new("(uiii)", handle, duration, level, priority));
}
-static bool haptic_vibrateeffect(char *pattern, int level, int priority)
+static bool haptic_vibratepattern(char *pattern, int level, int priority)
{
GVariant *msg;
int handle;
nanosleep(&time, NULL);
(haptic_vibratemonotone(300, 100, 0)) ? s++ : f++;
nanosleep(&time, NULL);
- (haptic_vibrateeffect("FEEDBACK_PATTERN_SIP", 100, 0)) ? s++ : f++;
+ (haptic_vibratepattern("FEEDBACK_PATTERN_SIP", 100, 0)) ? s++ : f++;
nanosleep(&time, NULL);
(haptic_getstate(0)) ? s++ : f++;
(haptic_showhandlelist()) ? s++ : f++;
time.tv_sec = 1 + (atoi(argv[2]) / 1000);
nanosleep(&time, NULL);
} else if (0 == strcasecmp(argv[1], METHOD_HAPTIC_VIBRATEEFFECT)) {
- haptic_vibrateeffect(argv[2], atoi(argv[3]), atoi(argv[4]));
+ haptic_vibratepattern(argv[2], atoi(argv[3]), atoi(argv[4]));
time.tv_sec = 2;
nanosleep(&time, NULL);
} else if (0 == strcasecmp(argv[1], METHOD_HAPTIC_GETSTATE)) {
guint id_watch;
};
-struct vibrate_effect_info {
+struct vibrate_pattern_info {
unsigned int handle;
char *pattern;
int level;
return G_SOURCE_REMOVE;
}
-static void vibrate_effect_idler_cb(void *data)
+static void vibrate_pattern_idler_cb(void *data)
{
- struct vibrate_effect_info *vibrate_info;
+ struct vibrate_pattern_info *vibrate_info;
dd_list *elem;
struct vibration_config *conf;
char pattern[PATH_MAX];
if (!data)
return;
- vibrate_info = (struct vibrate_effect_info *)data;
+ vibrate_info = (struct vibrate_pattern_info *)data;
if (!(vibrate_info->pattern)) {
free(vibrate_info);
free(vibrate_info);
}
-GVariant *hdbus_vibrate_effect(GDBusConnection *conn,
+GVariant *hdbus_vibrate_pattern(GDBusConnection *conn,
const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
{
- struct vibrate_effect_info *vibrate_info;
+ struct vibrate_pattern_info *vibrate_info;
unsigned int handle;
char *pattern = NULL;
int level, priority, ret = 0;
else if (priority > PRIORITY_TOP)
priority = PRIORITY_TOP;
- vibrate_info = calloc(1, sizeof(struct vibrate_effect_info));
+ vibrate_info = calloc(1, sizeof(struct vibrate_pattern_info));
if (!vibrate_info) {
_E("Failed to allocate memory for vibrate_info.");
ret = -errno;
vibrate_info->level = level;
vibrate_info->priority = priority;
- ret = add_idle_request(vibrate_effect_idler_cb, (void *)vibrate_info);
+ ret = add_idle_request(vibrate_pattern_idler_cb, (void *)vibrate_info);
exit:
g_free(pattern);
}
static const dbus_method_s hdbus_methods[] = {
- { "GetCount", NULL, "i", hdbus_get_count },
- { "OpenDevice", "i", "i", hdbus_open_device },
- { "CloseDevice", "u", "i", hdbus_close_device },
- { "StopDevice", "u", "i", hdbus_stop_device },
- { "VibrateMonotone", "uiii", "i", hdbus_vibrate_monotone },
- { "VibrateEffect", "usii", "i", hdbus_vibrate_effect },
+ { "GetCount", NULL, "i", hdbus_get_count }, // device_haptic_get_count
+ { "OpenDevice", "i", "i", hdbus_open_device }, // device_haptic_open, feedback_initialize
+ { "CloseDevice", "u", "i", hdbus_close_device }, // device_haptic_close, feedback_deinitialize
+ { "StopDevice", "u", "i", hdbus_stop_device }, // device_haptic_stop, feedback_stop
+ { "VibrateMonotone", "uiii", "i", hdbus_vibrate_monotone }, // device_haptic_vibrate
+ { "VibratePattern", "usii", "i", hdbus_vibrate_pattern }, // feedback_play*
{ "ShowHandleList", NULL, NULL, hdbus_show_handle_list },
- { "IsSupported", "s", "i", hdbus_pattern_is_supported },
+ { "IsSupported", "s", "i", hdbus_pattern_is_supported }, // feedback_is_supported_pattern
/* Add methods here */
};