dbus_connection_read_write_dispatch(g_conn_listener, 50);
- DBusMessage* msg = NULL;
- msg = dbus_connection_pop_message(g_conn_listener);
+ while(1) {
+ DBusMessage* msg = NULL;
+ msg = dbus_connection_pop_message(g_conn_listener);
- if (true != dbus_connection_get_is_connected(g_conn_listener)) {
- SLOG(LOG_ERROR, TAG_STTD, "[Dbus ERROR] Connection is disconnected");
- return ECORE_CALLBACK_RENEW;
- }
+ if (true != dbus_connection_get_is_connected(g_conn_listener)) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Dbus ERROR] Connection is disconnected");
+ return ECORE_CALLBACK_RENEW;
+ }
- /* loop again if we haven't read a message */
- if (NULL == msg) {
- return ECORE_CALLBACK_RENEW;
- }
+ /* loop again if we haven't read a message */
+ if (NULL == msg) {
+ return ECORE_CALLBACK_RENEW;
+ }
- SLOG(LOG_DEBUG, TAG_STTD, "[Dbus info] service name: %s, service object: %s, service interface: %s", (NULL == g_server_service_name) ? "NULL" : g_server_service_name,
- (NULL == g_server_service_object) ? "NULL" : g_server_service_object, (NULL == g_server_service_interface) ? "NULL" : g_server_service_interface);
+ SLOG(LOG_DEBUG, TAG_STTD, "[Dbus info] service name: %s, service object: %s, service interface: %s", (NULL == g_server_service_name) ? "NULL" : g_server_service_name,
+ (NULL == g_server_service_object) ? "NULL" : g_server_service_object, (NULL == g_server_service_interface) ? "NULL" : g_server_service_interface);
- /* client event */
- if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_HELLO))
- sttd_dbus_server_hello(g_conn_listener, msg);
+ /* client event */
+ if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_HELLO))
+ sttd_dbus_server_hello(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_INITIALIZE))
- sttd_dbus_server_initialize(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_INITIALIZE))
+ sttd_dbus_server_initialize(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_FINALIZE))
- sttd_dbus_server_finalize(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_FINALIZE))
+ sttd_dbus_server_finalize(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_SET_CURRENT_ENGINE))
- sttd_dbus_server_set_current_engine(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_SET_CURRENT_ENGINE))
+ sttd_dbus_server_set_current_engine(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_CHECK_APP_AGREED))
- sttd_dbus_server_check_app_agreed(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_CHECK_APP_AGREED))
+ sttd_dbus_server_check_app_agreed(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_GET_SUPPORT_LANGS))
- sttd_dbus_server_get_support_lang(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_GET_SUPPORT_LANGS))
+ sttd_dbus_server_get_support_lang(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_GET_CURRENT_LANG))
- sttd_dbus_server_get_default_lang(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_GET_CURRENT_LANG))
+ sttd_dbus_server_get_default_lang(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_SET_PRIVATE_DATA))
- sttd_dbus_server_set_private_data(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_SET_PRIVATE_DATA))
+ sttd_dbus_server_set_private_data(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_GET_PRIVATE_DATA))
- sttd_dbus_server_get_private_data(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_GET_PRIVATE_DATA))
+ sttd_dbus_server_get_private_data(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_IS_TYPE_SUPPORTED))
- sttd_dbus_server_is_recognition_type_supported(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_IS_TYPE_SUPPORTED))
+ sttd_dbus_server_is_recognition_type_supported(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_GET_AUDIO_FORMAT))
+ sttd_dbus_server_get_audio_format(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_SET_START_SOUND))
- sttd_dbus_server_set_start_sound(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_UNSET_START_SOUND))
- sttd_dbus_server_unset_start_sound(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_SET_START_SOUND))
+ sttd_dbus_server_set_start_sound(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_SET_STOP_SOUND))
- sttd_dbus_server_set_stop_sound(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_UNSET_START_SOUND))
+ sttd_dbus_server_unset_start_sound(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_UNSET_STOP_SOUND))
- sttd_dbus_server_unset_stop_sound(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_SET_STOP_SOUND))
+ sttd_dbus_server_set_stop_sound(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_UNSET_STOP_SOUND))
+ sttd_dbus_server_unset_stop_sound(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_START))
- sttd_dbus_server_start(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_STOP))
- sttd_dbus_server_stop(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_START))
+ sttd_dbus_server_start(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_CANCEL))
- sttd_dbus_server_cancel(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_STOP))
+ sttd_dbus_server_stop(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_START_FILE))
- sttd_dbus_server_start_file(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_START_AUDIO_STREAMING))
+ sttd_dbus_server_start_audio_streaming(g_conn_listener, msg);
- else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_CANCEL_FILE))
- sttd_dbus_server_cancel_file(g_conn_listener, msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_SEND_AUDIO_STREAMING))
+ sttd_dbus_server_send_audio_streaming(g_conn_listener, msg);
- /* free the message */
- dbus_message_unref(msg);
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_STOP_AUDIO_STREAMING))
+ sttd_dbus_server_stop_audio_streaming(g_conn_listener, msg);
+
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_CANCEL))
+ sttd_dbus_server_cancel(g_conn_listener, msg);
+
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_START_FILE))
+ sttd_dbus_server_start_file(g_conn_listener, msg);
+
+ else if (dbus_message_is_method_call(msg, g_server_service_interface, STT_METHOD_CANCEL_FILE))
+ sttd_dbus_server_cancel_file(g_conn_listener, msg);
+
+ /* free the message */
+ dbus_message_unref(msg);
+ }
return ECORE_CALLBACK_RENEW;
}