-/*\r
-* Copyright (c) 2011-2015 Samsung Electronics Co., Ltd All Rights Reserved\r
-*\r
-* Licensed under the Apache License, Version 2.0 (the License);\r
-* you may not use this file except in compliance with the License.\r
-* You may obtain a copy of the License at\r
-*\r
-* http://www.apache.org/licenses/LICENSE-2.0\r
-*\r
-* Unless required by applicable law or agreed to in writing, software\r
-* distributed under the License is distributed on an AS IS BASIS,\r
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-* See the License for the specific language governing permissions and\r
-* limitations under the License.\r
-*/\r
-\r
-\r
-#ifndef __VOICE_CONTROL_PLUGIN_ENGINE_H__\r
-#define __VOICE_CONTROL_PLUGIN_ENGINE_H__\r
-\r
-#include <tizen.h>\r
-\r
-/**\r
-* @addtogroup VOICE_CONTROL_PLUGIN_ENGINE\r
-* @{\r
-*/\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-/**\r
-* @brief Enumerations of error codes.\r
-*/\r
-typedef enum {\r
- VCP_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */\r
- VCP_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of Memory */\r
- VCP_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */\r
- VCP_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */\r
- VCP_ERROR_OUT_OF_NETWORK = TIZEN_ERROR_NETWORK_DOWN, /**< Out of network */\r
- VCP_ERROR_INVALID_STATE = -0x0100031, /**< Invalid state */\r
- VCP_ERROR_INVALID_LANGUAGE = -0x0100032, /**< Invalid language */\r
- VCP_ERROR_OPERATION_FAILED = -0x0100034, /**< Operation failed */\r
- VCP_ERROR_NOT_SUPPORTED_FEATURE = -0x0100035 /**< Not supported feature */\r
-} vcp_error_e;\r
-\r
-/**\r
-* @brief Enumerations of audio type.\r
-*/\r
-typedef enum {\r
- VCP_AUDIO_TYPE_PCM_S16_LE = 0, /**< Signed 16bit audio type, Little endian */\r
- VCP_AUDIO_TYPE_PCM_U8 /**< Unsigned 8bit audio type */\r
-} vcp_audio_type_e;\r
-\r
-/**\r
-* @brief Enumerations of callback event.\r
-*/\r
-typedef enum {\r
- VCP_RESULT_EVENT_SUCCESS = 0, /**< Event when the recognition full result is ready */\r
- VCP_RESULT_EVENT_REJECTED, /**< Event when the recognition result is rejected */\r
- VCP_RESULT_EVENT_ERROR /**< Event when the recognition has failed */\r
-} vcp_result_event_e;\r
-\r
-/**\r
-* @brief Enumerations of command type.\r
-*/\r
-typedef enum {\r
- VCP_COMMAND_FORMAT_FIXED = 0, /**< Fixed command */\r
- VCP_COMMAND_FORMAT_FIXED_AND_VFIXED, /**< Fixed command + variable-fixed command */\r
- VCP_COMMAND_FORMAT_VFIXED_AND_FIXED, /**< variable-fixed command + Fixed command */\r
- VCP_COMMAND_FORMAT_FIXED_AND_NONFIXED, /**< Fixed command + Non-fixed command */\r
- VCP_COMMAND_FORMAT_NONFIXED_AND_FIXED, /**< Non-fixed command + Fixed command */\r
- VCP_COMMAND_FORMAT_ACTION,\r
- VCP_COMMAND_FORMAT_PARTIAL\r
-} vcp_command_format_e;\r
-\r
-/**\r
-* @brief Definition for foreground command type.\r
-* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif\r
-*/\r
-#define VCP_COMMAND_TYPE_FOREGROUND 1\r
-\r
-/**\r
-* @brief Definition for background command type.\r
-* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif\r
-*/\r
-#define VCP_COMMAND_TYPE_BACKGROUND 2\r
-\r
-/**\r
-* @brief Definition for widget command type.\r
-* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif\r
-*/\r
-#define VCP_COMMAND_TYPE_WIDGET 3\r
-\r
-/**\r
-* @brief Definition for system command type.\r
-* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif\r
-*/\r
-#define VCP_COMMAND_TYPE_SYSTEM 4\r
-\r
-/**\r
-* @brief Definition for exclusive command type.\r
-* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif\r
-*/\r
-#define VCP_COMMAND_TYPE_SYSTEM_BACKGROUND 5\r
-\r
-/**\r
-* @brief Definitions for exclusive command type.\r
-* @since_tizen 2.4\r
-*/\r
-#define VCP_COMMAND_TYPE_EXCLUSIVE 6\r
-\r
-\r
-/**\r
-* @brief Enumerations of speech detect.\r
-*/\r
-typedef enum {\r
- VCP_SPEECH_DETECT_NONE = 0, /**< No event */\r
- VCP_SPEECH_DETECT_BEGIN, /**< Begin of speech detected */\r
- VCP_SPEECH_DETECT_END, /**< End of speech detected */\r
-} vcp_speech_detect_e;\r
-\r
-typedef enum {\r
- VCP_ASR_RESULT_EVENT_FINAL_RESULT = 0,\r
- VCP_ASR_RESULT_EVENT_PARTIAL_RESULT,\r
- VCP_ASR_RESULT_EVENT_ERROR\r
-} vcp_asr_result_event_e;\r
-\r
-/**\r
-* @brief A structure of handle for VC command\r
-*/\r
-typedef int vcp_cmd_h;\r
-\r
-/**\r
- * @brief Definition of bluetooth audio id.\r
-*/\r
-#define VCP_AUDIO_ID_BLUETOOTH "VC_AUDIO_ID_BLUETOOTH" /**< Bluetooth audio id */\r
-\r
-/**\r
- * @brief Definition of MSF(wifi) audio id.\r
-*/\r
-#define VCP_AUDIO_ID_MSF "VC_AUDIO_ID_MSF" /**< MSF (wifi) audio id */\r
-\r
-/**\r
-* @brief Definition for none message.\r
-*/\r
-#define VC_RESULT_MESSAGE_NONE "vc.result.message.none"\r
-\r
-/**\r
-* @brief Definition for failed recognition because the speech is too loud to listen.\r
-*/\r
-#define VC_RESULT_MESSAGE_ERROR_TOO_LOUD "vc.result.message.error.too.loud"\r
-\r
-\r
-/**\r
-* @brief Called when the daemon gets synthesized result.\r
-*\r
-* @param[in] event A result event\r
-* @param[in] result_id Result ids\r
-* @param[in] count Result count\r
-* @param[in] all_result All result text\r
-* @param[in] non_fixed_result Non-fixed command result text\r
-* @param[in] nlu_result NLU result text\r
-* @param[in] msg Engine message (e.g. #VC_RESULT_MESSAGE_NONE, #VC_RESULT_MESSAGE_ERROR_TOO_LOUD)\r
-* @param[out] user_info A user info (e.g. If ASR result is consumed, the value is 0x01. If not, the value is 0x00.)\r
-* @param[in] user_data The user data passed from set callback function\r
-*\r
-* @pre vcpe_stop() will invoke this callback.\r
-*\r
-* @see vcpe_stop()\r
-*/\r
-typedef void (*vcpe_result_cb)(vcp_result_event_e event, int* result_id, int count,\r
- const char* all_result, const char* non_fixed_result, const char* nlu_result, const char* msg, int* user_info, void *user_data);\r
-\r
-\r
-/**\r
-* @brief Called when the daemon gets ASR result.\r
-*\r
-* @param[in] event A asr result event\r
-* @param[in] pre_result result text\r
-* @param[in] user_data The user data passed from the start\r
-*/\r
-typedef void (*vcpe_asr_result_cb)(vcp_asr_result_event_e event, const char* asr_result, void *user_data);\r
-\r
-/**\r
-* @brief Called when the daemon gets nlg result.\r
-*\r
-* @param[in] nlg_result Nlg result\r
-* @param[in] user_data The user data passed from the start\r
-*/\r
-typedef void (*vcpe_nlg_result_cb)(const char* nlg_result, void *user_data);\r
-\r
-/**\r
-* @brief Called when the daemon gets error.\r
-*\r
-* @param[in] error Error type\r
-* @param[in] msg Error message\r
-* @param[in] user_data The user data passed from set callback function\r
-*\r
-*/\r
-typedef void (*vcpe_error_cb)(vcp_error_e error, const char* msg, void *user_data);\r
-\r
-/**\r
-* @brief Called to retrieve the supported languages.\r
-*\r
-* @param[in] language A language is specified as an ISO 3166 alpha-2 two letter country-code\r
-* followed by ISO 639-1 for the two-letter language code \n\r
-* For example, "ko_KR" for Korean, "en_US" for American English\r
-* @param[in] user_data The user data passed from the foreach function\r
-*\r
-* @return @c true to continue with the next iteration of the loop \n @c false to break out of the loop\r
-*\r
-* @pre vcpe_foreach_supported_languages() will invoke this callback.\r
-*\r
-* @see vcpe_foreach_supported_languages()\r
-*/\r
-typedef bool (*vcpe_supported_language_cb)(const char* language, void* user_data);\r
-\r
-/**\r
-* @brief Initializes the engine.\r
-*\r
-* @param[in] result_cb A callback function for recognition result\r
-* @param[in] silence_cb A callback function for silence detection\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_PARAMETER Invalid parameter\r
-* @retval #VCP_ERROR_INVALID_STATE Already initialized\r
-* @retval #VCP_ERROR_OPERATION_FAILED Operation failed\r
-*\r
-* @see vcpe_deinitialize()\r
-*/\r
-typedef int (*vcpe_initialize)(void);\r
-\r
-/**\r
-* @brief Deinitializes the engine\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_STATE Not initialized\r
-*\r
-* @see vcpe_initialize()\r
-*/\r
-typedef void (*vcpe_deinitialize)(void);\r
-\r
-/**\r
-* @brief Registers a callback function for getting recognition result.\r
-*\r
-* @param[in] callback Callback function to register\r
-* @param[in] user_data The user data to be passed to the callback function\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_PARAMETER Invalid parameter\r
-*\r
-* @see vcpe_result_cb()\r
-*/\r
-typedef int (*vcpe_set_result_cb)(vcpe_result_cb callback, void* user_data);\r
-\r
-/**\r
-* @brief Registers a callback function for getting ASR recognition result.\r
-*\r
-* @param[in] callback Callback function to register\r
-* @param[in] user_data The user data to be passed to the callback function\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-*\r
-* @see vcpe_asr_result_cb()\r
-*/\r
-typedef int (*vcpe_set_asr_result_cb)(vcpe_asr_result_cb callback, void* user_data);\r
-\r
-/**\r
-* @brief Registers a callback function for getting nlg result.\r
-*\r
-* @param[in] callback Callback function to register\r
-* @param[in] user_data The user data to be passed to the callback function\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-*\r
-*/\r
-typedef int (*vcpe_set_nlg_result_cb)(vcpe_nlg_result_cb, void* user_data);\r
-\r
-#if 0\r
-/**\r
-* @brief Registers a callback function for getting partial recognition result.\r
-*\r
-* @param[in] callback Callback function to register\r
-* @param[in] user_data The user data to be passed to the callback function\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-*\r
-* @see vcpe_pre_result_cb()\r
-*/\r
-typedef int (*vcpe_set_pre_result_cb)(vcpe_pre_result_cb callback, void* user_data);\r
-#endif\r
-\r
-/**\r
-* @brief Registers a callback function for error.\r
-*\r
-* @param[in] callback Callback function to register\r
-* @param[in] user_data The user data to be passed to the callback function\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-*\r
-*/\r
-typedef int (*vcpe_set_error_cb)(vcpe_error_cb callback, void* user_data);\r
-\r
-#if 0\r
-/**\r
-* @brief Registers a callback function for getting NLU result.\r
-*\r
-* @param[in] callback Callback function to register\r
-* @param[in] user_data The user data to be passed to the callback function\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-*\r
-*/\r
-typedef int (*vcpe_set_nlu_result_cb)(vcpe_nlu_result_cb, void* user_data);\r
-#endif\r
-\r
-/**\r
-* @brief Gets recording format of the engine.\r
-*\r
-* @param[in] audio_id The audio device id.\r
-* @param[out] types The format used by the recorder.\r
-* @param[out] rate The sample rate used by the recorder.\r
-* @param[out] channels The number of channels used by the recorder.\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_PARAMETER Not initialized\r
-*/\r
-typedef int (*vcpe_get_recording_format)(const char* audio_id, vcp_audio_type_e* types, int* rate, int* channels);\r
-\r
-/**\r
-* @brief Retrieves all supported languages of the engine.\r
-*\r
-* @param[in] callback a callback function\r
-* @param[in] user_data The user data to be passed to the callback function\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_PARAMETER Invalid parameter\r
-* @retval #VCP_ERROR_INVALID_STATE Not initialized\r
-*\r
-* @post This function invokes vcpe_supported_language_cb() repeatedly for getting supported languages.\r
-*\r
-* @see vcpe_supported_language_cb()\r
-*/\r
-typedef int (*vcpe_foreach_supported_languages)(vcpe_supported_language_cb callback, void* user_data);\r
-\r
-/**\r
-* @brief Checks whether a language is supported or not.\r
-*\r
-* @param[in] language A language\r
-*\r
-* @return @c true = supported, \n @c false = not supported.\r
-*/\r
-typedef bool (*vcpe_is_language_supported)(const char* language);\r
-\r
-/**\r
-* @brief Sets language.\r
-*\r
-* @param[in] language language.\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_LANGUAGE Invalid language\r
-* @retval #VCP_ERROR_INVALID_STATE Not initialized\r
-*/\r
-typedef int (*vcpe_set_language)(const char* language);\r
-\r
-/**\r
-* @brief Sets command list before recognition.\r
-*\r
-* @remark This function should set commands via vcpd_foreach_command().\r
-*\r
-* @param[in] vcp_command command handle.\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_PARAMETER Invalid parameter\r
-* @retval #VCP_ERROR_INVALID_STATE Invalid state\r
-* @retval #VCP_ERROR_OPERATION_FAILED Operation failed\r
-* @retval #VCP_ERROR_NOT_SUPPORTED_FEATURE Not supported command type\r
-*\r
-* @post vcpe_start() is called after this function is successful.\r
-*\r
-* @see vcpe_start()\r
-* @see vcpd_foreach_command()\r
-* @see vcpe_unset_commands()\r
-*/\r
-typedef int (*vcpe_set_commands)(vcp_cmd_h vcp_command);\r
-\r
-/**\r
-* @brief Unset command list for reset.\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_PARAMETER Invalid parameter\r
-* @retval #VCP_ERROR_INVALID_STATE Invalid state\r
-* @retval #VCP_ERROR_OPERATION_FAILED Operation failed\r
-*\r
-* @see vcpe_set_commands()\r
-*/\r
-typedef int (*vcpe_unset_commands)();\r
-\r
-/**\r
-* @brief Start recognition.\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_PARAMETER Invalid parameter\r
-* @retval #VCP_ERROR_INVALID_STATE Invalid state\r
-* @retval #VCP_ERROR_INVALID_LANGUAGE Invalid language\r
-* @retval #VCP_ERROR_OUT_OF_NETWORK Out of network\r
-* @retval #VCP_ERROR_OPERATION_FAILED Operation failed\r
-*\r
-* @pre vcpd_foreach_command() is successful.\r
-*\r
-* @see vcpe_set_recording_data()\r
-* @see vcpe_stop()\r
-* @see vcpe_cancel()\r
-*/\r
-typedef int (*vcpe_start)(bool stop_by_silence);\r
-\r
-/**\r
-* @brief Sets recording data for speech recognition from recorder.\r
-*\r
-* @remark This function should be returned immediately after recording data copy.\r
-*\r
-* @param[in] data A recording data\r
-* @param[in] length A length of recording data\r
-* @param[out] silence_detected @c true Silence detected \n @c false No silence detected\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_PARAMETER Invalid parameter\r
-* @retval #VCP_ERROR_INVALID_STATE Invalid state\r
-* @retval #VCP_ERROR_OPERATION_FAILED Operation failed\r
-*\r
-* @pre vcpe_start() is successful.\r
-*\r
-* @see vcpe_start()\r
-* @see vcpe_cancel()\r
-* @see vcpe_stop()\r
-*/\r
-typedef int(*vcpe_set_recording_data)(const void* data, unsigned int length, vcp_speech_detect_e* speech_detected);\r
-\r
-/**\r
-* @brief Stops to get the result of recognition.\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_STATE Invalid state\r
-* @retval #VCP_ERROR_OPERATION_FAILED Operation failed\r
-* @retval #VCP_ERROR_OUT_OF_NETWORK Out of network\r
-*\r
-* @pre vcpe_set_recording_data() is successful.\r
-*\r
-* @see vcpe_start()\r
-* @see vcpe_set_recording_data()\r
-* @see vcpe_result_cb()\r
-* @see vcpe_cancel()\r
-*/\r
-typedef int (*vcpe_stop)(void);\r
-\r
-/**\r
-* @brief Cancels the recognition process.\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-* @retval #VCP_ERROR_NONE Successful.\r
-* @retval #VCP_ERROR_INVALID_STATE Invalid state.\r
-*\r
-* @pre vcpe_start() is successful.\r
-*\r
-* @see vcpe_start()\r
-* @see vcpe_stop()\r
-*/\r
-typedef int (*vcpe_cancel)(void);\r
-\r
-/**\r
-* @brief Set audio recording type.\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-* @retval #VCP_ERROR_NONE Successful.\r
-*\r
-*/\r
-typedef int (*vcpe_set_audio_type)(const char* audio);\r
-\r
-/**\r
-* @brief Sets domain (Agent or device type)\r
-*\r
-* @param[in] domain available Agent or device type\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-*\r
-*/\r
-typedef int (*vcpe_set_domain)(const char* domain);\r
-\r
-/**\r
-* @brief Gets essential value from nlu result. This function is available inside vcpe_nlu_result_cb()\r
-*\r
-* @param[in] key NLU base info key\r
-* @parma[out] value NLU base info value\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-*\r
-*/\r
-typedef int (*vcpe_get_nlu_base_info)(const char* key, char** value);\r
-\r
-/**\r
-* @brief Sets private data between app and engine.\r
-*\r
-* @param[in] key Private key\r
-* @param[in] data Private data\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-*\r
-*/\r
-typedef int (*vcpe_set_private_data)(const char* key, const char* data);\r
-\r
-/**\r
-* @brief Gets private data between app and engine.\r
-*\r
-* @param[in] key Private key\r
-* @param[out] data Private data\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-*\r
-*/\r
-typedef int (*vcpe_get_private_data)(const char* key, char** data);\r
-\r
-/**\r
-* @brief Request process text.\r
-*\r
-* @param[in] text Requested text\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-*\r
-*/\r
-typedef int (*vcpe_process_text)(const char* text);\r
-\r
-/**\r
-* @brief Request list event.\r
-*\r
-* @param[in] event Requested list event\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-*\r
-*/\r
-typedef int (*vcpe_process_list_event)(const char* event);\r
-\r
-/**\r
-* @brief Request haptic event.\r
-*\r
-* @param[in] event Requested haptic event\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-*\r
-*/\r
-typedef int (*vcpe_process_haptic_event)(const char* event);\r
-\r
-/**\r
-* Daemon API.\r
-*/\r
-\r
-/**\r
-* @brief Called to retrieve the commands.\r
-*\r
-* @param[in] id command id\r
-* @param[in] type command type\r
-* @param[in] format command format\r
-* @param[in] command command text\r
-* @param[in] param parameter text\r
-* @param[in] domain command domain\r
-* @param[in] user_data The user data passed from the foreach function\r
-*\r
-* @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop.\r
-* @pre vcpd_foreach_command() will invoke this callback.\r
-*\r
-* @see vcpd_foreach_command()\r
-*/\r
-typedef bool (*vcpd_foreach_command_cb)(int id, int type, int format, const char* command, const char* param, int domain, void* user_data);\r
-\r
-/**\r
-* @brief Retrieves all commands using callback function.\r
-*\r
-* @param[in] vcp_command The handle to be passed to the vcpe_set_commands() function\r
-* @param[in] callback The callback function to invoke\r
-* @param[in] user_data The user data to be passed to the callback function\r
-*\r
-* @return 0 on success, otherwise a negative error value\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_PARAMETER Invalid parameter\r
-* @retval #VCP_ERROR_OPERATION_FAILED Operation failure\r
-* @retval #VCP_ERROR_INVALID_STATE Invalid state\r
-*\r
-* @post This function invokes vcpd_foreach_command_cb() repeatedly for getting commands.\r
-*\r
-* @see vcpd_foreach_command_cb()\r
-* @see vcpe_set_commands()\r
-*/\r
-typedef int (*vcpd_foreach_command)(vcp_cmd_h vcp_command, vcpd_foreach_command_cb callback, void* user_data);\r
-\r
-/**\r
-* @brief Gets command length.\r
-*\r
-* @param[in] vcp_command The handle to be passed to the vcpe_set_commands() function\r
-*\r
-* @return the value greater than 0 on success, otherwise a negative error value\r
-*\r
-* @see vcpe_set_commands()\r
-*/\r
-typedef int (*vcpd_get_command_count)(vcp_cmd_h vcp_command);\r
-\r
-/**\r
-* @brief Gets current audio type.\r
-*\r
-* @remarks audio_type must be released using free() when it is no longer required.\r
-*\r
-* @param[in] audio_type Current audio type (e.g. #VCP_AUDIO_ID_BLUETOOTH or usb device id)\r
-*\r
-* @return the value greater than 0 on success, otherwise a negative error value\r
-*\r
-*/\r
-typedef int (*vcpd_get_audio_type)(char** audio_type);\r
-\r
-/**\r
-* @brief Sets private data to Manager client.\r
-*\r
-* @param[in] key Private key\r
-* @param[in] data Private data\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-*\r
-*/\r
-typedef int (*vcpd_set_private_data)(const char* key, const char* data);\r
-\r
-/**\r
-* @brief Gets private data from Manager client.\r
-*\r
-* @param[in] key Private key\r
-* @param[out] data Private data\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-*\r
-*/\r
-typedef int (*vcpd_get_private_data)(const char* key, char** data);\r
-\r
-/**\r
-* @brief Request start recording.\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-*\r
-*/\r
-typedef int (*vcpd_start_recording)();\r
-\r
-/**\r
-* @brief Request stop recording.\r
-*\r
-* @return 0 on success, otherwise a negative error value.\r
-*\r
-*/\r
-typedef int (*vcpd_stop_recording)();\r
-\r
-/**\r
-* @brief A structure of the engine functions.\r
-*/\r
-typedef struct {\r
- int size; /**< Size of structure */\r
- int version; /**< Version */\r
-\r
- vcpe_initialize initialize; /**< Initialize engine */\r
- vcpe_deinitialize deinitialize; /**< Shutdown engine */\r
-\r
- /* Get engine information */\r
- vcpe_get_recording_format get_recording_format; /**< Get recording format */\r
- vcpe_foreach_supported_languages foreach_langs; /**< Foreach language list */\r
- vcpe_is_language_supported is_lang_supported; /**< Check language */\r
-\r
- /* Set info */\r
- vcpe_set_result_cb set_result_cb; /**< Set result callback */\r
- vcpe_set_language set_language; /**< Set language */\r
- vcpe_set_commands set_commands; /**< Request to set current commands */\r
- vcpe_unset_commands unset_commands; /**< Request to unset current commands */\r
-\r
- /* Control recognition */\r
- vcpe_start start; /**< Start recognition */\r
- vcpe_set_recording_data set_recording; /**< Set recording data */\r
- vcpe_stop stop; /**< Stop recording for getting result */\r
- vcpe_cancel cancel; /**< Cancel recording and processing */\r
-\r
- vcpe_set_audio_type set_audio_type; /**< Set audio type */\r
-\r
- //vcpe_set_pre_result_cb set_pre_result_cb; /**< Set pre result callback */\r
- vcpe_set_asr_result_cb set_asr_result_cb; /**< Set asr result callback */\r
- vcpe_set_nlg_result_cb set_nlg_result_cb; /**< Set nlg result callback */\r
- vcpe_set_error_cb set_error_cb; /**< Set error callback */\r
- vcpe_set_domain set_domain; /**< Set domain */\r
- vcpe_get_nlu_base_info get_nlu_base_info; /**< Get essential info */\r
- //vcpe_set_nlu_result_cb set_nlu_result_cb; /**< Set nlu result callback */\r
- vcpe_set_private_data set_private_data; /**< Set private data */\r
- vcpe_get_private_data get_private_data; /**< Get private data */\r
- vcpe_process_text process_text; /**< Request to process text */\r
- vcpe_process_list_event process_list_event; /**< Request to process list event */\r
- vcpe_process_haptic_event process_haptic_event; /**< Request to process haptic event */\r
-} vcpe_funcs_s;\r
-\r
-/**\r
-* @brief A structure of the daemon functions.\r
-*/\r
-typedef struct {\r
- int size; /**< Size of structure */\r
- int version; /**< Version */\r
-\r
- vcpd_foreach_command foreach_command; /**< Foreach command */\r
- vcpd_get_command_count get_command_count; /**< Get command count */\r
-\r
- vcpd_get_audio_type get_audio_type; /**< Get audio type */\r
-\r
- vcpd_set_private_data set_private_data; /**< Set private data to Manager */\r
- vcpd_get_private_data get_private_data; /**< Get private data from Manager */\r
-\r
- vcpd_start_recording start_recording; /**< Request start recording */\r
- vcpd_stop_recording stop_recording; /**< Request stop recording */\r
-} vcpd_funcs_s;\r
-\r
-/**\r
-* @brief Loads the engine.\r
-*\r
-* @param[in] pdfuncs The daemon functions\r
-* @param[out] pefuncs The engine functions\r
-*\r
-* @return This function returns zero on success, or negative with error code on failure\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_PARAMETER Invalid parameter\r
-* @retval #VCP_ERROR_OPERATION_FAILED Operation failed\r
-*\r
-* @pre The vcp_get_engine_info() should be successful.\r
-* @post The daemon calls engine functions of vcpe_funcs_s.\r
-*\r
-* @see vcp_get_engine_info()\r
-* @see vcp_unload_engine()\r
-*/\r
-int vcp_load_engine(vcpd_funcs_s* pdfuncs, vcpe_funcs_s* pefuncs);\r
-\r
-/**\r
-* @brief Unloads this engine by the daemon.\r
-*\r
-* @pre The vcp_load_engine() should be successful.\r
-*\r
-* @see vcp_load_engine()\r
-*/\r
-void vcp_unload_engine(void);\r
-\r
-/**\r
-* @brief Called to get the engine base information.\r
-*\r
-* @param[in] engine_uuid The engine id\r
-* @param[in] engine_name The engine name\r
-* @param[in] engine_setting The setting ug name\r
-* @param[in] use_network @c true to need network @c false not to need network.\r
-* @param[in] user_data The User data passed from vcp_get_engine_info()\r
-*\r
-* @pre vcp_get_engine_info() will invoke this callback.\r
-*\r
-* @see vcp_get_engine_info()\r
-*/\r
-typedef void (*vcpe_engine_info_cb)(const char* engine_uuid, const char* engine_name, const char* engine_setting,\r
- bool use_network, void* user_data);\r
-\r
-/**\r
-* @brief Gets the engine base information before the engine is loaded by the daemon.\r
-*\r
-* @param[in] callback Callback function\r
-* @param[in] user_data User data to be passed to the callback function\r
-*\r
-* @return This function returns zero on success, or negative with error code on failure\r
-* @retval #VCP_ERROR_NONE Successful\r
-* @retval #VCP_ERROR_INVALID_PARAMETER Invalid parameter\r
-* @retval #VCP_ERROR_OPERATION_FAILED Operation failed\r
-*\r
-* @post This function invokes vcpe_engine_info_cb() for getting engine information.\r
-*\r
-* @see vcpe_engine_info_cb()\r
-* @see vcp_load_engine()\r
-*/\r
-int vcp_get_engine_info(vcpe_engine_info_cb callback, void* user_data);\r
-\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-/**\r
-* @}@}\r
-*/\r
-\r
-#endif /* __VOICE_CONTROL_PLUGIN_ENGINE_H__ */\r