updates codes to check model config feature 95/47595/1 tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/mobile/20150910.070638 accepted/tizen/tv/20150910.070644 accepted/tizen/wearable/20150910.070653 submit/tizen/20150910.043834 submit/tizen_common/20151023.083358 submit/tizen_common/20151026.085049 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
authorWonnam Jang <wn.jang@samsung.com>
Mon, 7 Sep 2015 02:06:35 +0000 (11:06 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Mon, 7 Sep 2015 02:06:35 +0000 (11:06 +0900)
Change-Id: I7ed31729cde6265457422282b436dfa9f3c63200

CMakeLists.txt
changelog
client/vc.c
common/vc_command.c
common/vc_defs.h
doc/uix_vc_doc.h
packaging/voice-control.spec

index bb93fa6..d978245 100644 (file)
@@ -26,7 +26,7 @@ PROJECT(vc)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "${PREFIX}")
-SET(VERSION 0.2.9)
+SET(VERSION 0.2.10)
 
 # pkg config tool
 INCLUDE(FindPkgConfig)
@@ -38,7 +38,7 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
 ## Dependent packages ##
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs REQUIRED
-    aul capi-base-common capi-media-audio-io capi-media-sound-manager capi-network-bluetooth
+    aul capi-base-common capi-media-audio-io capi-media-sound-manager capi-network-bluetooth capi-system-info
     dbus-1 dlog ecore glib-2.0 libprivilege-control libxml-2.0 vconf
 )
 
index 9f2aae1..423a38d 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,3 +1,7 @@
+voice-control (0.2.10) -- Thu, 27 Aug 2015
+
+  * Add tizen.org/feature/speech.control feature check (Dongyeol Lee <dy3.lee@samsung.com>)
+
 voice-control (0.2.9) -- Mon, 6 Jul 2015
 
   * Update daemon start by dbus activation (Dongyeol Lee <dy3.lee@samsung.com>)
index f3bf651..1cad371 100644 (file)
@@ -15,6 +15,7 @@
 */
 
 #include <aul.h>
+#include <system_info.h>
 
 #include "vc_client.h"
 #include "vc_command.h"
@@ -33,6 +34,8 @@ static Ecore_Timer* g_connect_timer = NULL;
 
 static vc_h g_vc = NULL;
 
+static int g_feature_enabled = -1;
+
 #if 0
 static Ecore_Event_Handler* g_focus_in_hander = NULL;
 static Ecore_Event_Handler* g_focus_out_hander = NULL;
@@ -41,6 +44,29 @@ static Ecore_Event_Handler* g_focus_out_hander = NULL;
 Eina_Bool __vc_notify_state_changed(void *data);
 Eina_Bool __vc_notify_error(void *data);
 
+static int __vc_get_feature_enabled()
+{
+       if (0 == g_feature_enabled) {
+               SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Voice control feature NOT supported");
+               return VC_ERROR_NOT_SUPPORTED;
+       } else if (-1 == g_feature_enabled) {
+               bool vc_supported = false;
+               bool mic_supported = false;
+               if (0 == system_info_get_platform_bool(VC_FEATURE_PATH, &vc_supported)) {
+                       if (0 == system_info_get_platform_bool(VC_MIC_FEATURE_PATH, &mic_supported)) {
+                               if (false == vc_supported || false == mic_supported) {
+                                       SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Voice control feature NOT supported");
+                                       g_feature_enabled = 0;
+                                       return VC_ERROR_NOT_SUPPORTED;
+                               }
+
+                               g_feature_enabled = 1;
+                       }
+               }
+       }
+
+       return 0;
+}
 
 static const char* __vc_get_error_code(vc_error_e err)
 {
@@ -122,6 +148,10 @@ static Eina_Bool __notify_auth_changed_cb(void *data)
 
 int vc_initialize(void)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCC, "===== [Client] Initialize");
 
        /* check handle */
@@ -202,6 +232,10 @@ static void __vc_internal_unprepare(void)
 
 int vc_deinitialize(void)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCC, "===== [Client] Deinitialize");
 
        if (false == vc_client_is_valid(g_vc)) {
@@ -381,6 +415,10 @@ static Eina_Bool __vc_connect_daemon(void *data)
 
 int vc_prepare(void)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCC, "===== [Client] Prepare");
 
        vc_state_e state;
