return VC_ERROR_INVALID_STATE;
}
- while (EINA_TRUE == __vc_connect_daemon(NULL));
+ int cnt = 0;
+ while (EINA_TRUE == __vc_connect_daemon(NULL) && VC_CONNECTION_RETRY_COUNT > cnt) {
+ cnt++;
+ }
SLOG(LOG_DEBUG, TAG_VCC, "@@@");
+ if (VC_CONNECTION_RETRY_COUNT == cnt) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to connect daemon");
+ return VC_ERROR_OPERATION_FAILED;
+ }
+
return VC_ERROR_NONE;
}
#define VC_BASE_LANGUAGE "en_US"
#define VC_RETRY_COUNT 5
#define VC_RUNTIME_INFO_NO_FOREGROUND -1
+#define VC_CONNECTION_RETRY_COUNT 10
#define VC_FEATURE_PATH "tizen.org/feature/speech.control"
#define VC_MIC_FEATURE_PATH "tizen.org/feature/microphone"
* @privilege %http://tizen.org/privilege/recorder
*
* @remarks The command type is valid for #VC_COMMAND_TYPE_FOREGROUND and #VC_COMMAND_TYPE_BACKGROUND.
- * Therefore, @a type is either #VC_COMMAND_TYPE_FOREGROUND or #VC_COMMAND_TYPE_BACKGROUND. \n
- * In the file corresponding to @a file_path, there must be commands and command types.
+ * Therefore, @a type is either #VC_COMMAND_TYPE_FOREGROUND or #VC_COMMAND_TYPE_BACKGROUND.
+ * In the file corresponding to @a file_path, there must be commands and command types.
*
* @param[in] file_path The command file path (absolute or relative)
* @param[in] type Command type
*/
int vc_set_command_list_from_file(const char* file_path, int type);
+/**
+ * @brief Connects the voice control service synchronously.
+ * @since_tizen 4.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/recorder
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #VC_ERROR_NONE Successful
+ * @retval #VC_ERROR_INVALID_STATE Invalid state
+ * @retval #VC_ERROR_OPERATION_FAILED Operation failure
+ * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #VC_ERROR_NOT_SUPPORTED Not supported
+ * @pre The state should be #VC_STATE_INITIALIZED.
+ * @post If this function is called, the state will be #VC_STATE_READY.
+ * @see vc_unprepare()
+ */
int vc_prepare_sync(void);