//LCOV_EXCL_STOP
}
- char uid[16];
- snprintf(uid, 16, "%d", getuid());
+ char uid[32];
+ snprintf(uid, 32, "%d", getuid());
ret = true;
ret = __check_privilege(uid, VC_PRIVILEGE);
__check_privilege_deinitialize();
/* base info */
vc_h vc;
int pid;
- int uid; /*<< unique id = pid + handle */
+ unsigned int uid; /*<< unique id = pid + handle */
int xid; /*<< main X window id */
vc_result_cb result_cb;
return true;
}
-bool vc_client_is_valid_by_uid(int uid)
+bool vc_client_is_valid_by_uid(unsigned int uid)
{
vc_client_s *data = NULL;
}
//LCOV_EXCL_START
-int vc_client_get_handle(int uid, vc_h* vc)
+int vc_client_get_handle(unsigned int uid, vc_h* vc)
{
vc_client_s *data = NULL;
return 0;
}
-int vc_client_get_client_state_by_uid(int uid, vc_state_e* state)
+int vc_client_get_client_state_by_uid(unsigned int uid, vc_state_e* state)
{
vc_client_s *data = NULL;
bool vc_client_is_valid(vc_h vc);
-bool vc_client_is_valid_by_uid(int uid);
+bool vc_client_is_valid_by_uid(unsigned int uid);
-int vc_client_get_handle(int uid, vc_h* vc);
+int vc_client_get_handle(unsigned int uid, vc_h* vc);
/*
* set/get callback function
int vc_client_get_client_state(vc_h vc, vc_state_e* state);
-int vc_client_get_client_state_by_uid(int uid, vc_state_e* state);
+int vc_client_get_client_state_by_uid(unsigned int uid, vc_state_e* state);
int vc_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* before_state);
#include "voice_control_manager_internal.h"
-#define VC_MANAGER_CONFIG_HANDLE 100000
+#define VC_MANAGER_CONFIG_HANDLE 10000000
static Ecore_Timer* g_send_hello_timer = NULL;
static Ecore_Timer* g_request_init_timer = NULL;
return VC_ERROR_PERMISSION_DENIED;
}
- char uid[16];
- snprintf(uid, 16, "%d", getuid());
+ char uid[32];
+ snprintf(uid, 32, "%d", getuid());
ret = true;
ret = __check_privilege(uid, VC_PRIVILEGE);
if (false == ret) {
/* base info */
vc_h vc;
int pid;
- int uid; /*<< unique id = pid + handle */
+ unsigned int uid; /*<< unique id = pid + handle */
vc_mgr_all_result_cb all_result_cb;
void* all_result_user_data;
return true;
}
-bool vc_mgr_client_is_valid_by_uid(int uid)
+bool vc_mgr_client_is_valid_by_uid(unsigned int uid)
{
vc_mgr_client_s *data = NULL;
return false;
}
-int vc_mgr_client_get_handle(int uid, vc_h* vc)
+int vc_mgr_client_get_handle(unsigned int uid, vc_h* vc)
{
vc_mgr_client_s *data = NULL;
return 0;
}
-int vc_mgr_client_get_client_state_by_uid(int uid, vc_state_e* state)
+int vc_mgr_client_get_client_state_by_uid(unsigned int uid, vc_state_e* state)
{
vc_mgr_client_s *data = NULL;
bool vc_mgr_client_is_valid(vc_h vc);
-bool vc_mgr_client_is_valid_by_uid(int uid);
+bool vc_mgr_client_is_valid_by_uid(unsigned int uid);
-int vc_mgr_client_get_handle(int uid, vc_h* vc);
+int vc_mgr_client_get_handle(unsigned int uid, vc_h* vc);
int vc_mgr_client_get_pid(vc_h vc, int* pid);
int vc_mgr_client_get_client_state(vc_h vc, vc_state_e* state);
-int vc_mgr_client_get_client_state_by_uid(int uid, vc_state_e* state);
+int vc_mgr_client_get_client_state_by_uid(unsigned int uid, vc_state_e* state);
int vc_mgr_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* before_state);
VC_SETTING_STATE_READY
} vc_setting_state_e;
-#define VC_SETTING_CONFIG_HANDLE 300000
+#define VC_SETTING_CONFIG_HANDLE 30000000
static vc_setting_state_e g_state = VC_SETTING_STATE_NONE;
#include "voice_control_widget.h"
-#define VC_WIDGET_CONFIG_HANDLE 200000
+#define VC_WIDGET_CONFIG_HANDLE 20000000
static Ecore_Event_Handler* g_focus_in_handler = NULL;
static Ecore_Event_Handler* g_focus_out_handler = NULL;
return true;
}
-bool vc_widget_client_is_valid_by_uid(int uid)
+bool vc_widget_client_is_valid_by_uid(unsigned int uid)
{
vc_widget_s *data = NULL;
return false;
}
-int vc_widget_client_get_handle(int uid, vc_h* vc)
+int vc_widget_client_get_handle(unsigned int uid, vc_h* vc)
{
vc_widget_s *data = NULL;
return 0;
}
-int vc_widget_client_get_state_by_uid(int uid, vc_state_e* state)
+int vc_widget_client_get_state_by_uid(unsigned int uid, vc_state_e* state)
{
vc_widget_s *data = NULL;
/* base info */
vc_h vc;
int pid;
- int uid; /*<< unique id = pid + handle */
+ unsigned int uid; /*<< unique id = pid + handle */
int xid; /*<< main Wayland window id */
vc_result_cb result_cb;
bool vc_widget_client_is_valid(vc_h vc);
-bool vc_widget_client_is_valid_by_uid(int uid);
+bool vc_widget_client_is_valid_by_uid(unsigned int uid);
-int vc_widget_client_get_handle(int uid, vc_h* vc);
+int vc_widget_client_get_handle(unsigned int uid, vc_h* vc);
vc_widget_s* widget_get(vc_h vc);
int vc_widget_client_get_state(vc_h vc, vc_state_e* state);
-int vc_widget_client_get_state_by_uid(int uid, vc_state_e* state);
+int vc_widget_client_get_state_by_uid(unsigned int uid, vc_state_e* state);
int vc_widget_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* before_state);
return VC_ERROR_PERMISSION_DENIED;
}
- char uid[16];
- snprintf(uid, 16, "%d", getuid());
+ char uid[32];
+ snprintf(uid, 32, "%d", getuid());
ret = true;
ret = __check_privilege(uid, VC_PRIVILEGE);
__check_privilege_deinitialize();
#define BUF_LEN (EVENT_SIZE + 16)
typedef struct {
- int uid;
+ unsigned int uid;
vc_config_engine_changed_cb engine_cb;
vc_config_lang_changed_cb lang_cb;
vc_config_enabled_cb enabled_cb;
return VC_ERROR_OPERATION_FAILED;
}
-int __vc_config_release_client(int uid)
+int __vc_config_release_client(unsigned int uid)
{
GSList *iter = NULL;
vc_config_client_s* temp_client = NULL;
return;
}
-int vc_config_mgr_initialize(int uid)
+int vc_config_mgr_initialize(unsigned int uid)
{
GSList *iter = NULL;
int* get_uid;
return 0;
}
-int vc_config_mgr_finalize(int uid)
+int vc_config_mgr_finalize(unsigned int uid)
{
SLOG(LOG_INFO, vc_config_tag(), "[WARNING] Enter critical section");
return 0;
}
-int vc_config_mgr_set_engine_cb(int uid, vc_config_engine_changed_cb engine_cb)
+int vc_config_mgr_set_engine_cb(unsigned int uid, vc_config_engine_changed_cb engine_cb)
{
GSList *iter = NULL;
vc_config_client_s* temp_client = NULL;
return 0;
}
-int vc_config_mgr_unset_engine_cb(int uid)
+int vc_config_mgr_unset_engine_cb(unsigned int uid)
{
GSList *iter = NULL;
vc_config_client_s* temp_client = NULL;
}
-int vc_config_mgr_set_lang_cb(int uid, vc_config_lang_changed_cb lang_cb)
+int vc_config_mgr_set_lang_cb(unsigned int uid, vc_config_lang_changed_cb lang_cb)
{
GSList *iter = NULL;
vc_config_client_s* temp_client = NULL;
return 0;
}
-int vc_config_mgr_unset_lang_cb(int uid)
+int vc_config_mgr_unset_lang_cb(unsigned int uid)
{
GSList *iter = NULL;
vc_config_client_s* temp_client = NULL;
return 0;
}
-int vc_config_mgr_set_enabled_cb(int uid, vc_config_enabled_cb enabled_cb)
+int vc_config_mgr_set_enabled_cb(unsigned int uid, vc_config_enabled_cb enabled_cb)
{
if (NULL == enabled_cb) {
SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] enabled cb is NULL : uid(%d) ", uid);
return VC_CONFIG_ERROR_INVALID_PARAMETER;
}
-int vc_config_mgr_unset_enabled_cb(int uid)
+int vc_config_mgr_unset_enabled_cb(unsigned int uid)
{
GSList *iter = NULL;
vc_config_client_s* temp_client = NULL;
typedef bool (*vc_config_supported_engine_cb)(const char *engine_name, const char *engine_appid, const char *setting, const char *default_lang, bool non_fixed_support, void *user_data);
-int vc_config_mgr_initialize(int uid);
+int vc_config_mgr_initialize(unsigned int uid);
-int vc_config_mgr_finalize(int uid);
+int vc_config_mgr_finalize(unsigned int uid);
/* Set / Unset callback */
-int vc_config_mgr_set_engine_cb(int uid, vc_config_engine_changed_cb engine_cb);
+int vc_config_mgr_set_engine_cb(unsigned int uid, vc_config_engine_changed_cb engine_cb);
-int vc_config_mgr_unset_engine_cb(int uid);
+int vc_config_mgr_unset_engine_cb(unsigned int uid);
-int vc_config_mgr_set_lang_cb(int uid, vc_config_lang_changed_cb lang_cb);
+int vc_config_mgr_set_lang_cb(unsigned int uid, vc_config_lang_changed_cb lang_cb);
-int vc_config_mgr_unset_lang_cb(int uid);
+int vc_config_mgr_unset_lang_cb(unsigned int uid);
-int vc_config_mgr_set_enabled_cb(int uid, vc_config_enabled_cb enabled_cb);
+int vc_config_mgr_set_enabled_cb(unsigned int uid, vc_config_enabled_cb enabled_cb);
-int vc_config_mgr_unset_enabled_cb(int uid);
+int vc_config_mgr_unset_enabled_cb(unsigned int uid);
int vc_config_mgr_get_auto_language(bool* value);
static Ecore_Timer *g_check_client_timer = NULL;
static Ecore_Thread* g_tts_thread = NULL;
-static int g_current_uid = -1;
+static unsigned int g_current_uid = 0;
static int g_current_utt_id = -1;
/**
/* send TTS feedback audio format to VC manager */
int ret = VCD_ERROR_NONE;
int pid = g_current_uid / 1000;
- if (-1 == g_current_uid || vcd_client_manager_get_pid() == pid) {
+ if (0 == g_current_uid || vcd_client_manager_get_pid() == pid) {
ret = vcdc_send_feedback_audio_format_to_manager(vcd_client_manager_get_pid(), rate, channel, audio_type);
if (VCD_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to send TTS feedback audio format to VC manager");
int vcd_send_feedback_streaming(vce_feedback_event_e event, char* buffer, int len)
{
- if (-1 == g_current_uid && VCE_FEEDBACK_EVENT_START == event) {
+ if (0 == g_current_uid && VCE_FEEDBACK_EVENT_START == event) {
g_current_utt_id = (g_current_utt_id + 1) % 1000;
g_current_uid = vcd_client_manager_get_pid() * 1000 + g_current_utt_id;
SLOG(LOG_INFO, TAG_VCD, "[Server info] set current uid and utt_id as manager pid(%d)", vcd_client_manager_get_pid());
if (VCE_FEEDBACK_EVENT_FINISH == event) {
/* reset current uid */
- g_current_uid = -1;
+ g_current_uid = 0;
/* Set service state to ready if state is synthesizing */
vcd_state_e state = vcd_config_get_service_state();
SLOG(LOG_WARN, TAG_VCD, "[Server Warning] Fail to create timer of client check");
}
- g_current_uid = -1;
+ g_current_uid = 0;
g_current_utt_id = -1;
SLOG(LOG_ERROR, TAG_VCD, "[Server SUCCESS] initialize");
return VCD_ERROR_INVALID_STATE;
}
- int uid = -1;
+ unsigned int uid = 0;
g_current_utt_id = (g_current_utt_id + 1) % 1000;
*utt_id = g_current_utt_id;
if (0 == to_vcm) {
vc_tts_text_data_s* tts_text_data = NULL;
- int uid = pid * 1000 + utt_id;
+ unsigned int uid = pid * 1000 + utt_id;
int ret = vcd_data_get_tts_text_data(uid, &tts_text_data);
if (0 != ret) {
SLOG(LOG_WARN, TAG_VCD, "[Server WARN] No data in vcd tts text queue");
return VCD_ERROR_NONE;
}
-int vcd_data_add_tts_text_data(int uid, vc_tts_text_data_s* data)
+int vcd_data_add_tts_text_data(unsigned int uid, vc_tts_text_data_s* data)
{
if (NULL == data) {
SLOG(LOG_ERROR, TAG_VCD, "[DATA ERROR] feedback data is NULL");
return VCD_ERROR_NONE;
}
-int vcd_data_get_tts_text_data(int uid, vc_tts_text_data_s** data)
+int vcd_data_get_tts_text_data(unsigned int uid, vc_tts_text_data_s** data)
{
SLOG(LOG_INFO, TAG_VCD, "[DATA] Get tts text data : uid(%d)", uid);
typedef struct {
- int uid;
+ unsigned int uid;
int pid;
int utt_id;
char* text;
} vc_tts_text_data_s;
-int vcd_data_add_tts_text_data(int uid, vc_tts_text_data_s* data);
+int vcd_data_add_tts_text_data(unsigned int uid, vc_tts_text_data_s* data);
int vcd_data_clear_tts_text_data(vc_tts_text_data_s** tts_text_data);
-int vcd_data_get_tts_text_data(int uid, vc_tts_text_data_s** data);
+int vcd_data_get_tts_text_data(unsigned int uid, vc_tts_text_data_s** data);
int vcd_data_get_first_tts_text_data(vc_tts_text_data_s** data);
return VCE_ERROR_PERMISSION_DENIED;
}
- char uid[16];
- snprintf(uid, 16, "%d", getuid());
+ char uid[32];
+ snprintf(uid, 32, "%d", getuid());
ret = true;
ret = __check_privilege(uid, VC_PRIVILEGE);
__check_privilege_deinitialize();