@@ -409,6 +447,10 @@ int vc_prepare(void)
 
 int vc_unprepare(void)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCC, "===== [Client] Unprepare");
 
        vc_state_e state;
@@ -440,6 +482,10 @@ int vc_unprepare(void)
 
 int vc_foreach_supported_languages(vc_supported_language_cb callback, void* user_data)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCC, "===== [Client] Foreach Supported Language");
 
        if (NULL == callback) {
@@ -473,6 +519,10 @@ int vc_foreach_supported_languages(vc_supported_language_cb callback, void* user
 
 int vc_get_current_language(char** language)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCC, "===== [Client] Get Current Language");
 
        if (NULL == language) {
@@ -505,6 +555,10 @@ int vc_get_current_language(char** language)
 
 int vc_get_state(vc_state_e* state)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCC, "===== [Client] Get State");
 
        if (NULL == state) {
@@ -537,6 +591,10 @@ int vc_get_state(vc_state_e* state)
 
 int vc_get_service_state(vc_service_state_e* state)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCC, "===== [Client] Get Service State");
 
        if (NULL == state) {
@@ -720,6 +778,10 @@ int vc_is_command_format_supported(vc_cmd_format_e format, bool* support)
 
 int vc_set_command_list(vc_cmd_list_h vc_cmd_list, int type)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCC, "===== [Client] Set Command list");
 
        if (NULL == vc_cmd_list) {
@@ -787,6 +849,10 @@ int vc_set_command_list(vc_cmd_list_h vc_cmd_list, int type)
 
 int vc_unset_command_list(int type)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCC, "===== [Client] Unset Command list");
 
        vc_state_e state;
@@ -874,6 +940,10 @@ int vc_get_exclusive_command_option(bool* value)
 
 int vc_set_exclusive_command_option(bool value)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCC, "===== [Client] Set exclusive command");
 
        vc_state_e state;
@@ -1225,6 +1295,10 @@ void __vc_cb_result(int pid)
 
 int vc_set_result_cb(vc_result_cb callback, void* user_data)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == callback)
                return VC_ERROR_INVALID_PARAMETER;
 
@@ -1247,6 +1321,10 @@ int vc_set_result_cb(vc_result_cb callback, void* user_data)
 
 int vc_unset_result_cb(void)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        vc_state_e state;
        if (0 != vc_client_get_client_state(g_vc, &state)) {
                SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Unset result callback : A handle is not available");
@@ -1298,6 +1376,10 @@ int __vc_cb_service_state(int state)
 
 int vc_set_service_state_changed_cb(vc_service_state_changed_cb callback, void* user_data)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == callback)
                return VC_ERROR_INVALID_PARAMETER;
 
