libdeviced-haptic: Remove unused codes 80/171880/8 accepted/tizen/unified/20180316.062502 submit/tizen/20180315.052738
authorpr.jung <pr.jung@samsung.com>
Wed, 7 Mar 2018 10:45:21 +0000 (19:45 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 15 Mar 2018 03:22:20 +0000 (03:22 +0000)
- Remove unused logics and deprecated haptic internal apis

Change-Id: I2b992dbd193f9429b90fa56ef30e1afff9ffa648
Signed-off-by: pr.jung <pr.jung@samsung.com>
src/deviced/dd-haptic.h
src/deviced/haptic-module.h [deleted file]
src/deviced/haptic-plugin-intf.h [deleted file]
src/libdeviced/haptic.c

index 1f2f9fa..8b50a44 100644 (file)
@@ -195,257 +195,6 @@ int haptic_close(haptic_device_h device_handle);
 int haptic_vibrate_monotone(haptic_device_h device_handle, int duration, haptic_effect_h *effect_handle);
 
 /**
- * @brief Vibrates during the specified time with a constant intensity.
- * @details
- * This function can be used to start monotonous vibration for specified time.
- *
- * @remark
- * If you don't use th api regarding effect_handle, you can pass in a NULL value to last parameter.
- *
- * @param[in] device_handle     The device handle from haptic_open()
- * @param[in] duration          The play duration in milliseconds
- * @param[in] feedback          The amount of the intensity variation
- * @param[in] priority          The priority from HAPTIC_PRIORITY_MIN to HAPTIC_PRIORITY_HIGH
- * @param[out] effect_handle   Pointer to the variable that will receive a handle to the playing effect
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_vibrate_monotone()
- * @see haptic_vibrate_file_with_detail()
- * @see haptic_vibrate_buffer_with_detail()
- * @see haptic_get_count()
- */
-int haptic_vibrate_monotone_with_detail(haptic_device_h device_handle,
-                                                                               int duration,
-                                                                               haptic_feedback_e feedback,
-                                                                               haptic_priority_e priority,
-                                                                               haptic_effect_h *effect_handle);
-
-/**
- * @brief Vibrates a predefined rhythmic haptic-vibration pattern file.
- * @details
- * This function can be used to play a haptic-vibration pattern file.
- *
- * @remark
- * If you don't use th api regarding effect_handle, you can pass in a NULL value to last parameter.\n
- * And default value of feedback and priority is used.\n
- * feedback level is reserved for auto chaning to save variable in the settings.\n
- * priority level uses HAPTIC_PRIORITY_MIN.
- *
- * @param[in] device_handle     The device handle from haptic_open()
- * @param[in] file_path         Vibration pattern file with path
- * @param[out] effect_handle    Pointer to the variable that will receive a handle to the playing effect
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_vibrate_file_with_detail()
- * @see haptic_vibrate_monotone()
- * @see haptic_vibrate_buffer()
- * @see haptic_get_count()
- */
-int haptic_vibrate_file(haptic_device_h device_handle, const char *file_path, haptic_effect_h *effect_handle);
-
-/**
- * @brief Vibrates a predefined rhythmic haptic-vibration pattern file.
- * @details
- * This function can be used to play a haptic-vibration pattern file.
- *
- * @remark
- * If you don't use th api regarding effect_handle, you can pass in a NULL value to last parameter.
- *
- * @param[in] device_handle     The device handle from haptic_open()
- * @param[in] file_path         Vibration pattern file with path
- * @param[in] iteration         The number of times to repeat the effect
- * @param[in] feedback          The amount of the intensity variation
- * @param[in] priority          The priority from HAPTIC_PRIORITY_MIN to HAPTIC_PRIORITY_HIGH
- * @param[out] effect_handle   Pointer to the variable that will receive a handle to the playing effect
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_vibrate_file()
- * @see haptic_vibrate_monotone_with_detail()
- * @see haptic_vibrate_buffer_with_detail()
- * @see haptic_get_count()
- */
-int haptic_vibrate_file_with_detail(haptic_device_h device_handle,
-                                                                       const char *file_path,
-                                                                       haptic_iteration_e iteration,
-                                                                       haptic_feedback_e feedback,
-                                                                       haptic_priority_e priority,
-                                                                       haptic_effect_h *effect_handle);
-
-/**
- * @brief Vibrates a predefined rhythmic haptic-vibration pattern buffer.
- * @details
- * This function can be used to play a haptic-vibration pattern buffer.
- *
- * @remark
- * If you don't use th api regarding effect_handle, you can pass in a NULL value to last parameter.\n
- * And default value of feedback and priority is used.\n
- * feedback level is reserved for auto chaning to save variable in the settings.\n
- * priority level uses HAPTIC_PRIORITY_MIN.
- *
- * @param[in] device_handle     The device handle from haptic_open()
- * @param[in] vibe_buffer       Pointer to the vibration pattern
- * @param[out] effect_handle    Pointer to the variable that will receive a handle to the playing effect
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_vibrate_buffer_with_detail()
- * @see haptic_vibrate_monotone()
- * @see haptic_vibrate_file()
- * @see haptic_get_count()
- */
-int haptic_vibrate_buffer(haptic_device_h device_handle, const unsigned char *vibe_buffer, haptic_effect_h *effect_handle);
-
-/**
- * @brief Vibrates a predefined rhythmic haptic-vibration pattern buffer.
- * @details
- * This function can be used to play a haptic-vibration pattern buffer.
- *
- * @remark
- * If you don't use th api regarding effect_handle, you can pass in a NULL value to last parameter.
- *
- * @param[in] device_handle     The device handle from haptic_open()
- * @param[in] vibe_buffer       Pointer to the vibration pattern
- * @param[in] iteration         The number of times to repeat the effect
- * @param[in] feedback          The amount of the intensity variation
- * @param[in] priority          The priority from HAPTIC_PRIORITY_MIN to HAPTIC_PRIORITY_HIGH
- * @param[out] effect_handle   Pointer to the variable that will receive a handle to the playing effect
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_vibrate_buffer()
- * @see haptic_vibrate_monotone_with_detail()
- * @see haptic_vibrate_file_with_detail()
- * @see haptic_get_count()
- */
-int haptic_vibrate_buffer_with_detail(haptic_device_h device_handle,
-                                                                         const unsigned char *vibe_buffer,
-                                                                         haptic_iteration_e iteration,
-                                                                         haptic_feedback_e feedback,
-                                                                         haptic_priority_e priority,
-                                                                         haptic_effect_h *effect_handle);
-
-/**
- * @brief Vibrates a predefined rhythmic haptic-vibration pattern buffer.
- * @details
- * This function can be used to play a haptic-vibration pattern buffer.
- *
- * @remark
- * If you don't use th api regarding effect_handle, you can pass in a NULL value to last parameter.\n
- * And default value of feedback and priority is used.\n
- * feedback level is reserved for auto chaning to save variable in the settings.\n
- * priority level uses HAPTIC_PRIORITY_MIN.
- *
- * @param[in] device_handle     The device handle from haptic_open()
- * @param[in] vibe_buffer       Pointer to the vibration pattern
- * @param[in] size              Size to the vibration pattern
- * @param[out] effect_handle    Pointer to the variable that will receive a handle to the playing effect
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_vibrate_buffer_with_detail()
- * @see haptic_vibrate_monotone()
- * @see haptic_vibrate_file()
- * @see haptic_get_count()
- */
-int haptic_vibrate_buffers(haptic_device_h device_handle,
-                                                       const unsigned char *vibe_buffer,
-                                                       int size,
-                                                       haptic_effect_h *effect_handle);
-
-/**
- * @brief Vibrates a predefined rhythmic haptic-vibration pattern buffer.
- * @details
- * This function can be used to play a haptic-vibration pattern buffer.
- *
- * @remark
- * If you don't use th api regarding effect_handle, you can pass in a NULL value to last parameter.
- *
- * @param[in] device_handle     The device handle from haptic_open()
- * @param[in] vibe_buffer       Pointer to the vibration pattern
- * @param[in] size              Size to the vibration pattern
- * @param[in] iteration         The number of times to repeat the effect
- * @param[in] feedback          The amount of the intensity variation
- * @param[in] priority          The priority from HAPTIC_PRIORITY_MIN to HAPTIC_PRIORITY_HIGH
- * @param[out] effect_handle   Pointer to the variable that will receive a handle to the playing effect
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_vibrate_buffer()
- * @see haptic_vibrate_monotone_with_detail()
- * @see haptic_vibrate_file_with_detail()
- * @see haptic_get_count()
- */
-int haptic_vibrate_buffers_with_detail(haptic_device_h device_handle,
-                               const unsigned char *vibe_buffer,
-                               int size,
-                               haptic_iteration_e iteration,
-                               haptic_feedback_e feedback,
-                               haptic_priority_e priority,
-                               haptic_effect_h *effect_handle);
-
-/**
- * @brief Stops the current vibration effect which is being played.
- * @details This function can be used to stop each effect started by haptic_vibrate_xxx().
- *
- * @remark
- *
- * @param[in] device_handle     The device handle from haptic_open()
- * @param[in] effect_handle     The effect handle from haptic_vibrate_xxx()
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_vibrate_buffer()
- * @see haptic_vibrate_monotone()
- * @see haptic_vibrate_file()
- * @see haptic_get_count()
- * @see haptic_stop_all_effects()
- */
-int haptic_stop_effect(haptic_device_h device_handle, haptic_effect_h effect_handle);
-
-/**
  * @brief Stops all vibration effects which are being played.
  * @details This function can be used to stop all effects started by haptic_vibrate_xxx().
  *
@@ -467,178 +216,6 @@ int haptic_stop_effect(haptic_device_h device_handle, haptic_effect_h effect_han
  * @see haptic_stop_effect()
  */
 int haptic_stop_all_effects(haptic_device_h device_handle);
-
-/**
- * @brief Gets the status of the effect.
- * @details This function can be used to get the status of the effect wheter the effect are playing or not.
- *
- * @remark
- *
- * @param[in] device_handle     The device handle from haptic_open()
- * @param[in] effect_handle     The effect handle from haptic_vibrate_xxx()
- * @param[out] state            The pointer to variable that will receive the status of the effect.
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_vibrate_buffer()
- * @see haptic_vibrate_monotone()
- * @see haptic_vibrate_file()
- * @see haptic_get_count()
- * @see haptic_stop_effect()
- * @see haptic_stop_all_effects()
- */
-int haptic_get_effect_state(haptic_device_h device_handle, haptic_effect_h effect_handle, haptic_state_e *state);
-
-/**
- * @par Description:
- *      effect element for haptic.
- */
-typedef struct {
-       int haptic_duration;    /**< Start time of the effect element in millisecond */
-       int haptic_level;       /**< Duration of the effect element in millisecond */
-} haptic_effect_element_s;
-
-/**
- * @brief Creates an effect buffer.
- * @details This function can be used to create an effect buffer using effeclt_element variable.
- *
- * @remark
- *
- * @param[out] vibe_buffer              Pointer to the vibration pattern
- * @param[in] max_bufsize               The size of the buffer pointed to by vibe_buffer
- * @param[in] elem_arr                  Pointer to an haptic_effect_element_s structure
- * @param[in] max_elemcnt               The size fo the buffer pointed to by elem_arr
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_save_effect()
- */
-int haptic_create_effect(unsigned char *vibe_buffer,
-                                                int max_bufsize,
-                                                haptic_effect_element_s *elem_arr,
-                                                int max_elemcnt);
-
-/**
- * @brief Save an effect buffer to the file.
- * @details This function can be used to save an effect buffer to the file using third parameter.
- *
- * @remark
- *
- * @param[in] vibe_buffer               Pointer to the vibration pattern
- * @param[in] max_bufsize               The size of the buffer pointed to by vibe_buffer
- * @param[in] file_path                 The pointer to the character buffer containing the path to save
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_FILE_EXISTS            File exists
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_create_effect()
- */
-int haptic_save_effect(const unsigned char *vibe_buffer,
-                                          int max_bufsize,
-                                          const char *file_path);
-
-/**
- * @brief Gets a duration time value from file.
- * @details This function can be used to get a duration time value from the file using second parameter.
- *
- * @remark
- *
- * @param[in] device_handle             The device handle from haptic_open()
- * @param[in] file_path                 The pointer to the character buffer containing the path to save
- * @param[out] duration                 The pointer to the duration time value
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_get_buffer_duration()
- */
-int haptic_get_file_duration(haptic_device_h device_handle, const char *file_path, int *duration);
-
-/**
- * @brief Gets a duration time value from buffer.
- * @details This function can be used to get a duration time value from the buffer using second parameter.
- *
- * @remark
- *
- * @param[in] device_handle             The device handle from haptic_open()
- * @param[in] vibe_buffer               Pointer to the vibration pattern buffer
- * @param[out] duration                 The pointer to the duration time value
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_get_file_duration()
- */
-int haptic_get_buffer_duration(haptic_device_h device_handle, const unsigned char *vibe_buffer, int *duration);
-
-/**
- * @brief Gets a duration time value from buffer.
- * @details This function can be used to get a duration time value from the buffer using second parameter.
- *
- * @remark
- *
- * @param[in] device_handle             The device handle from haptic_open()
- * @param[in] vibe_buffer               Pointer to the vibration pattern buffer
- * @param[in] size                      Size to the vibration pattern buffer
- * @param[out] buffer_duration          The pointer to the duration time value
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_get_file_duration()
- */
-int haptic_get_buffers_duration(haptic_device_h device_handle, const unsigned char *vibe_buffer, int size, int *buffer_duration);
-
-/**
- * @brief Save an effect buffer to the led file.
- * @details This function can be used to save an effect buffer to the led file which name is third parameter.
- *
- * @remark
- * Third parameter should be compatible with ledplayer file.
- *
- * @param[in] vibe_buffer               Pointer to the vibration pattern
- * @param[in] max_bufsize               The size of the buffer pointed to by vibe_buffer
- * @param[in] file_path                 The pointer to the character buffer containing the path to save
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #HAPTIC_ERROR_NONE                   Successful
- * @retval #HAPTIC_ERROR_INVALID_PARAMETER      Invalid parameter
- * @retval #HAPTIC_ERROR_NOT_INITIALIZED        Not initialized
- * @retval #HAPTIC_ERROR_FILE_EXISTS            File exists
- * @retval #HAPTIC_ERROR_OPERATION_FAILED       Operation failed
- * @retval #HAPTIC_ERROR_NOT_SUPPORTED_DEVICE   Not supported device
- *
- * @see haptic_save_effect()
- */
-int haptic_save_led(const unsigned char *vibe_buffer, int max_bufsize, const char *file_path);
-
 /**
  * @} end of CAPI_SYSTEM_DEVICED_HAPTIC_MODULE
  */
diff --git a/src/deviced/haptic-module.h b/src/deviced/haptic-module.h
deleted file mode 100644 (file)
index 449fdd2..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * deviced
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAPTIC_MODULE_H__
-#define __HAPTIC_MODULE_H__
-
-/**
- * @brief Enumerations of device id for the Haptic Module API.
- * @details We support two motors now.
- */
-typedef enum {
-       HAPTIC_MODULE_DEVICE_0 = 0x0,             /**< 1st motor */
-       HAPTIC_MODULE_DEVICE_1 = 0x1,             /**< 2nd motor */
-       HAPTIC_MODULE_DEVICE_ALL = 0x4,           /**< both of them */
-} haptic_module_device;
-
-/**
- * @brief Enumerations of priority level for the Haptic Module API.
- */
-typedef enum {
-       HAPTIC_MODULE_PRIORITY_MIN = 0,        /**< Minimum effect priority for developers (default) */
-       HAPTIC_MODULE_PRIORITY_MIDDLE,         /**< Maximum effect priority for developers */
-       HAPTIC_MODULE_PRIORITY_HIGH,           /**< Maximum effect priority for OEMs */
-} haptic_module_priority;
-
-/**
- * @brief Enumerations of feedback level for the Haptic Module API.
- * @details Haptic level means vibration power (intensity).
- */
-typedef enum {
-       HAPTIC_MODULE_FEEDBACK_MIN = 0,
-       HAPTIC_MODULE_FEEDBACK_MAX = 100,
-} haptic_module_feedback;
-
-/**
- * @brief Enumerations of unlimited duration for the Haptic Module API.
- */
-typedef enum {
-       HAPTIC_MODULE_DURATION_UNLIMITED = 0x7FFFFFFF,
-} haptic_module_duration;
-
-/**
- * @brief Enumerations of iteration count for the Haptic Module API.
- */
-typedef enum {
-       HAPTIC_MODULE_ITERATION_ONCE = 1,
-       HAPTIC_MODULE_ITERATION_INFINITE = 256,
-} haptic_module_iteration;
-
-/**
- * @brief Enumerations of effect or device state for the Haptic Module API.
- */
-typedef enum {
-       HAPTIC_MODULE_STATE_STOP = 0,
-       HAPTIC_MODULE_STATE_PLAYING,
-} haptic_module_state;
-
-/* Error and Return value codes */
-#define HAPTIC_MODULE_ERROR_NONE                                                0
-#define HAPTIC_MODULE_NOT_INITIALIZED                                          -1
-#define HAPTIC_MODULE_ALREADY_INITIALIZED                                      -2
-#define HAPTIC_MODULE_INVALID_ARGUMENT                                         -3
-#define HAPTIC_MODULE_OPERATION_FAILED                                         -4
-#define HAPTIC_MODULE_NOT_SUPPORTED                                            -5
-
-/**
- * @par Description:
- *      effect element for haptic module.
- */
-typedef struct {
-       int haptic_duration;           /**< Start time of the effect element in millisecond */
-       int haptic_level;        /**< Duration of the effect element in millisecond */
-} haptic_module_effect_element;
-
-#endif  /* __HAPTIC_MODULE_H__ */
diff --git a/src/deviced/haptic-plugin-intf.h b/src/deviced/haptic-plugin-intf.h
deleted file mode 100644 (file)
index 6fe854d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * deviced
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __HAPTIC_PLUGIN_INTF_H__
-#define __HAPTIC_PLUGIN_INTF_H__
-
-#include "haptic-module.h"
-
-struct haptic_plugin_ops {
-       int (*get_device_count) (int*);
-       int (*open_device) (int, int*);
-       int (*close_device) (int);
-       int (*vibrate_monotone) (int, int, int, int, int*);
-       int (*vibrate_buffer) (int, const unsigned char*, int, int, int, int*);
-       int (*vibrate_effect) (int, const char*, int, int);
-       int (*is_supported) (const char*);
-       int (*stop_device) (int);
-       int (*get_device_state) (int, int*);
-       int (*create_effect) (unsigned char*, int, haptic_module_effect_element*, int);
-       int (*get_buffer_duration) (int, const unsigned char*, int*);
-       int (*convert_binary) (const unsigned char*, int, const char*);
-};
-
-const struct haptic_plugin_ops *get_haptic_plugin_interface();
-
-#endif /* __HAPTIC_PLUGIN_INTF_H__ */
index 05daa2d..dcd8569 100644 (file)
 
 #include "log.h"
 #include "dbus.h"
-#include "haptic-plugin-intf.h"
 #include "dd-haptic.h"
 #include "common.h"
 
-#define METHOD_OPEN_DEVICE                     "OpenDevice"
-#define METHOD_CLOSE_DEVICE                    "CloseDevice"
-#define METHOD_STOP_DEVICE                     "StopDevice"
-#define METHOD_VIBRATE_MONOTONE                "VibrateMonotone"
-#define METHOD_VIBRATE_BUFFER          "VibrateBuffer"
-#define METHOD_GET_COUNT                       "GetCount"
-#define METHOD_GET_STATE                       "GetState"
-#define METHOD_GET_DURATION                    "GetDuration"
-#define METHOD_CREATE_EFFECT           "CreateEffect"
-#define METHOD_SAVE_BINARY                     "SaveBinary"
-
-#define TEMP_BUFFER_SIZE                       (64*1024)
-
-/* START of Static Function Section */
-static unsigned char *convert_file_to_buffer(const char *file_name, int *size)
-{
-       FILE *pf;
-       long file_size;
-       unsigned char *pdata = NULL;
-
-       if (!file_name)
-               return NULL;
-
-       /* Get File Stream Pointer */
-       pf = fopen(file_name, "rb");
-       if (!pf) {
-               _E("fopen failed : %d", errno);
-               return NULL;
-       }
-
-       if (fseek(pf, 0, SEEK_END))
-               goto error;
-
-       file_size = ftell(pf);
-       if (fseek(pf, 0, SEEK_SET))
-               goto error;
-
-       if (file_size < 0)
-               goto error;
-
-       pdata = (unsigned char *)malloc(file_size);
-       if (!pdata)
-               goto error;
-
-       if (fread(pdata, 1, file_size, pf) != file_size)
-               goto err_free;
-
-       fclose(pf);
-       *size = file_size;
-       return pdata;
-
-err_free:
-       free(pdata);
-
-error:
-       fclose(pf);
-
-       _E("failed to convert file to buffer (%d)", errno);
-       return NULL;
-}
-
-static int save_data(const unsigned char *data, int size, const char *file_path)
-{
-       FILE *file;
-       int fd;
-
-       file = fopen(file_path, "wb+");
-       if (file == NULL) {
-               _E("To open file is failed : %d", errno);
-               return -1;
-       }
-
-       if (fwrite(data, 1, size, file) != size) {
-               _E("To write file is failed : %d", errno);
-               fclose(file);
-               return -1;
-       }
-
-       fd = fileno(file);
-       if (fd < 0) {
-               _E("To get file descriptor is failed : %d", errno);
-               fclose(file);
-               return -1;
-       }
-
-       if (fsync(fd) < 0) {
-               _E("To be synchronized with the disk is failed : %d", errno);
-               fclose(file);
-               return -1;
-       }
-
-       fclose(file);
-       return 0;
-}
-
-static haptic_feedback_e convert_setting_to_module_level(void)
-{
-       int setting_fb_level;
-
-       if (vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &setting_fb_level) < 0)
-               setting_fb_level = SETTING_VIB_FEEDBACK_LEVEL3;
-
-       if (setting_fb_level < HAPTIC_FEEDBACK_0 || setting_fb_level > HAPTIC_FEEDBACK_5)
-               return -1;
-
-       switch (setting_fb_level) {
-       case SETTING_VIB_FEEDBACK_LEVEL0:
-               return HAPTIC_FEEDBACK_0;
-       case SETTING_VIB_FEEDBACK_LEVEL1:
-               return HAPTIC_FEEDBACK_1;
-       case SETTING_VIB_FEEDBACK_LEVEL2:
-               return HAPTIC_FEEDBACK_2;
-       case SETTING_VIB_FEEDBACK_LEVEL3:
-               return HAPTIC_FEEDBACK_3;
-       case SETTING_VIB_FEEDBACK_LEVEL4:
-               return HAPTIC_FEEDBACK_4;
-       case SETTING_VIB_FEEDBACK_LEVEL5:
-               return HAPTIC_FEEDBACK_5;
-       default:
-               break;
-       }
-       return -1;
-}
-/* END of Static Function Section */
-
 API int haptic_get_count(int *device_number)
 {
-       int ret;
-
-       /* check if pointer is valid */
-       if (device_number == NULL) {
-               _E("Invalid parameter : device_number(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* request to deviced to get haptic count */
-       ret = dbus_handle_method_sync(VIBRATOR_BUS_NAME,
-                               VIBRATOR_PATH_HAPTIC,
-                               VIBRATOR_INTERFACE_HAPTIC,
-                               METHOD_GET_COUNT,
-                               NULL,
-                               NULL);
-       if (ret < 0)
-               return HAPTIC_ERROR_OPERATION_FAILED;
-
-       *device_number = ret;
-       return HAPTIC_ERROR_NONE;
+       _E("Not Supported, Please use capi-system-device apis");
+       return HAPTIC_ERROR_OPERATION_FAILED;
 }
 
 API int haptic_open(haptic_device_e device_index, haptic_device_h *device_handle)
 {
-       int ret;
-
-       /* check if index is valid */
-       if (!(device_index == HAPTIC_DEVICE_0 || device_index == HAPTIC_DEVICE_1 ||
-                               device_index == HAPTIC_DEVICE_ALL)) {
-               _E("Invalid parameter : device_index(%d)", device_index);
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* check if pointer is valid */
-       if (device_handle == NULL) {
-               _E("Invalid parameter : device_handle(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* request to deviced to open haptic device */
-       ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
-                                       VIBRATOR_PATH_HAPTIC,
-                                       VIBRATOR_INTERFACE_HAPTIC,
-                                       METHOD_OPEN_DEVICE,
-                                       g_variant_new("(i)", device_index));
-       if (ret < 0)
-               return HAPTIC_ERROR_OPERATION_FAILED;
-
-       *device_handle = (haptic_device_h)ret;
-       return HAPTIC_ERROR_NONE;
+       _E("Not Supported, Please use capi-system-device apis");
+       return HAPTIC_ERROR_OPERATION_FAILED;
 }
 
 API int haptic_close(haptic_device_h device_handle)
 {
-       int ret;
-
-       /* check if handle is valid */
-       if (!device_handle) {
-               _E("Invalid parameter : device_handle");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* request to deviced to open haptic device */
-       ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
-                                       VIBRATOR_PATH_HAPTIC,
-                                       VIBRATOR_INTERFACE_HAPTIC,
-                                       METHOD_CLOSE_DEVICE,
-                                       g_variant_new("(u)", device_handle));
-       if (ret < 0)
-               return HAPTIC_ERROR_OPERATION_FAILED;
-
-       return HAPTIC_ERROR_NONE;
+       _E("Not Supported, Please use capi-system-device apis");
+       return HAPTIC_ERROR_OPERATION_FAILED;
 }
 
 API int haptic_vibrate_monotone(haptic_device_h device_handle, int duration, haptic_effect_h *effect_handle)
 {
-       return haptic_vibrate_monotone_with_detail(device_handle,
-                                                       duration,
-                                                       HAPTIC_FEEDBACK_AUTO,
-                                                       HAPTIC_PRIORITY_MIN,
-                                                       effect_handle);
-}
-
-API int haptic_vibrate_monotone_with_detail(haptic_device_h device_handle,
-                                               int duration,
-                                               haptic_feedback_e feedback,
-                                               haptic_priority_e priority,
-                                               haptic_effect_h *effect_handle)
-{
-       int ret;
-
-       /* check if handle is valid */
-       if (!device_handle) {
-               _E("Invalid parameter : device_handle");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* check if passed arguments are valid */
-       if (duration < 0 && duration != HAPTIC_DURATION_UNLIMITED) {
-               _E("Invalid parameter : duration(%d)", duration);
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (feedback < HAPTIC_FEEDBACK_0 || feedback > HAPTIC_FEEDBACK_AUTO) {
-               _E("Invalid parameter : feedback(%d)", feedback);
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (priority < HAPTIC_PRIORITY_MIN || priority > HAPTIC_PRIORITY_HIGH) {
-               _E("Invalid parameter : priority(%d)", priority);
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* in case of FEEDBACK_AUTO, should be converted */
-       if (feedback == HAPTIC_FEEDBACK_AUTO)
-               feedback = convert_setting_to_module_level();
-
-       /* request to deviced to open haptic device */
-       ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
-                                       VIBRATOR_PATH_HAPTIC,
-                                       VIBRATOR_INTERFACE_HAPTIC,
-                                       METHOD_VIBRATE_MONOTONE,
-                                       g_variant_new("(uiii)", device_handle, duration, feedback, priority));
-       if (ret < 0)
-               return HAPTIC_ERROR_OPERATION_FAILED;
-
-       if (effect_handle != NULL)
-               *effect_handle = (haptic_effect_h)ret;
-
-       return HAPTIC_ERROR_NONE;
-}
-
-API int haptic_vibrate_file(haptic_device_h device_handle, const char *file_path, haptic_effect_h *effect_handle)
-{
-       unsigned char *vibe_buffer;
-       int size, ret;
-
-       vibe_buffer = convert_file_to_buffer(file_path, &size);
-       if (!vibe_buffer) {
-               _E("Convert file to buffer error");
-               return HAPTIC_ERROR_OPERATION_FAILED;
-       }
-
-       ret = haptic_vibrate_buffers_with_detail(device_handle,
-                                               (const unsigned char *)vibe_buffer,
-                                               size,
-                                               HAPTIC_ITERATION_ONCE,
-                                               HAPTIC_FEEDBACK_AUTO,
-                                               HAPTIC_PRIORITY_MIN,
-                                               effect_handle);
-       free(vibe_buffer);
-       return ret;
-}
-
-API int haptic_vibrate_file_with_detail(haptic_device_h device_handle,
-                                       const char *file_path,
-                                       haptic_iteration_e iteration,
-                                       haptic_feedback_e feedback,
-                                       haptic_priority_e priority,
-                                       haptic_effect_h *effect_handle)
-{
-       unsigned char *vibe_buffer;
-       int size, ret;
-
-       vibe_buffer = convert_file_to_buffer(file_path, &size);
-       if (!vibe_buffer) {
-               _E("Convert file to buffer error");
-               return HAPTIC_ERROR_OPERATION_FAILED;
-       }
-
-       ret = haptic_vibrate_buffers_with_detail(device_handle,
-                                               (const unsigned char *)vibe_buffer,
-                                               size,
-                                               iteration,
-                                               feedback,
-                                               priority,
-                                               effect_handle);
-       free(vibe_buffer);
-       return ret;
-}
-
-API int haptic_vibrate_buffer(haptic_device_h device_handle, const unsigned char *vibe_buffer, haptic_effect_h *effect_handle)
-{
-       return haptic_vibrate_buffers_with_detail(device_handle,
-                                                       vibe_buffer,
-                                                       TEMP_BUFFER_SIZE,
-                                                       HAPTIC_ITERATION_ONCE,
-                                                       HAPTIC_FEEDBACK_AUTO,
-                                                       HAPTIC_PRIORITY_MIN,
-                                                       effect_handle);
-}
-
-API int haptic_vibrate_buffer_with_detail(haptic_device_h device_handle,
-                                       const unsigned char *vibe_buffer,
-                                       haptic_iteration_e iteration,
-                                       haptic_feedback_e feedback,
-                                       haptic_priority_e priority,
-                                       haptic_effect_h *effect_handle)
-{
-       return haptic_vibrate_buffers_with_detail(device_handle,
-                                                       vibe_buffer,
-                                                       TEMP_BUFFER_SIZE,
-                                                       iteration,
-                                                       feedback,
-                                                       priority,
-                                                       effect_handle);
-}
-
-API int haptic_vibrate_buffers(haptic_device_h device_handle,
-                               const unsigned char *vibe_buffer,
-                               int size,
-                               haptic_effect_h *effect_handle)
-{
-       return haptic_vibrate_buffers_with_detail(device_handle,
-                                                       vibe_buffer,
-                                                       size,
-                                                       HAPTIC_ITERATION_ONCE,
-                                                       HAPTIC_FEEDBACK_AUTO,
-                                                       HAPTIC_PRIORITY_MIN,
-                                                       effect_handle);
-}
-
-API int haptic_vibrate_buffers_with_detail(haptic_device_h device_handle,
-                                               const unsigned char *vibe_buffer,
-                                               int size,
-                                               haptic_iteration_e iteration,
-                                               haptic_feedback_e feedback,
-                                               haptic_priority_e priority,
-                                               haptic_effect_h *effect_handle)
-{
-       GVariant *pvar = NULL;
-       int ret;
-
-       /* check if handle is valid */
-       if (!device_handle) {
-               _E("Invalid parameter : device_handle");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* check if passed arguments are valid */
-       if (vibe_buffer == NULL) {
-               _E("Invalid parameter : vibe_buffer(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (iteration < HAPTIC_ITERATION_ONCE || iteration > HAPTIC_ITERATION_INFINITE) {
-               _E("Invalid parameter : iteration(%d)", iteration);
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (feedback < HAPTIC_FEEDBACK_0 || feedback > HAPTIC_FEEDBACK_AUTO) {
-               _E("Invalid parameter : feedback(%d)", feedback);
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (priority < HAPTIC_PRIORITY_MIN || priority > HAPTIC_PRIORITY_HIGH) {
-               _E("Invalid parameter : priority(%d)", priority);
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* in case of FEEDBACK_AUTO, should be converted */
-       if (feedback == HAPTIC_FEEDBACK_AUTO)
-               feedback = convert_setting_to_module_level();
-
-
-       /* request to deviced to open haptic device */
-       pvar = g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, vibe_buffer, size, sizeof(char));
-       ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
-                               VIBRATOR_PATH_HAPTIC,
-                               VIBRATOR_INTERFACE_HAPTIC,
-                               METHOD_VIBRATE_BUFFER,
-                               g_variant_new("(u@ayiii)", device_handle, pvar, iteration, feedback, priority));
-       if (ret < 0)
-               return HAPTIC_ERROR_OPERATION_FAILED;
-
-       if (effect_handle != NULL)
-               *effect_handle = (haptic_effect_h)ret;
-
-       return HAPTIC_ERROR_NONE;
-}
-
-API int haptic_stop_effect(haptic_device_h device_handle, haptic_effect_h effect_handle)
-{
-       return haptic_stop_all_effects(device_handle);
+       _E("Not Supported, Please use capi-system-device apis");
+       return HAPTIC_ERROR_OPERATION_FAILED;
 }
 
 API int haptic_stop_all_effects(haptic_device_h device_handle)
 {
-       int ret;
-
-       /* check if handle is valid */
-       if (!device_handle) {
-               _E("Invalid parameter : device_handle");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* request to deviced to open haptic device */
-       ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
-                                       VIBRATOR_PATH_HAPTIC,
-                                       VIBRATOR_INTERFACE_HAPTIC,
-                                       METHOD_STOP_DEVICE,
-                                       g_variant_new("(u)", device_handle));
-       if (ret < 0)
-               return HAPTIC_ERROR_OPERATION_FAILED;
-
-       return HAPTIC_ERROR_NONE;
-}
-
-API int haptic_get_effect_state(haptic_device_h device_handle, haptic_effect_h effect_handle, haptic_state_e *effect_state)
-{
-       int ret;
-
-       /* check if handle is valid */
-       if (!device_handle) {
-               _E("Invalid parameter : device_handle");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* check if pointer is valid */
-       if (effect_state == NULL) {
-               _E("Invalid parameter : effect_state(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* request to deviced to open haptic device */
-       ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
-                                       VIBRATOR_PATH_HAPTIC,
-                                       VIBRATOR_INTERFACE_HAPTIC,
-                                       METHOD_GET_STATE,
-                                       g_variant_new("(i)", HAPTIC_DEVICE_0));
-       if (ret < 0)
-               return HAPTIC_ERROR_OPERATION_FAILED;
-
-       *effect_state = (haptic_state_e)ret;
-       return HAPTIC_ERROR_NONE;
-}
-
-API int haptic_create_effect(unsigned char *vibe_buffer,
-                               int max_bufsize,
-                               haptic_effect_element_s *elem_arr,
-                               int max_elemcnt)
-{
-       GVariant *msg;
-       GVariant *pvar = NULL;
-       const char *data = NULL;
-       int i, temp, ret_val;
-       gsize size;
-
-       /* check if passed arguments are valid */
-       if (vibe_buffer == NULL) {
-               _E("Invalid parameter : vibe_buffer(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (max_bufsize <= 0) {
-               _E("Invalid parameter : max_bufsize(%d)", max_bufsize);
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (elem_arr == NULL) {
-               _E("Invalid parameter : elem_arr(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (max_elemcnt <= 0) {
-               _E("Invalid parameter : max_elemcnt(%d)", max_elemcnt);
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* convert to proper feedback level in case of auto */
-       for (i = 0; i < max_elemcnt; i++) {
-               if (elem_arr[i].haptic_level == HAPTIC_FEEDBACK_AUTO) {
-                       vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &temp);
-                       elem_arr[i].haptic_level = temp*20;
-               }
-       }
-
-       pvar = g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, elem_arr, sizeof(haptic_effect_element_s) * max_elemcnt, sizeof(char));
-       msg = dbus_handle_method_sync_with_reply_var(VIBRATOR_BUS_NAME,
-                                               VIBRATOR_PATH_HAPTIC,
-                                               VIBRATOR_INTERFACE_HAPTIC,
-                                               METHOD_CREATE_EFFECT,
-                                               g_variant_new("(i@ayi)", max_bufsize, pvar, max_elemcnt));
-       if (!msg)
-               return HAPTIC_ERROR_OPERATION_FAILED;
-
-       if (!dh_get_param_from_var(msg, "(@ayi)", &pvar, &ret_val)) {
-               _E("no message [%s]", g_variant_get_type_string(msg));
-               goto err;
-       }
-       if (ret_val < 0) {
-               _E("%s-%s failed : %d", VIBRATOR_INTERFACE_HAPTIC, METHOD_CREATE_EFFECT, ret_val);
-               goto err;
-       }
-
-       data = g_variant_get_fixed_array(pvar, &size, sizeof(char));
-       g_variant_unref(pvar);
-
-       if (max_bufsize < size) {
-               _E("max_bufsize(%d) is smaller than effect buffer size(%d)", max_bufsize, size);
-               goto err;
-       }
-
-       memcpy(vibe_buffer, data, max_bufsize);
-       g_variant_unref(msg);
-       return HAPTIC_ERROR_NONE;
-err:
-       g_variant_unref(msg);
+       _E("Not Supported, Please use capi-system-device apis");
        return HAPTIC_ERROR_OPERATION_FAILED;
-}
-
-API int haptic_save_effect(const unsigned char *vibe_buffer,
-                       int max_bufsize,
-                       const char *file_path)
-{
-       struct stat buf;
-       int ret;
-
-       /* check if passed arguments are valid */
-       if (vibe_buffer == NULL) {
-               _E("Invalid parameter : vibe_buffer(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (max_bufsize <= 0) {
-               _E("Invalid parameter : max_bufsize(%d)", max_bufsize);
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (file_path == NULL) {
-               _E("Invalid parameter : file_path(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* check if the file already exists */
-       if (!stat(file_path, &buf)) {
-               _E("Already exist : file_path(%s)", file_path);
-               return HAPTIC_ERROR_FILE_EXISTS;
-       }
-
-       _D("file path : %s", file_path);
-       ret = save_data(vibe_buffer, max_bufsize, file_path);
-       if (ret < 0) {
-               _E("fail to save data");
-               return HAPTIC_MODULE_OPERATION_FAILED;
-       }
-
-       return HAPTIC_ERROR_NONE;
-}
-
-API int haptic_get_file_duration(haptic_device_h device_handle, const char *file_path, int *file_duration)
-{
-       unsigned char *vibe_buffer;
-       int size, ret;
-
-       vibe_buffer = convert_file_to_buffer(file_path, &size);
-       if (!vibe_buffer) {
-               _E("Convert file to buffer error");
-               return HAPTIC_ERROR_OPERATION_FAILED;
-       }
-
-       ret = haptic_get_buffers_duration(device_handle,
-                                       (const unsigned char *)vibe_buffer,
-                                       size,
-                                       file_duration);
-       free(vibe_buffer);
-       return ret;
-}
-
-API int haptic_get_buffer_duration(haptic_device_h device_handle, const unsigned char *vibe_buffer, int *buffer_duration)
-{
-       return haptic_get_buffers_duration(device_handle,
-                                       vibe_buffer,
-                                       TEMP_BUFFER_SIZE,
-                                       buffer_duration);
-}
-
-API int haptic_get_buffers_duration(haptic_device_h device_handle, const unsigned char *vibe_buffer, int size, int *buffer_duration)
-{
-       GVariant *pvar = NULL;
-       int ret;
-
-       /* check if handle is valid */
-       if (!device_handle) {
-               _E("Invalid parameter : device_handle");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (vibe_buffer == NULL) {
-               _E("Invalid parameter : vibe_buffer(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* check if pointer is valid */
-       if (buffer_duration == NULL) {
-               _E("Invalid parameter : buffer_duration(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* request to deviced to open haptic device */
-       pvar = g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, vibe_buffer, size, sizeof(char));
-       ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
-                                       VIBRATOR_PATH_HAPTIC,
-                                       VIBRATOR_INTERFACE_HAPTIC,
-                                       METHOD_GET_DURATION,
-                                       g_variant_new("(u@ay)", device_handle, pvar));
-       if (ret < 0)
-               return HAPTIC_ERROR_OPERATION_FAILED;
-
-       *buffer_duration = ret;
-       return HAPTIC_ERROR_NONE;
-}
-
-API int haptic_save_led(const unsigned char *vibe_buffer, int max_bufsize, const char *file_path)
-{
-       GVariant *pvar = NULL;
-       struct stat buf;
-       int ret;
-
-       /* check if passed arguments are valid */
-       if (vibe_buffer == NULL) {
-               _E("Invalid parameter : vibe_buffer(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (max_bufsize <= 0) {
-               _E("Invalid parameter : max_bufsize(%d)", max_bufsize);
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       if (file_path == NULL) {
-               _E("Invalid parameter : file_path(NULL)");
-               return HAPTIC_ERROR_INVALID_PARAMETER;
-       }
-
-       /* check if the file already exists */
-       if (!stat(file_path, &buf)) {
-               _E("Already exist : file_path(%s)", file_path);
-               return HAPTIC_ERROR_FILE_EXISTS;
-       }
-
-       /* request to deviced to open haptic device */
-       pvar = g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, vibe_buffer, max_bufsize, sizeof(char));
-       ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
-                                       VIBRATOR_PATH_HAPTIC,
-                                       VIBRATOR_INTERFACE_HAPTIC,
-                                       METHOD_SAVE_BINARY,
-                                       g_variant_new("(@ays)", pvar, file_path));
-       if (ret < 0)
-               return HAPTIC_ERROR_OPERATION_FAILED;
-
-       return HAPTIC_ERROR_NONE;
-}
+}
\ No newline at end of file