[ACR-1232][voice-control][Add] Add APIs for VCE 27/181427/2 accepted/tizen/unified/20180615.160521 submit/tizen/20180615.005858 submit/tizen/20180615.065647
authorsooyeon.kim <sooyeon.kim@samsung.com>
Thu, 7 Jun 2018 02:30:06 +0000 (11:30 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Thu, 14 Jun 2018 23:28:14 +0000 (23:28 +0000)
Change-Id: Ic39e01b23aa231f88d1e1a70aedf5f8d35220323
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
include/vce.h
server/vce.c

index c735acd..e5d917f 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
 
 /**
 * @brief Enumerations of error codes.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 typedef enum {
        VCE_ERROR_NONE                  = TIZEN_ERROR_NONE,             /**< Successful */
@@ -50,7 +50,7 @@ typedef enum {
 
 /**
 * @brief Enumerations of audio type.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 typedef enum {
        VCE_AUDIO_TYPE_PCM_S16_LE = 0,  /**< Signed 16bit audio type, Little endian */
@@ -59,7 +59,7 @@ typedef enum {
 
 /**
 * @brief Enumerations of callback event.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 typedef enum {
        VCE_RESULT_EVENT_SUCCESS = 0,           /**< Event when the recognition full result is ready  */
@@ -69,7 +69,7 @@ typedef enum {
 
 /**
 * @brief Enumerations of command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 typedef enum {
        VCE_COMMAND_FORMAT_FIXED = 0,                   /**< Fixed command */
@@ -83,7 +83,7 @@ typedef enum {
 
 /**
 * @brief Enumerations of speech detect.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 typedef enum {
     VCE_SPEECH_DETECT_NONE = 0,        /**< No event */
@@ -93,7 +93,7 @@ typedef enum {
 
 /**
 * @brief Enumerations of ASR result events.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 typedef enum {
     VCE_ASR_RESULT_EVENT_FINAL_RESULT = 0, /**< Event when the ASR result is last data or ASR result is only one result */
@@ -102,8 +102,8 @@ typedef enum {
 } vce_asr_result_event_e;
 
 /**
- * @brief Enumerations of audio channels
- * @since_tizen 5.0
+ * @brief Enumerations of audio channels.
+ * @since_tizen 4.0
  */
 typedef enum {
        VCE_AUDIO_CHANNEL_MONO = 0,     /**< 1 channel, mono */
@@ -111,8 +111,8 @@ typedef enum {
 } vce_audio_channel_e;
 
 /**
- * @brief Enumeration for TTS feedback events
- * @since_tizen 5.0
+ * @brief Enumeration for TTS feedback events.
+ * @since_tizen 4.0
  */
 typedef enum {
        VCE_FEEDBACK_EVENT_FAIL = -1,    /**< Failed */
@@ -124,74 +124,74 @@ typedef enum {
 
 /**
 * @brief A structure of handle for VC command.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 typedef struct vce_cmd_s* vce_cmd_h;
 
 /**
 * @brief Definition for foreground command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 #define VCE_COMMAND_TYPE_FOREGROUND    1
 
 /**
 * @brief Definition for background command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 #define VCE_COMMAND_TYPE_BACKGROUND    2
 
 /**
 * @brief Definition for widget command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 #define VCE_COMMAND_TYPE_WIDGET                3
 
 /**
 * @brief Definition for system command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 #define VCE_COMMAND_TYPE_SYSTEM                4
 
 /**
 * @brief Definition for system background command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 #define VCE_COMMAND_TYPE_SYSTEM_BACKGROUND     5
 
 /**
 * @brief Definitions for exclusive command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 #define VCE_COMMAND_TYPE_EXCLUSIVE     6
 
 /**
 * @brief Definition of bluetooth audio id.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 #define VCE_AUDIO_ID_BLUETOOTH         "VC_AUDIO_ID_BLUETOOTH"         /**< Bluetooth audio id */
 
 /**
 * @brief Definition of Wi-Fi audio id.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 #define VCE_AUDIO_ID_WIFI              "VC_AUDIO_ID_WIFI"              /**< Wi-Fi audio id */
 
 /**
 * @brief Definition for none message.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 #define VC_RESULT_MESSAGE_NONE                 "vc.result.message.none"
 
 /**
 * @brief Definition for failed recognition because the speech is too loud to listen.
-* @since_tizen 5.0
+* @since_tizen 4.0
 */
 #define VC_RESULT_MESSAGE_ERROR_TOO_LOUD       "vc.result.message.error.too.loud"
 
 /**
 * @brief Called when VC engine informs the engine service user about whole supported languages.
 * @details This callback function is implemented by the engine service user. Therefore, the engine developer does NOT have to implement this callback function.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks This callback function is called by vce_foreach_supported_languages_cb() to retrieve the whole supported language list.
 *          The @a user_data must be transferred from vce_foreach_supported_languages_cb().
 *          The @a language can be used only in the callback. To use outside, make a copy.
@@ -206,7 +206,7 @@ typedef bool (*vce_supported_language_cb)(const char* language, void* user_data)
 
 /**
 * @brief Called when the engine service user initializes Voice Control (VC) engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks This callback function is mandatory and must be registered using vce_main().
 * @return 0 on success, otherwise a negative error value
 * @retval #VCE_ERROR_NONE Successful
@@ -219,7 +219,7 @@ typedef int (*vce_initialize_cb)(void);
 
 /**
 * @brief Called when the engine service user deinitializes VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks This callback function is mandatory and must be registered using vce_main().
 * @return 0 on success, otherwise a negative error value
 * @retval #VCE_ERROR_NONE Successful
@@ -230,9 +230,12 @@ typedef int (*vce_deinitialize_cb)(void);
 
 /**
 * @brief Called when the engine service user requests the recording format of VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks This callback function is mandatory and must be registered using vce_main().
 *          The @a audio_id can be used only in the callback. To use outside, make a copy.
+*          The @a types is managed by the platform and will be released when this callback function is completed.
+*          The @a rate is managed by the platform and will be released when this callback function is completed.
+*          The @a channels is managed by the platform and will be released when this callback function is completed.
 * @param[in] audio_id The audio device id. (e.g. #VCE_AUDIO_ID_BLUETOOTH or #VCE_AUDIO_ID_WIFI)
 * @param[out] types The format used by the recorder.
 * @param[out] rate The sample rate used by the recorder.
@@ -245,7 +248,7 @@ typedef int (*vce_get_recording_format_cb)(const char* audio_id, vce_audio_type_
 
 /**
 * @brief Called when the engine service user retrieves all supported languages of VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks This callback function is mandatory and must be registered using vce_main().
 * @param[in] callback a callback function
 * @param[in] user_data The user data to be passed to the callback function
@@ -261,7 +264,7 @@ typedef int (*vce_foreach_supported_languages_cb)(vce_supported_language_cb call
 
 /**
 * @brief Called when the engine service user checks whether a language is supported or not.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks This callback function is mandatory and must be registered using vce_main().
 *          The @a language can be used only in the callback. To use outside, make a copy.
 * @param[in] language A language
@@ -271,7 +274,7 @@ typedef bool (*vce_is_language_supported_cb)(const char* language);
 
 /**
 * @brief Called when the engine service user sets language.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks The @a language can be used only in the callback. To use outside, make a copy.
 * @param[in] language A language.
 * @return 0 on success, otherwise a negative error value
@@ -284,8 +287,10 @@ typedef int (*vce_set_language_cb)(const char* language);
 
 /**
 * @brief Called when the engine service user sets command list before recognition.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks This function should set commands via vcd_foreach_command().
+*          The @a vc_command should not be released.
+*          The @a vc_command can be used only in the callback. To use outside, make a copy.
 * @param[in] vc_command command handle. The @a vc_command can be used only in the callback. To use outside, make a copy.
 * @return 0 on success, otherwise a negative error value
 * @retval #VCE_ERROR_NONE Successful
@@ -303,7 +308,7 @@ typedef int (*vce_set_commands_cb)(vce_cmd_h vc_command);
 
 /**
 * @brief Called when the engine service user unsets command list for reset.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @return 0 on success, otherwise a negative error value
 * @retval #VCE_ERROR_NONE Successful
 * @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
@@ -316,7 +321,7 @@ typedef int (*vce_unset_commands_cb)(void);
 
 /**
 * @brief Called when the engine service user starts recognition.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks This callback function is mandatory and must be registered using vce_main().
 * @param[in] stop_by_silence Silence detection option.
 *                   @c true to detect the silence,
@@ -337,9 +342,10 @@ typedef int (*vce_start_cb)(bool stop_by_silence);
 
 /**
 * @brief Called when the engine service user sets recording data for speech recognition from recorder.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks This function should be returned immediately after recording data copy.
 *          The @a data can be used only in the callback. To use outside, make a copy.
+*          The @a speech_detected should not be released. This is managed by the platform.
 * @param[in] data A recording data
 * @param[in] length A length of recording data
 * @param[out] speech_detected The status of speech (e.g. #VCE_SPEECH_DETECT_BEGIN or #VCE_SPEECH_DETECT_END). The @a speech_detected can be used only in the callback. To use outside, make a copy.
@@ -357,7 +363,7 @@ typedef int(*vce_set_recording_data_cb)(const void* data, unsigned int length, v
 
 /**
 * @brief Called when the engine service user stops to get the result of recognition.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @return 0 on success, otherwise a negative error value
 * @retval #VCE_ERROR_NONE Successful
 * @retval #VCE_ERROR_INVALID_STATE Invalid state
@@ -373,7 +379,7 @@ typedef int (*vce_stop_cb)(void);
 
 /**
 * @brief Called when the engine service user cancels the recognition process.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @return 0 on success, otherwise a negative error value.
 * @retval #VCE_ERROR_NONE Successful.
 * @retval #VCE_ERROR_INVALID_STATE Invalid state.
@@ -385,8 +391,8 @@ typedef int (*vce_cancel_cb)(void);
 
 /**
 * @brief Called when the engine service user sets audio recording type.
-* @since_tizen 5.0
-* @remarks The @a audio can be used only in the callback. To use outside, make a copy.
+* @since_tizen 4.0
+* @remarks The @a audio_type can be used only in the callback. To use outside, make a copy.
 * @param[in] audio_type Current audio type (e.g. #VCE_AUDIO_ID_BLUETOOTH or #VCE_AUDIO_ID_WIFI)
 * @return 0 on success, otherwise a negative error value.
 * @retval #VCE_ERROR_NONE Successful.
@@ -396,7 +402,7 @@ typedef int (*vce_set_audio_type_cb)(const char* audio_type);
 
 /**
 * @brief Called when the engine service user sets app id which is want to ask server dialog.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks The @a app_id and @a credential can be used only in the callback. To use outside, make a copy.
 * @param[in] app_id App id which is to want to ask server dialog.
 * @param[in] credential Credential key.
@@ -409,7 +415,7 @@ typedef int (*vce_set_server_dialog_cb)(const char* app_id, const char* credenti
 
 /**
 * @brief Called when the engine service user sets domain (agent or device type).
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks The @a domain can be used only in the callback. To use outside, make a copy.
 * @param[in] domain Agent (e.g. "music", "news", etc) or device type (e.g. "tv", "mobile", etc) corresponding to the command
 * @return 0 on success, otherwise a negative error value.
@@ -420,8 +426,9 @@ typedef int (*vce_set_domain_cb)(const char* domain);
 
 /**
 * @brief Called when the engine service user requests essential value from NLU result.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks The @a key can be used only in the callback. To use outside, make a copy.
+*          The @a value is managed by the platform and will be released when this callback function is completed.
 * @param[in] key NLU base info key.
 * @param[out] value NLU base info value.
 * @return 0 on success, otherwise a negative error value.
@@ -432,7 +439,10 @@ typedef int (*vce_nlu_base_info_requested_cb)(const char* key, char** value);
 
 /**
 * @brief Called when client gets the specific engine's request from the engine service user.
-* @since_tizen 5.0
+* @since_tizen 4.0
+* @remarks The @a engine_app_id is managed by the platform and will be released when this callback function is completed.
+*          The @a event is managed by the platform and will be released when this callback function is completed.
+*          The @a request is managed by the platform and will be released when this callback function is completed.
 *
 * @param[in] engine_app_id The specific engine's app id
 * @param[in] event The specific engine event type
@@ -452,7 +462,7 @@ typedef int (*vce_specific_engine_request_cb)(const char* engine_app_id, const c
 
 /**
 * @brief Called when the engine service user sets private data between app and engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks The @a key, @a data can be used only in the callback. To use outside, make a copy.
 * @param[in] key Private key.
 * @param[in] data Private data.
@@ -464,8 +474,9 @@ typedef int (*vce_private_data_set_cb)(const char* key, const char* data);
 
 /**
 * @brief Called when the engine service user requests private data between app and engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks The @a key can be used only in the callback. To use outside, make a copy.
+*          The @a data is managed by the platform and will be released when this callback function is completed.
 * @param[in] key Private key.
 * @param[out] data Private data.
 * @return 0 on success, otherwise a negative error value.
@@ -476,7 +487,7 @@ typedef int (*vce_private_data_requested_cb)(const char* key, char** data);
 
 /**
 * @brief Called when the engine service user requests process text.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks The @a text can be used only in the callback. To use outside, make a copy.
 * @param[in] text Requested text
 * @return 0 on success, otherwise a negative error value.
@@ -487,7 +498,7 @@ typedef int (*vce_process_text_cb)(const char* text);
 
 /**
 * @brief Called when the engine service user requests list event.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks The @a event can be used only in the callback. To use outside, make a copy.
 * @param[in] event Requested list event
 * @return 0 on success, otherwise a negative error value.
@@ -498,7 +509,7 @@ typedef int (*vce_process_list_event_cb)(const char* event);
 
 /**
 * @brief Called when the engine service user requests haptic event.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks The @a event can be used only in the callback. To use outside, make a copy.
 * @param[in] event Requested haptic event
 * @return 0 on success, otherwise a negative error value.
@@ -509,9 +520,12 @@ typedef int (*vce_process_haptic_event_cb)(const char* event);
 
 /**
 * @brief Called when the engine service user requests the base information of VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks This callback function is mandatory and must be registered using vce_main().
-*          The allocated @a engine_uuid, @a engine_name, and @a engine_settings_app_id will be released internally.
+*          The @a engine_uuid is managed by the platform and will be released when this callback function is completed.
+*          The @a engine_name is managed by the platform and will be released when this callback function is completed.
+*          The @a engine_settings_app_id is managed by the platform and will be released when this callback function is completed.
+*          The @a use_network is managed by the platform and will be released when this callback function is completed.
 *          In order to upload the engine to Tizen Appstore, both the service app and the UI app (engine settings) are necessary.
 *          Therefore, @a engine_settings_app_id should be set to the application ID of the UI application.
 *          If there is no UI application, then @a engine_settings_app_id should be set to NULL.
@@ -528,7 +542,7 @@ typedef int (*vce_get_info_cb)(char** engine_uuid, char** engine_name, char** en
 
 /**
 * @brief Called to retrieve the commands.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks The @a command, @a param can be used only in the callback. To use outside, make a copy.
 * @param[in] id command id
 * @param[in] type command type
@@ -547,7 +561,7 @@ typedef bool (*vce_command_cb)(int id, int type, int format, const char* command
 /**
 * @brief A structure for the VC engine functions.
 * @details This structure contains essential callback functions for operating VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks These functions ar mandatory for operating VC engine. Therefore, all functions MUST be implemented.
 */
 typedef struct {
@@ -582,16 +596,16 @@ typedef struct {
        vce_process_haptic_event_cb                     process_haptic_event;   /**< Request to process haptic event */
 
        /* Optional callbacks */
-       vce_private_data_set_cb                         private_data_set;
+       vce_private_data_set_cb                         private_data_set;
        vce_private_data_requested_cb           private_data_request;
        vce_nlu_base_info_requested_cb          nlu_base_info_request;
        vce_specific_engine_request_cb          specific_engine_request;
 } vce_request_callback_s;
 
 /**
-* @brief Main function for Voice Control (VC) engine.
+* @brief Starts the main function for Voice Control (VC) engine.
 * @details This function is the main function for operating VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @privlevel public
 * @privilege %http://tizen.org/privilege/recorder
 * @remarks The service_app_main() should be used for working the engine after this function.
@@ -701,7 +715,7 @@ int vce_main(int argc, char** argv, vce_request_callback_s* callback);
 
 /**
 * @brief Sends the results to the engine service user.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @param[in] event A result event
 * @param[in] result_id Result ids
 * @param[in] count Result count
@@ -718,14 +732,14 @@ int vce_main(int argc, char** argv, vce_request_callback_s* callback);
 * @retval #VCE_ERROR_INVALID_STATE Invalid state
 * @retval #VCE_ERROR_OPERATION_FAILED Operation failure
 * @pre The vce_main() function should be invoked before this function is called.
-*              vce_stop_cb() will invoke this callback.
+*      vce_stop_cb() will invoke this callback.
 * @see vce_stop_cb()
 */
 int vce_send_result(vce_result_event_e event, int* result_id, int count, const char* all_result, const char* non_fixed_result, const char* nlu_result, const char* msg, int* user_info, void* user_data);
 
 /**
 * @brief Sends the ASR result to the engine service user.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @param[in] event A asr result event
 * @param[in] asr_result A asr result text
 * @param[in] user_data The user data passed from the start
@@ -741,7 +755,7 @@ int vce_send_asr_result(vce_asr_result_event_e event, const char* asr_result, vo
 
 /**
 * @brief Sends the NLG (Natural Language Generation) result to the engine service user.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @param[in] nlg_result A nlg result
 * @param[in] user_data The user data passed from the start
 * @return @c 0 on success, otherwise a negative error value
@@ -756,12 +770,12 @@ int vce_send_nlg_result(const char* nlg_result, void* user_data);
 
 /**
 * @brief Sends the specific engine result to the engine service user.
-* @since_tizen 5.0
+* @since_tizen 4.0
 *
 * @param[in] engine_app_id A specific engine's app id
 * @param[in] event A specific engine result event
 * @param[in] result A specific engine result text
-* @param[in] user_data The user data passed from the start
+* @param[in] user_info The user info passed from the start
 *
 * @return 0 on success, otherwise a negative error value
 * @retval #VCE_ERROR_NONE Successful
@@ -787,7 +801,7 @@ int vce_send_specific_engine_result(const char* engine_app_id, const char* event
 *          #VCE_ERROR_OPERATION_FAILED, \n
 *          #VCE_ERROR_PERMISSION_DENIED, \n
 *          #VCE_ERROR_NOT_SUPPORTED_FEATURE.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @param[in] error Error type
 * @param[in] msg Error message
 * @param[in] user_data The user data passed from set callback function
@@ -802,7 +816,7 @@ int vce_send_error(vce_error_e error, const char* msg, void* user_data);
 
 /**
 * @brief Sets a callback function for setting the private data to the engine service.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @privlevel public
 * @privilege %http://tizen.org/privilege/recorder
 * @remarks The vce_private_data_set_cb() function is called when the engine service user sets the private data to the engine service.
@@ -821,7 +835,7 @@ int vce_set_private_data_set_cb(vce_private_data_set_cb callback_func);
 
 /**
 * @brief Sets a callback function for requesting the private data to the engine service.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @privlevel public
 * @privilege %http://tizen.org/privilege/recorder
 * @remarks The vce_private_data_requested_cb() function is called when the engine service user requests the private data to the engine service.
@@ -838,7 +852,7 @@ int vce_set_private_data_requested_cb(vce_private_data_requested_cb callback_fun
 
 /**
 * @brief Sets a callback function for requesting the NLU base information to the engine service.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @remarks The vce_nlu_base_info_requested_cb() function is called when the engine service user requests the NLU base information to the engine service.
 * @param[in] callback_func vce_nlu_base_info_requested event callback function
 * @return @c 0 on success, otherwise a negative error value
@@ -851,16 +865,14 @@ int vce_set_private_data_requested_cb(vce_private_data_requested_cb callback_fun
 int vce_set_nlu_base_info_requested_cb(vce_nlu_base_info_requested_cb callback_func);
 
 /**
-* @brief Registers a callback function for getting the engine service request.
-* @since_tizen 5.0
+* @brief Sets a callback function for getting the engine service request.
+* @since_tizen 4.0
 *
-* @param[in] callback Callback function to register
-* @param[in] user_data The user data to be passed to the callback function
+* @param[in] callback_func Callback function to register
 *
 * @return 0 on success, otherwise a negative error value
 * @retval #VCE_ERROR_NONE Successful
 * @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
-* @retval #VCE_ERROR_PERMISSION_DENIED Permission denied
 * @retval #VCE_ERROR_NOT_SUPPORTED Not supported
 *
 * @see vce_unset_specific_engine_request_cb()
@@ -868,12 +880,11 @@ int vce_set_nlu_base_info_requested_cb(vce_nlu_base_info_requested_cb callback_f
 int vce_set_specific_engine_request_cb(vce_specific_engine_request_cb callback_func);
 
 /**
-* @brief Unregisters the engine service request callback function.
-* @since_tizen 5.0
+* @brief Unsets the engine service request callback function.
+* @since_tizen 4.0
 *
 * @return 0 on success, otherwise a negative error value
 * @retval #VC_ERROR_NONE Successful
-* @retval #VC_ERROR_PERMISSION_DENIED Permission denied
 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
 *
 * @see vce_set_specific_engine_request_cb()
@@ -882,16 +893,18 @@ int vce_unset_specific_engine_request_cb(void);
 
 /**
 * @brief Retrieves all commands using callback function.
-* @since_tizen 5.0
+* @since_tizen 4.0
+*
 * @param[in] vce_command The handle to be passed to the vce_set_commands() function
 * @param[in] callback The callback function to invoke
 * @param[in] user_data The user data to be passed to the callback function
+*
 * @return 0 on success, otherwise a negative error value
 * @retval #VCE_ERROR_NONE Successful
 * @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #VCE_ERROR_OPERATION_FAILED Operation failure
 * @retval #VCE_ERROR_INVALID_STATE Invalid state
-* @post        This function invokes vce_command_cb() repeatedly for getting commands.
+* @post This function invokes vce_command_cb() repeatedly for getting commands.
 * @see vce_foreach_command_cb()
 * @see vce_set_commands()
 */
@@ -899,9 +912,11 @@ int vce_get_foreach_command(vce_cmd_h vce_command, vce_command_cb callback, void
 
 /**
 * @brief Gets command length.
-* @since_tizen 5.0
+* @since_tizen 4.0
+*
 * @param[in] vce_command The handle to be passed to the vce_set_commands() function
 * @param[out] count The command count value
+*
 * @return 0 on success, otherwise a negative error value.
 * @retval #VCE_ERROR_NONE Successful
 * @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
@@ -912,7 +927,7 @@ int vce_get_command_count(vce_cmd_h vce_command, int* count);
 
 /**
 * @brief Gets current audio type.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @privlevel public
 * @privilege %http://tizen.org/privilege/recorder
 * @remarks The @a audio_type must be released using free() when it is no longer required.
@@ -927,7 +942,7 @@ int vce_get_audio_type(char** audio_type);
 
 /**
 * @brief Sets private data to a voice manager client.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @privlevel public
 * @privilege %http://tizen.org/privilege/recorder
 * @param[in] key Private key
@@ -945,7 +960,7 @@ int vce_set_private_data(const char* key, const char* data);
 
 /**
 * @brief Gets private data from a voice manager client.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @privlevel public
 * @privilege %http://tizen.org/privilege/recorder
 * @remarks The @a data must be released using free() when it is no longer required.
@@ -964,7 +979,7 @@ int vce_get_private_data(const char* key, char** data);
 
 /**
 * @brief Starts recording voice.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @privlevel public
 * @privilege %http://tizen.org/privilege/recorder
 * @return 0 on success, otherwise a negative error value.
@@ -978,7 +993,7 @@ int vce_start_recording(void);
 
 /**
 * @brief Stops recording voice.
-* @since_tizen 5.0
+* @since_tizen 4.0
 * @privlevel public
 * @privilege %http://tizen.org/privilege/recorder
 * @return 0 on success, otherwise a negative error value.
@@ -992,11 +1007,16 @@ int vce_stop_recording(void);
 /* for TTS feeadback */
 /**
 * @brief Sends audio formats necessary for playing TTS feedback.
-* @since_tizen 5.0
+* @since_tizen 4.0
+*
+* @param[in] rate A sampling rate
+* @param[in] channel The audio channel
+* @param[in] audio_type The audio type
+*
 * @return 0 on success, otherwise a negative error value.
 * @retval #VCE_ERROR_NONE Successful
-* @retval #VCE_ERROR_PERMISSION_DENIED Permission denied
 * @retval #VCE_ERROR_NOT_SUPPORTED Not supported
+* @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #VCE_ERROR_OPERATION_FAILED Operation failure
 * @retval #VCE_ERROR_OUT_OF_MEMORY Out of Memory
 */
@@ -1004,11 +1024,16 @@ int vce_send_feedback_audio_format(int rate, vce_audio_channel_e channel, vce_au
 
 /**
 * @brief Sends audio streaming necessary for playing TTS feedback.
-* @since_tizen 5.0
+* @since_tizen 4.0
+*
+* @param[in] event A feedback event
+* @param[in] buffer The feedback data
+* @param[in] len The length of the feedback data
+*
 * @return 0 on success, otherwise a negative error value.
 * @retval #VCE_ERROR_NONE Successful
-* @retval #VCE_ERROR_PERMISSION_DENIED Permission denied
 * @retval #VCE_ERROR_NOT_SUPPORTED Not supported
+* @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #VCE_ERROR_OPERATION_FAILED Operation failure
 * @retval #VCE_ERROR_OUT_OF_MEMORY Out of Memory
 */
index 087cee8..36e842d 100644 (file)
@@ -503,6 +503,16 @@ int vce_send_feedback_audio_format(int rate, vce_audio_channel_e channel, vce_au
 {
        int ret = VCE_ERROR_NONE;
 
+       if (channel < VCE_AUDIO_CHANNEL_MONO || channel > VCE_AUDIO_CHANNEL_STEREO) {
+               SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Invalid parameter");
+               return VCE_ERROR_INVALID_PARAMETER;
+       }
+
+       if (audio_type < VCE_AUDIO_TYPE_PCM_S16_LE || audio_type > VCE_AUDIO_TYPE_PCM_U8) {
+               SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Invalid parameter");
+               return VCE_ERROR_INVALID_PARAMETER;
+       }
+
        ret = vcd_send_feedback_audio_format(rate, channel, audio_type);
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to send feedback audio format");
@@ -515,6 +525,11 @@ int vce_send_feedback_streaming(vce_feedback_event_e event, char* buffer, int le
 {
        int ret = VCE_ERROR_NONE;
 
+       if (NULL == buffer) {
+               SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Input parameter is NULL");
+               return VCE_ERROR_INVALID_PARAMETER;
+       }
+
        ret = vcd_send_feedback_streaming(event, buffer, len);
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to send feedback streaming");