@@ -1320,6 +1402,10 @@ int vc_set_service_state_changed_cb(vc_service_state_changed_cb callback, void*
 
 int vc_unset_service_state_changed_cb(void)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        vc_state_e state;
        if (0 != vc_client_get_client_state(g_vc, &state)) {
                SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Unset result callback : A handle is not available");
@@ -1339,6 +1425,10 @@ int vc_unset_service_state_changed_cb(void)
 
 int vc_set_state_changed_cb(vc_state_changed_cb callback, void* user_data)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (callback == NULL)
                return VC_ERROR_INVALID_PARAMETER;
 
@@ -1361,6 +1451,10 @@ int vc_set_state_changed_cb(vc_state_changed_cb callback, void* user_data)
 
 int vc_unset_state_changed_cb(void)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        vc_state_e state;
        if (0 != vc_client_get_client_state(g_vc, &state)) {
                SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Unset state changed callback : A handle is not available");
@@ -1380,6 +1474,10 @@ int vc_unset_state_changed_cb(void)
 
 int vc_set_current_language_changed_cb(vc_current_language_changed_cb callback, void* user_data)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == callback)
                return VC_ERROR_INVALID_PARAMETER;
 
@@ -1402,6 +1500,10 @@ int vc_set_current_language_changed_cb(vc_current_language_changed_cb callback,
 
 int vc_unset_current_language_changed_cb(void)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        vc_state_e state;
        if (0 != vc_client_get_client_state(g_vc, &state)) {
                SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Unset current language changed : A handle is not available");
@@ -1421,6 +1523,10 @@ int vc_unset_current_language_changed_cb(void)
 
 int vc_set_error_cb(vc_error_cb callback, void* user_data)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == callback)
                return VC_ERROR_INVALID_PARAMETER;
 
@@ -1443,6 +1549,10 @@ int vc_set_error_cb(vc_error_cb callback, void* user_data)
 
 int vc_unset_error_cb(void)
 {
+       if (0 != __vc_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        vc_state_e state;
        if (0 != vc_client_get_client_state(g_vc, &state)) {
                SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Unset error callback : A handle is not available");
index c06d828..f4fb2ef 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <libintl.h>
 #include <stdlib.h>
+#include <system_info.h>
 
 #include "vc_command.h"
 #include "vc_main.h"
 #include "voice_control_common.h"
 #include "voice_control_key_defines.h"
 
+static int g_feature_enabled = -1;
+
+static int __vc_cmd_get_feature_enabled()
+{
+       if (0 == g_feature_enabled) {
+               SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Voice control feature NOT supported");
+               return VC_ERROR_NOT_SUPPORTED;
+       } else if (-1 == g_feature_enabled) {
+               bool vc_supported = false;
+               bool mic_supported = false;
+               if (0 == system_info_get_platform_bool(VC_FEATURE_PATH, &vc_supported)) {
+                       if (0 == system_info_get_platform_bool(VC_MIC_FEATURE_PATH, &mic_supported)) {
+                               if (false == vc_supported || false == mic_supported) {
+                                       SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Voice control feature NOT supported");
+                                       g_feature_enabled = 0;
+                                       return VC_ERROR_NOT_SUPPORTED;
+                               }
+
+                               g_feature_enabled = 1;
+                       }
+               }
+       }
+
+       return 0;
+}
 
 int vc_cmd_list_create(vc_cmd_list_h* vc_cmd_list)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_cmd_list) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -52,6 +82,10 @@ int vc_cmd_list_create(vc_cmd_list_h* vc_cmd_list)
 
 int vc_cmd_list_destroy(vc_cmd_list_h vc_cmd_list, bool release_command)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_cmd_list) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -74,6 +108,10 @@ int vc_cmd_list_destroy(vc_cmd_list_h vc_cmd_list, bool release_command)
 
 int vc_cmd_list_get_count(vc_cmd_list_h vc_cmd_list, int* count)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_cmd_list || NULL == count) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Get command count : Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -91,6 +129,10 @@ int vc_cmd_list_get_count(vc_cmd_list_h vc_cmd_list, int* count)
 
 int vc_cmd_list_add(vc_cmd_list_h vc_cmd_list, vc_cmd_h vc_command)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_cmd_list || NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -115,6 +157,10 @@ int vc_cmd_list_add(vc_cmd_list_h vc_cmd_list, vc_cmd_h vc_command)
 
 int vc_cmd_list_remove(vc_cmd_list_h vc_cmd_list, vc_cmd_h vc_command)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_cmd_list || NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -165,6 +211,10 @@ int vc_cmd_list_remove(vc_cmd_list_h vc_cmd_list, vc_cmd_h vc_command)
 
 int vc_cmd_list_remove_all(vc_cmd_list_h vc_cmd_list, bool release_command)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        SLOG(LOG_DEBUG, TAG_VCCMD, "===== Destroy all command");
 
        if (NULL == vc_cmd_list) {
@@ -209,6 +259,10 @@ int vc_cmd_list_remove_all(vc_cmd_list_h vc_cmd_list, bool release_command)
 
 int vc_cmd_list_foreach_commands(vc_cmd_list_h vc_cmd_list, vc_cmd_list_cb callback, void* user_data)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_cmd_list) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -244,6 +298,10 @@ int vc_cmd_list_foreach_commands(vc_cmd_list_h vc_cmd_list, vc_cmd_list_cb callb
 
 int vc_cmd_list_first(vc_cmd_list_h vc_cmd_list)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_cmd_list) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -264,6 +322,10 @@ int vc_cmd_list_first(vc_cmd_list_h vc_cmd_list)
 
 int vc_cmd_list_last(vc_cmd_list_h vc_cmd_list)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_cmd_list) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -287,6 +349,10 @@ int vc_cmd_list_last(vc_cmd_list_h vc_cmd_list)
 
 int vc_cmd_list_next(vc_cmd_list_h vc_cmd_list)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_cmd_list) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -310,6 +376,10 @@ int vc_cmd_list_next(vc_cmd_list_h vc_cmd_list)
 
 int vc_cmd_list_prev(vc_cmd_list_h vc_cmd_list)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_cmd_list) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -331,6 +401,10 @@ int vc_cmd_list_prev(vc_cmd_list_h vc_cmd_list)
 
 int vc_cmd_list_get_current(vc_cmd_list_h vc_cmd_list, vc_cmd_h* vc_command)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_cmd_list || NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -360,6 +434,10 @@ int vc_cmd_list_get_current(vc_cmd_list_h vc_cmd_list, vc_cmd_h* vc_command)
 
 int vc_cmd_create(vc_cmd_h* vc_command)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -392,6 +470,10 @@ int vc_cmd_create(vc_cmd_h* vc_command)
 
 int vc_cmd_destroy(vc_cmd_h vc_command)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Input parameter is NULL");
                return VC_ERROR_INVALID_PARAMETER;
