if (VCE_SPEECH_DETECT_BEGIN == speech_detected) {
if (-1 != vcd_client_manager_get_pid()) {
/* Manager client is available */
- if (0 != vcdc_send_speech_detected(vcd_client_manager_get_pid())) {
- SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to send speech detected");
- }
+ vcdc_send_speech_detected(vcd_client_manager_get_pid());
}
} else if (VCE_SPEECH_DETECT_END == speech_detected) {
if (VCD_RECOGNITION_MODE_STOP_BY_SILENCE == vcd_client_get_recognition_mode()) {
if (NULL != asr_result) {
SECURE_SLOG(LOG_INFO, TAG_VCD, "[Server] ASR result - Event(%d), Text(%s)", event, asr_result);
- ret = vcdc_send_pre_result_to_manager(vcd_client_manager_get_pid(), event, asr_result);
- if (0 != ret) {
- SECURE_SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to send ASR result : mgr_pid(%d), asr_result(%s)", vcd_client_manager_get_pid(), asr_result);
- }
+ vcdc_send_pre_result_to_manager(vcd_client_manager_get_pid(), event, asr_result);
}
return ret;
}
SLOG(LOG_ERROR, TAG_VCD, "[Server] send dialog : mgr_pid(%d), nlg_result(%s)", vcd_client_manager_get_pid(), nlg_result);
- ret = vcdc_send_dialog(vcd_client_manager_get_pid(), -1, nlg_result, NULL, 0); //0: VC_DIALOG_END
- if (0 != ret)
- SECURE_SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to send dialog : mgr_pid(%d), nlg_result(%s)", vcd_client_manager_get_pid(), nlg_result);
- return ret;
+ vcdc_send_dialog(vcd_client_manager_get_pid(), -1, nlg_result, NULL, 0); //0: VC_DIALOG_END
+
+ return VCD_ERROR_NONE;
}
static void* __recorder_stop(void *data)
if (-1 != vcd_client_manager_get_pid()) {
/* Manager client is available */
- if (0 != vcdc_send_result_to_manager(vcd_client_manager_get_pid(), VC_RESULT_TYPE_NORMAL)) {
- SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to send result");
- }
+ vcdc_send_result_to_manager(vcd_client_manager_get_pid(), VC_RESULT_TYPE_NORMAL);
} else {
SLOG(LOG_INFO, TAG_VCD, "[Server] Manager is NOT available. Send result to client directly");
ecore_timer_add(0, __vcd_send_selected_result, NULL);
if (-1 != vcd_client_manager_get_pid()) {
/* Manager client is available */
- if (0 != vcdc_send_result_to_manager(vcd_client_manager_get_pid(), VC_RESULT_TYPE_NORMAL)) {
- SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to send result");
- }
+ vcdc_send_result_to_manager(vcd_client_manager_get_pid(), VC_RESULT_TYPE_NORMAL);
} else {
SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Manager is NOT available");
}
bool temp = vcd_client_manager_get_exclusive();
vc_info_parser_set_result(all_result, event, msg, NULL, temp);
ret = vcdc_send_result_to_manager(vcd_client_manager_get_pid(), VC_RESULT_TYPE_NOTIFICATION);
- if (0 != ret) {
- SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to send result");
- }
g_restart_timer = ecore_timer_add(0, __restart_engine, NULL);
return ret;
bool temp = vcd_client_manager_get_exclusive();
vc_info_parser_set_result(all_result, event, msg, NULL, temp);
ret = vcdc_send_result_to_manager(vcd_client_manager_get_pid(), VC_RESULT_TYPE_NOTIFICATION);
- if (0 != ret) {
- SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to send result");
- }
return ret;
}
}
SLOG(LOG_INFO, TAG_VCD, "[Server DEBUG] Engine - Send TTS feedback audio format, g_current_tts_uid(%u)", g_current_tts_uid);
/* send TTS feedback audio format to VC manager */
- int ret = VCD_ERROR_NONE;
int pid = __get_tts_played_pid();
if (VC_INVALID_TTS_UID == pid || 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");
- }
+ vcdc_send_feedback_audio_format_to_manager(vcd_client_manager_get_pid(), rate, channel, audio_type);
} else {
SLOG(LOG_INFO, TAG_VCD, "[Server INFO] Do not send TTS feedback audio format to VC manager");
}
- return ret;
+ return VCD_ERROR_NONE;
}
int vcd_send_feedback_streaming(vce_feedback_event_e event, char* buffer, int len)
SLOG(LOG_INFO, TAG_VCD, "[Server info] set current uid and utt_id as manager pid(%d)", vcd_client_manager_get_pid());
}
- int ret = VCD_ERROR_NONE;
int pid = __get_tts_played_pid();
int utt_id = g_current_tts_uid % 1000;
if (VC_INVALID_TTS_UID == pid || pid == vcd_client_manager_get_pid() || -1 == vcd_client_manager_get_pid()) {
/* send TTS feedback streaming to manager client */
- ret = vcdc_send_feedback_streaming_to_manager(vcd_client_manager_get_pid(), pid, utt_id, event, buffer, len);
- if (VCD_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to send TTS feedback streaming to manager client");
- }
+ vcdc_send_feedback_streaming_to_manager(vcd_client_manager_get_pid(), pid, utt_id, event, buffer, len);
} else {
/* send TTS feedback streaming to client */
- ret = vcdc_send_feedback_streaming(pid, utt_id, event, buffer, len);
- if (VCD_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to send TTS feedback streaming to client");
- }
+ vcdc_send_feedback_streaming(pid, utt_id, event, buffer, len);
}
if (VCE_FEEDBACK_EVENT_FINISH == event) {
}
SLOG(LOG_INFO, TAG_VCD, "[Server info] feedback streaming finish event, reset current uid & service state(%d)", vcd_config_get_service_state());
}
- return ret;
+ return VCD_ERROR_NONE;
}
vcd_client_manager_unset_appid();
- int ret = vcd_config_finalize();
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server WARNING] Fail to finalize config.");
- }
+ vcd_config_finalize();
- ret = vc_db_finalize();
+ int ret = vc_db_finalize();
if (0 != ret) {
SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to finalize DB : %d", ret);
}
return VCD_ERROR_OPERATION_FAILED;
}
- if (0 != vcdc_send_manager_pid(pid))
- SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to send manager pid");
+ vcdc_send_manager_pid(pid);
vcd_recorder_set_audio_streaming_mode(mode);
/* Cancel recognition */
vcd_server_mgr_cancel();
- if (0 != vcdc_send_manager_pid(-1))
- SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to send manager pid");
+ vcdc_send_manager_pid(-1);
/* Remove manager information */
- if (0 != vcd_client_manager_unset()) {
- SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] Fail to delete client");
- }
+ vcd_client_manager_unset();
if (0 == vcd_client_get_ref_count()) {
SLOG(LOG_INFO, TAG_VCD, "[Server] Connected client list is empty");
}
/* Save client list */
- if (0 != vcd_client_manager_set_demandable_client(pid, client_list)) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to set demandable client list");
- return VCD_ERROR_OPERATION_FAILED;
- }
+ vcd_client_manager_set_demandable_client(pid, client_list);
return VCD_ERROR_NONE;
}
int fg_pid = -1;
if (true == start_by_client) {
/* Get foreground pid */
- if (0 != vcd_config_get_foreground(&fg_pid)) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to get foreground");
- }
+ vcd_config_get_foreground(&fg_pid);
/* Set client exclusive option */
if (0 != vcd_client_set_exclusive_command(fg_pid)) {
int vcd_server_mgr_set_disabled_command_type(int pid, int disabled_cmd_type)
{
- int ret = -1;
-
/* check if pid is valid */
if (false == vcd_client_manager_is_valid(pid)) {
SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] The manager pid(%d) is NOT valid", pid);
return VCD_ERROR_INVALID_STATE;
}
- ret = vcd_config_set_disabled_command_type(disabled_cmd_type);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to set command type");
- } else {
- SLOG(LOG_ERROR, TAG_VCD, "[Server] Set command type(%d)", disabled_cmd_type);
- }
+ vcd_config_set_disabled_command_type(disabled_cmd_type);
- return ret;
+ return VCD_ERROR_NONE;
}
}
if (VCD_AUDIO_STREAMING_EVENT_FINISH == event) {
- ret = vcd_recorder_stop_streaming();
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to stop streaming, ret(%d)", ret);
- return ret;
- }
+ vcd_recorder_stop_streaming();
}
return VCD_ERROR_NONE;
return VCD_ERROR_INVALID_PARAMETER;
}
- if (0 != vcd_config_set_foreground(pid, value)) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to set foreground : pid(%d), value(%d)", pid, value);
- return VCD_ERROR_OPERATION_FAILED;
- }
+ vcd_config_set_foreground(pid, value);
return VCD_ERROR_NONE;
}
return ret;
}
- ret = vcdc_send_dialog(vcd_client_manager_get_pid(), pid, disp_text, utt_text, continuous);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to send dialog : mgr_pid(%d), pid(%d), disp_text(%s), utt_text(%s), continue(%d)", vcd_client_manager_get_pid(), pid, disp_text, utt_text, continuous);
- return ret;
- }
+ vcdc_send_dialog(vcd_client_manager_get_pid(), pid, disp_text, utt_text, continuous);
}
return VCD_ERROR_NONE;
}
{
SLOG(LOG_INFO, TAG_VCD, "[Server] Get command count");
- int ret = 0;
- ret = vcd_engine_agent_get_command_count(vce_command, count);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to get command count : ret(%d)", ret);
- }
+ vcd_engine_agent_get_command_count(vce_command, count);
- return ret;
+ return VCD_ERROR_NONE;
}
int vcd_get_audio_type(char** audio_type)
return VCD_ERROR_INVALID_STATE;
}
- int ret = vcd_engine_agent_set_private_data(key, data);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to set private data to the manager client : ret(%d)", ret);
- } else {
- SLOG(LOG_INFO, TAG_VCD, "[Server] Set private data to the manager client, key(%s), data(%s)", key, data);
- }
+ vcd_engine_agent_set_private_data(key, data);
- return ret;
+ return VCD_ERROR_NONE;
}
int vcd_get_private_data(const char* key, char** data)
return VCD_ERROR_INVALID_STATE;
}
- int ret = vcd_engine_agent_get_private_data(key, data);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to get private data from the manager client : ret(%d)", ret);
- } else {
- SLOG(LOG_INFO, TAG_VCD, "[Server] Get private data from the manager client, key(%s), data(%s)", key, *data);
- }
+ vcd_engine_agent_get_private_data(key, data);
- return ret;
+ return VCD_ERROR_NONE;
}
int vcd_start_recording()
}
return ret;
-}
\ No newline at end of file
+}