4 * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jae-young Hwang <j-zero.hwang@samsung.com>
8 * PROPRIETARY/CONFIDENTIAL
10 * This software is the confidential and proprietary information of
11 * SAMSUNG ELECTRONICS ("Confidential Information"). You agree and acknowledge
12 * that this software is owned by Samsung and you shall not disclose
13 * such Confidential Information and shall use it only in accordance with the
14 * terms of the license agreement you entered into with SAMSUNG ELECTRONICS.
15 * SAMSUNG make no representations or warranties about the suitability
16 * of the software, either express or implied, including but not limited
17 * to the implied warranties of merchantability, fitness for a particular
19 * by licensee arising out of or releated to this software.
26 #include <sys/types.h>
32 #include <haptic_plugin_intf.h>
34 #define HAPTIC_MODULE_PATH "/usr/lib/libhaptic-module.so"
36 static void *dlopen_handle;
37 static const haptic_plugin_interface *plugin_intf;
44 dlopen_handle = dlopen(HAPTIC_MODULE_PATH, RTLD_NOW);
46 printf("fail dlopen\n");
47 printf("%s\n", dlerror());
51 const haptic_plugin_interface *(*get_haptic_plugin_interface) ();
52 get_haptic_plugin_interface = dlsym(dlopen_handle, "get_haptic_plugin_interface");
54 if ((error = dlerror()) != NULL) {
55 printf("dlsym error\n");
56 printf("%s\n", error);
57 dlclose(dlopen_handle);
61 plugin_intf = get_haptic_plugin_interface();
63 printf("plugin_intf error\n");
64 dlclose(dlopen_handle);
75 printf ("============================================\n");
76 printf ("haptic_internal_vibrate_monotone : a\n");
77 printf ("hatpic_internal_stop_all_effects : b\n");
78 printf ("Quit : z\n");
79 printf ("============================================\n");
81 status = scanf ("%c", &input);
87 status = scanf ("%d", &handle);
91 printf ("Duration : ");
92 status = scanf ("%d", &duration);
96 plugin_intf->haptic_internal_vibrate_monotone(handle, duration, HAPTIC_MODULE_FEEDBACK_MAX, HAPTIC_MODULE_PRIORITY_HIGH, &handle);
100 printf ("Handle : ");
101 status = scanf ("%d", &handle);
104 plugin_intf->haptic_internal_stop_all_effects(handle);
116 dlclose(dlopen_handle);