@@ -414,6 +496,10 @@ int vc_cmd_destroy(vc_cmd_h vc_command)
 
 int vc_cmd_set_id(vc_cmd_h vc_command, int id)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -432,6 +518,10 @@ int vc_cmd_set_id(vc_cmd_h vc_command, int id)
 
 int vc_cmd_get_id(vc_cmd_h vc_command, int* id)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command || NULL == id) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid handle ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -450,6 +540,10 @@ int vc_cmd_get_id(vc_cmd_h vc_command, int* id)
 
 int vc_cmd_set_command(vc_cmd_h vc_command, const char* command)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -475,6 +569,10 @@ int vc_cmd_set_command(vc_cmd_h vc_command, const char* command)
 
 int vc_cmd_get_command(vc_cmd_h vc_command, char** command)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command || NULL == command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid handle ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -494,6 +592,10 @@ int vc_cmd_get_command(vc_cmd_h vc_command, char** command)
 
 int vc_cmd_set_unfixed_command(vc_cmd_h vc_command, const char* command)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -518,6 +620,10 @@ int vc_cmd_set_unfixed_command(vc_cmd_h vc_command, const char* command)
 
 int vc_cmd_get_unfixed_command(vc_cmd_h vc_command, char** command)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command || NULL == command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid handle ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -536,6 +642,10 @@ int vc_cmd_get_unfixed_command(vc_cmd_h vc_command, char** command)
 
 int vc_cmd_set_type(vc_cmd_h vc_command, int type)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -553,6 +663,10 @@ int vc_cmd_set_type(vc_cmd_h vc_command, int type)
 
 int vc_cmd_get_type(vc_cmd_h vc_command, int* type)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command || NULL == type) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -570,6 +684,10 @@ int vc_cmd_get_type(vc_cmd_h vc_command, int* type)
 
 int vc_cmd_set_format(vc_cmd_h vc_command, vc_cmd_format_e format)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -587,6 +705,10 @@ int vc_cmd_set_format(vc_cmd_h vc_command, vc_cmd_format_e format)
 
 int vc_cmd_get_format(vc_cmd_h vc_command, vc_cmd_format_e* format)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command || NULL == format) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -604,6 +726,10 @@ int vc_cmd_get_format(vc_cmd_h vc_command, vc_cmd_format_e* format)
 
 int vc_cmd_set_pid(vc_cmd_h vc_command, int pid)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -621,6 +747,10 @@ int vc_cmd_set_pid(vc_cmd_h vc_command, int pid)
 
 int vc_cmd_get_pid(vc_cmd_h vc_command, int* pid)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command || NULL == pid) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -638,6 +768,10 @@ int vc_cmd_get_pid(vc_cmd_h vc_command, int* pid)
 
 int vc_cmd_set_domain(vc_cmd_h vc_command, int domain)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
                return VC_ERROR_INVALID_PARAMETER;
