return 0;
}
+int sttdc_send_speech_status(int uid, int status)
+{
+ int pid = sttd_client_get_pid(uid);
+
+ if (0 > pid) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Dbus ERROR] pid is NOT valid");
+ return -1;
+ }
+
+ char service_name[64];
+ memset(service_name, 0, 64);
+ snprintf(service_name, 64, "%s%d", STT_CLIENT_SERVICE_NAME, pid);
+
+ char target_if_name[128];
+ snprintf(target_if_name, sizeof(target_if_name), "%s%d", STT_CLIENT_SERVICE_INTERFACE, pid);
+
+ DBusMessage* msg = NULL;
+ msg = dbus_message_new_signal(
+ STT_CLIENT_SERVICE_OBJECT_PATH, /* object name of the signal */
+ target_if_name, /* interface name of the signal */
+ STTD_METHOD_SPEECH_STATUS); /* name of the signal */
+
+ if (NULL == msg) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Dbus ERROR] Fail to create message");
+ return -1;
+ }
+
+ dbus_message_append_args(msg,
+ DBUS_TYPE_INT32, &uid,
+ DBUS_TYPE_INT32, &status,
+ DBUS_TYPE_INVALID);
+
+ if (!dbus_connection_send(g_conn_sender, msg, NULL)) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Dbus ERROR] Fail to send speech status message : Out Of Memory !");
+ } else {
+ SLOG(LOG_DEBUG, TAG_STTD, "<<<< Send speech status message : uid(%d), status(%d)", uid, status);
+ dbus_connection_flush(g_conn_sender);
+ }
+
+ dbus_message_unref(msg);
+
+ return 0;
+}
+
int sttdc_send_result(int uid, int event, const char** data, int data_count, const char* result_msg)
{
int pid = sttd_client_get_pid(uid);
}
char* ret_char = strchr(g_server_service_interface, '-');
- while(NULL != ret_char) {
+ while (NULL != ret_char) {
ret_char[0] = '_';
ret_char = strchr(g_server_service_interface, '-');
}