if (r < 0)
_I("already stopped or failed to stop effect : %d", r);
- /* unregister existing timer */
- if (r >= 0) {
- _D("device handle %d is closed and timer deleted", device_handle);
- if (stop_timer) {
- g_source_remove(stop_timer);
- stop_timer = 0;
- }
- }
-
- standard_vibrate_close();
-
DD_LIST_REMOVE(handle_list, (gpointer)(long)device_handle);
/* if it is the last element */
if (r < 0)
_I("already stopped or failed to stop effect : %d", r);
- /* unregister existing timer */
- if (r >= 0) {
- if (stop_timer) {
- //ecore_timer_del(stop_timer);
- g_source_remove(stop_timer);
- stop_timer = 0;
- }
- }
-
- standard_vibrate_close();
-
_D("handle %d is closed and timer deleted", handle);
DD_LIST_REMOVE(handle_list, (gpointer)(long)handle);
static char ff_path[PATH_MAX];
static int unique_number;
+static int stop_device(int device_handle);
struct ff_info *read_from_list(int handle)
{
struct ff_info *temp;
static int close_device(int device_handle)
{
struct ff_info *info;
- int r, n;
+ int n;
info = read_from_list(device_handle);
if (!info)
return -ENODEV;
/* stop vibration */
- r = ff_stop(ff_fd, &info->effect);
- if (r < 0)
- _I("already stopped or failed to stop effect : %d", r);
-
- /* unregister existing timer */
- if (r >= 0 && info->timer) {
- _D("device handle %d is closed and timer deleted", device_handle);
- g_source_remove(info->timer);
- info->timer = 0;
- }
-
- standard_vibrate_close();
+ stop_device(device_handle);
DD_LIST_REMOVE(handle_list, (gpointer)(long)info->handle);