@@ -655,6 +789,10 @@ int vc_cmd_set_domain(vc_cmd_h vc_command, int domain)
 
 int vc_cmd_get_domain(vc_cmd_h vc_command, int* domain)
 {
+       if (0 != __vc_cmd_get_feature_enabled()) {
+               return VC_ERROR_NOT_SUPPORTED;
+       }
+
        if (NULL == vc_command || NULL == domain) {
                SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
                return VC_ERROR_INVALID_PARAMETER;
index 161c39e..03344ed 100644 (file)
@@ -166,6 +166,9 @@ extern "C" {
 
 #define VC_RUNTIME_INFO_CLIENT         tzplatform_mkpath(TZ_USER_HOME, "share/voice/vc/vc-client-info.xml")
 
+#define VC_FEATURE_PATH                        "tizen.org/feature/speech.control"
+#define VC_MIC_FEATURE_PATH            "tizen.org/feature/microphone"
+
 /******************************************************************************************
 * Defines for common enum
 *******************************************************************************************/
index ba34513..ac100b1 100644 (file)
@@ -11,7 +11,7 @@
  * 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. 
+ * limitations under the License.
  */
 
 
  * @defgroup CAPI_UIX_VOICE_CONTROL_MODULE Voice control
  * @ingroup CAPI_UIX_FRAMEWORK
  * @brief The @ref CAPI_UIX_VOICE_CONTROL_MODULE API provides functions for registering command and getting notification when registered command is recognized.
- * 
+ *
  * @section CAPI_UIX_VOICE_CONTROL_MODULE_HEADER Required Header
  *   \#include <voice_control.h><br>
- * 
+ *
  * @section CAPI_UIX_VOICE_CONTROL_MODULE_OVERVIEW Overview
  * A main function of Voice Control API register command and gets notification for recognition result.
  * Applications can add their own commands and be provided result when their command is recognized by user voice input.
- * 
- * To use of Voice Control, use the following steps:
+ *
+ * To use of Voice Control, use the following steps: <br>
  * 1. Initialize <br>
- * 2. Register callback functions for notifications <br> 
+ * 2. Register callback functions for notifications <br>
  * 3. Connect to voice control service asynchronously. The state should be changed to Ready <br>
- * 4. Make command list as the following step <br>
+ * 4. Make command list as the following step and Step 4 is called repeatedly for each command which an application wants <br>
  * 4-1. Create command list handle <br>
  * 4-2. Create command handle <br>
  * 4-3. Set command and type for command handle <br>
  * 4-4. Add command handle to command list <br>
- * Step 4 is called repeatedly for each command which an application wants <br>
  * 5. Set command list for recognition <br>
  * 6. If an application wants to finish voice control,<br>
  * 6-1. Destroy command and command list handle <br>
  * 6-2. Deinitialize <br>
  *
- * An application can obtain command handle from command list, and also get information from handle. 
+ * An application can obtain command handle from command list, and also get information from handle.
  *
  *
- * The Voice Control API also notifies you (by callback mechanism) when the states of client and service are changed, 
+ * The Voice Control API also notifies you (by callback mechanism) when the states of client and service are changed,
  * command is recognized, current language is changed or error occurred.
- * An application should register callback functions: vc_state_changed_cb(), vc_service_state_changed_cb(), vc_result_cb(), 
+ * An application should register callback functions: vc_state_changed_cb(), vc_service_state_changed_cb(), vc_result_cb(),
  * vc_current_language_changed_cb(), vc_error_cb().
  *
  * @section CAPI_UIX_VOICE_CONTROL_MODULE_STATE_DIAGRAM State Diagram
  * The following table shows state-dependent function calls.
  * It is forbidden to call functions listed below in wrong states.
  * Violation of this rule may result in an unpredictable behavior.
- * 
+ *
  * <table>
  * <tr>
  * <th>FUNCTION</th>
  * <td> All callback function should be registered in Initialized state </td>
  * </tr>
  * </table>
- * 
- * @section CAPI_UIX_STT_MODULE_FEATURE Related Features
+ *
+ * @section CAPI_UIX_VOICE_CONTROL_MODULE Related Features
  * This API is related with the following features:<br>
  *  - http://tizen.org/feature/microphone<br>
+ *  - http://tizen.org/feature/speech.control<br>
  *
  * It is recommended to design feature related codes in your application for reliability.<br>
  * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.<br>
index e154945..575da96 100644 (file)
@@ -1,6 +1,6 @@
 Name:       voice-control
 Summary:    Voice control client library and daemon
-Version:    0.2.9
+Version:    0.2.10
 Release:    1
 Group:      Graphics & UI Framework/Voice Framework
 License:    Apache-2.0
@@ -15,6 +15,7 @@ BuildRequires:  pkgconfig(capi-base-common)
 BuildRequires:  pkgconfig(capi-media-audio-io)
 BuildRequires:  pkgconfig(capi-media-sound-manager)
 BuildRequires:  pkgconfig(capi-network-bluetooth)
+BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(dbus-1)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(ecore)