Move common definitions into multi-assistant's dev package 39/218439/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 22 Nov 2019 07:39:13 +0000 (16:39 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Mon, 25 Nov 2019 11:09:09 +0000 (20:09 +0900)
Change-Id: I31ad25810fe4e8d9a46245793f3d946148ab5ed6

30 files changed:
inc/multi_assistant_service_client.h [moved from inc/multi_assistant_service.h with 98% similarity]
inc/multi_assistant_service_plugin.h
inc/multi_wakeup_recognizer.h
plugins/wakeup-manager/CMakeLists.txt
plugins/wakeup-manager/dependency-default/CMakeLists.txt
plugins/wakeup-manager/dependency-default/inc/dependency_default.h
plugins/wakeup-manager/dependency-default/inc/dependency_default_audio.h
plugins/wakeup-manager/dependency-default/inc/dependency_default_button.h
plugins/wakeup-manager/dependency-default/src/dependency_default.cpp
plugins/wakeup-manager/dependency-default/src/dependency_default_audio.cpp
plugins/wakeup-manager/dependency-default/src/dependency_default_button.cpp
plugins/wakeup-manager/inc/dependency_resolver.h
plugins/wakeup-manager/inc/wakeup_audio_manager.h
plugins/wakeup-manager/inc/wakeup_engine_manager.h
plugins/wakeup-manager/inc/wakeup_interfaces.h [deleted file]
plugins/wakeup-manager/inc/wakeup_manager.h
plugins/wakeup-manager/inc/wakeup_manager_wrapper.h
plugins/wakeup-manager/inc/wakeup_policy.h
plugins/wakeup-manager/inc/wakeup_policy_default.h
plugins/wakeup-manager/inc/wakeup_policy_impl.h
plugins/wakeup-manager/src/dependency_resolver.cpp
plugins/wakeup-manager/src/wakeup_audio_manager.cpp
plugins/wakeup-manager/src/wakeup_engine_manager.cpp
plugins/wakeup-manager/src/wakeup_manager.cpp
plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp
plugins/wakeup-manager/src/wakeup_policy.cpp
plugins/wakeup-manager/src/wakeup_policy_default.cpp
src/multi_assistant_dbus_server.c
src/multi_assistant_service.c
src/multi_assistant_service_plugin.c

similarity index 98%
rename from inc/multi_assistant_service.h
rename to inc/multi_assistant_service_client.h
index 775245d..bc4e2a5 100644 (file)
@@ -89,8 +89,6 @@ typedef enum {
 } CLIENT_LAUNCH_MODE;
 int mas_launch_client_by_appid(const char *appid, CLIENT_LAUNCH_MODE launch_mode);
 
-int mas_process_voice_key_event(bool pressed);
-
 typedef enum {
        PREPROCESSING_STATE_NONE,
        PREPROCESSING_STATE_WAKEUP_PREPROCESS_ENABLED,
index 69fd1be..6191ea1 100644 (file)
@@ -19,6 +19,7 @@
 #define _MULTI_ASSISTANT_SERVICE_PLUGIN_H_
 
 #include <dlog/dlog.h>
+#include <multi_assistant_service.h>
 
 #include "multi_wakeup_recognizer.h"
 #include "multi_assistant_main.h"
 extern "C" {
 #endif
 
-typedef enum {
-       MA_PLUGIN_EVENT_VOICE_KEY_PRESSED = 0,
-       MA_PLUGIN_EVENT_VOICE_KEY_RELEASED,
-       MA_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_PUSH = MA_PLUGIN_EVENT_VOICE_KEY_RELEASED,
-       MA_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_TAP,
-} ma_plugin_event_e;
-
 typedef struct {
        int plugin_version;
        bool ui_panel_enabled;
index 03e6685..c7a4a0e 100644 (file)
 
 #include <dlog/dlog.h>
 
+#include <multi_assistant_common.h>
+#include <multi_assistant_service.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-typedef struct {
-       const char *wakeup_appid;
-       const char *wakeup_word;
-       const char *wakeup_language;
-       const char *wakeup_voice_id;
-       const char *wakeup_engine;
-       float wakeup_confidence_score;
-
-       long wakeup_start_time;
-       long wakeup_end_time;
-       bool wakeup_time_valid;
-
-       const void *extra_data;
-       int extra_data_length;
-       const char *extra_data_description;
-} wakeup_event_info;
-
-typedef enum {
-       WAKEUP_SPEECH_STREAMING_EVENT_FAIL = -1,    /**< Failed */
-       WAKEUP_SPEECH_STREAMING_EVENT_START = 1,    /**< Start event */
-       WAKEUP_SPEECH_STREAMING_EVENT_CONTINUE = 2, /**< Continue event */
-       WAKEUP_SPEECH_STREAMING_EVENT_FINISH = 3    /**< Finish event */
-} wakeup_speech_streaming_event_e;
-
-typedef enum {
-       WAKEUP_SPEECH_STATUS_NONE = -1,                                         /**< None */
-       WAKEUP_SPEECH_STATUS_BEGINNING_POINT_DETECTED = 1,      /**< Beginning point of speech is detected */
-       WAKEUP_SPEECH_STATUS_END_POINT_DETECTED = 2             /**< End point of speech is detected */
-} wakeup_speech_status_e;
-
-typedef enum {
-       WAKEUP_ASR_RESULT_EVENT_FINAL = 0,      /**< Event when either the full matched or the final result is delivered */
-       WAKEUP_ASR_RESULT_EVENT_PARTIAL,        /**< Event when the partial matched result is delivered */
-       WAKEUP_ASR_RESULT_EVENT_ERROR           /**< Event when the recognition has failed */
-} wakeup_asr_result_event_e;
-
-typedef enum {
-       MA_AUDIO_STREAMING_DATA_TYPE_CURRENT_UTTERANCE = 0,             /**< Current utterance */
-       MA_AUDIO_STREAMING_DATA_TYPE_PREVIOUS_UTTERANCE,                        /**< Previous utterance */
-       MA_AUDIO_STREAMING_DATA_TYPE_FOLLOW_UP_SPEECH                           /**< Follow-up speech */
-} ma_audio_streaming_data_type_e;
-
-typedef enum {
-       MA_ACTIVE_STATE_INACTIVE = 0,   /**< 'Inactive' state */
-       MA_ACTIVE_STATE_ACTIVE, /**< 'Active' state */
-       MA_ACTIVE_STATE_PREPROCESSING,  /**< 'Preprocessing' state */
-} ma_active_state_e;
-
-typedef enum {
-       MA_RECOGNITION_RESULT_EVENT_SUCCESS = 0,                /**< Recognition succeeded */
-       MA_RECOGNITION_RESULT_EVENT_EMPTY_TEXT,                 /**< No text result recognized */
-       MA_RECOGNITION_RESULT_EVENT_ERROR,                              /**< Unknown error occurred */
-       MA_RECOGNITION_RESULT_EVENT_FALSE_TRIGGER               /**< Turned out to be a false trigger */
-} ma_recognition_result_event_e;
-
-typedef enum {
-       MA_PREPROCESSING_ALLOW_NONE = 0,        /**< No preprocessing allowed */
-       MA_PREPROCESSING_ALLOW_UTTERANCE,       /**< Preprocessing allowed for utterance audio only */
-       MA_PREPROCESSING_ALLOW_FOLLOW_UP,       /**< Preprocessing allowed for follow-up audio only */
-       MA_PREPROCESSING_ALLOW_ALL,                     /**< Preprocessing allowed for all audio */
-} ma_preprocessing_allow_mode_e;
-
-typedef enum {
-       MA_AUDIO_STREAMING_DATA_SECTION_UTTERANCE = 0,  /**< Utterance section started */
-       MA_AUDIO_STREAMING_DATA_SECTION_WAKE_WORD,              /**< Wake word section started */
-} ma_audio_streaming_data_section_e;
-
-typedef enum {
-       WAKEUP_ENGINE_COMMAND_TARGET_ALL_ASSISTANTS = 0,        /**< All assistants - name not required */
-       WAKEUP_ENGINE_COMMAND_TARGET_SPECIFIC_ASSISTANTS,       /**< Specific assistant - name required */
-       WAKEUP_ENGINE_COMMAND_TARGET_DEPENDENCY_MODULE,         /**< Dependency module - name not required */
-} wakeup_engine_command_target_e;
-
-typedef void (*ma_audio_streaming_data_section_changed_cb)(ma_audio_streaming_data_section_e section, void* user_data);
-
-typedef void (*wakeup_service_wakeup_event_cb)(wakeup_event_info wakeup_info, const char* wakeup_word, void* user_data);
+typedef void (*wakeup_service_wakeup_event_cb)(mas_wakeup_event_info wakeup_info, const char* wakeup_word, void* user_data);
 
-typedef void (*wakeup_service_speech_streaming_cb)(wakeup_speech_streaming_event_e event, unsigned char* buffer, int len, void *user_data);
+typedef void (*wakeup_service_speech_streaming_cb)(mas_speech_streaming_event_e event, unsigned char* buffer, int len, void *user_data);
 
-typedef void (*wakeup_service_speech_status_cb)(wakeup_speech_status_e status, void *user_data);
+typedef void (*wakeup_service_speech_status_cb)(mas_speech_status_e status, void *user_data);
 
 typedef void (*wakeup_service_setting_changed_cb)(void *user_data);
 
@@ -111,7 +39,7 @@ typedef void (*wakeup_service_error_cb)(int error, const char* err_msg, void* us
 
 typedef void (*wakeup_service_streaming_section_changed_cb)(ma_audio_streaming_data_section_e section, void* user_data);
 
-typedef void (*wakeup_service_wakeup_engine_command_cb)(wakeup_engine_command_target_e target, const char* assistant_name, const char* command, void* user_data);
+typedef void (*wakeup_service_wakeup_engine_command_cb)(mas_wakeup_engine_command_target_e target, const char* assistant_name, const char* command, void* user_data);
 
 #ifdef __cplusplus
 }
index 4e322b3..1f804c1 100644 (file)
@@ -22,6 +22,7 @@ SET(WMPKG_CHECK_MODULES
        eina
        vconf
        pkgmgr-info
+       multi-assistant
 )
 
 INCLUDE(FindPkgConfig)
index a08730d..b56b4d5 100644 (file)
@@ -22,6 +22,7 @@ SET(DDPKG_CHECK_MODULES
        eina
        vconf
        pkgmgr-info
+       multi-assistant
 )
 
 INCLUDE(FindPkgConfig)
index f0e3c29..6f1f565 100644 (file)
@@ -20,6 +20,8 @@
 
 #include <tizen.h>
 
+#include <multi_assistant_service.h>
+
 #ifndef LOG_TAG
 #define LOG_TAG "dependency_default"
 #endif
 extern "C" {
 #endif
 
-typedef enum {
-       WAKEUP_SPEECH_STREAMING_EVENT_FAIL = -1,    /**< Failed */
-       WAKEUP_SPEECH_STREAMING_EVENT_START = 1,    /**< Start event */
-       WAKEUP_SPEECH_STREAMING_EVENT_CONTINUE = 2, /**< Continue event */
-       WAKEUP_SPEECH_STREAMING_EVENT_FINISH = 3    /**< Finish event */
-} wakeup_speech_streaming_event_e;
-
-typedef enum {
-       MA_PLUGIN_EVENT_VOICE_KEY_PRESSED = 0,
-       MA_PLUGIN_EVENT_VOICE_KEY_RELEASED,
-       MA_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_PUSH = MA_PLUGIN_EVENT_VOICE_KEY_RELEASED,
-       MA_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_TAP,
-} ma_plugin_event_e;
-
-typedef enum
-{
-       RECORDING_SESSION_WAKE_WORD,
-       RECORDING_SESSION_UTTERANCE,
-       RECORDING_SESSION_FOLLOW_UP,
-} recording_session;
-
-typedef void (*mas_dependency_error_cb)(int error, const char* err_msg, void* user_data);
-
-typedef int (*mas_proxy_process_event)(int event, void* data, int len);
-typedef int (*mas_proxy_feed_audio_data)(wakeup_speech_streaming_event_e event, void* buffer, int len);
-
-typedef struct {
-       mas_proxy_process_event                                         process_event;
-       mas_proxy_feed_audio_data                                       feed_audio_data;
-} mas_proxy_interface;
-
-EXPORT_API int mas_dependency_initialize(mas_proxy_interface interfaces, int *dependency_version);
+EXPORT_API int mas_dependency_initialize(mas_dependency_plugin_proxy_interface interfaces, int *dependency_version);
 EXPORT_API int mas_dependency_deinitialize(void);
-EXPORT_API int mas_dependency_set_error_callback(mas_dependency_error_cb callback, void* user_data);
+EXPORT_API int mas_dependency_set_error_callback(mas_error_cb callback, void* user_data);
 EXPORT_API int mas_dependency_start_recording(void);
 EXPORT_API int mas_dependency_stop_recording(void);
 EXPORT_API int mas_dependency_set_recording_session(unsigned int session);
index a51bb03..d723e00 100644 (file)
@@ -17,7 +17,9 @@
 #ifndef _DEPENDENCY_DEFAULT_AUDIO_H_
 #define _DEPENDENCY_DEFAULT_AUDIO_H_
 
-void dependency_default_audio_initialize(mas_proxy_interface interface);
+#include "dependency_default.h"
+
+void dependency_default_audio_initialize(mas_dependency_plugin_proxy_interface  interface);
 void dependency_default_audio_deinitialize();
 
 void dependency_default_audio_start_recording();
index 4639c4b..043283a 100644 (file)
@@ -17,7 +17,9 @@
 #ifndef _DEPENDENCY_DEFAULT_BUTTON_H_
 #define _DEPENDENCY_DEFAULT_BUTTON_H_
 
-void dependency_default_button_initialize(mas_proxy_interface interface);
+#include "dependency_default.h"
+
+void dependency_default_button_initialize(mas_dependency_plugin_proxy_interface interface);
 void dependency_default_button_deinitialize();
 
 #endif //_DEPENDENCY_DEFAULT_BUTTON_H_
index e3d859d..7ca62bc 100644 (file)
@@ -7,12 +7,12 @@
 
 #include <thread>
 
-static mas_proxy_interface g_proxy_interface;
+static mas_dependency_plugin_proxy_interface g_proxy_interface;
 const int g_dependency_version = 1;
 
 static bool g_should_exit = false;
 
-int mas_dependency_initialize(mas_proxy_interface interface, int *dependency_version)
+int mas_dependency_initialize(mas_dependency_plugin_proxy_interface interface, int *dependency_version)
 {
        g_proxy_interface = interface;
 
@@ -48,7 +48,7 @@ int mas_dependency_deinitialize(void)
        return 0;
 }
 
-int mas_dependency_set_error_callback(mas_dependency_error_cb callback, void* user_data)
+int mas_dependency_set_error_callback(mas_error_cb callback, void* user_data)
 {
        return 0;
 }
index d1662c8..e1cb9ab 100644 (file)
@@ -1,8 +1,7 @@
-#include "dependency_default.h"
 #include "dependency_default_audio.h"
 
 static bool g_voice_key_pressed = false;
-static mas_proxy_interface g_proxy_interface;
+static mas_dependency_plugin_proxy_interface g_proxy_interface;
 
 #include <stdlib.h>
 #include <thread>
@@ -119,7 +118,7 @@ static void _audio_in_state_changed_cb(audio_in_h handle, audio_io_state_e previ
        }
 }
 
-void dependency_default_audio_initialize(mas_proxy_interface interfaces)
+void dependency_default_audio_initialize(mas_dependency_plugin_proxy_interface interfaces)
 {
        const int rate = 16000;
        const audio_channel_e channel = AUDIO_CHANNEL_MONO;
@@ -282,7 +281,7 @@ static void recorder_thread_func()
                        break;
                }
 
-               g_proxy_interface.feed_audio_data(WAKEUP_SPEECH_STREAMING_EVENT_CONTINUE,
+               g_proxy_interface.feed_audio_data(MAS_SPEECH_STREAMING_EVENT_CONTINUE,
                        buffer, read_bytes);
 
                /* Audio read log */
@@ -331,9 +330,9 @@ void dependency_default_audio_stop_recording()
 void dependency_default_audio_set_recording_session(unsigned int session)
 {
        LOGD("Current recording session : [%s]",
-               (RECORDING_SESSION_WAKE_WORD == session) ? "wake word detecting" :
-               (RECORDING_SESSION_UTTERANCE == session) ? "utterance recording" :
-               (RECORDING_SESSION_FOLLOW_UP == session) ? "follow-up speech recording" :
+               (MAS_RECORDING_SESSION_WAKE_WORD == session) ? "wake word detecting" :
+               (MAS_RECORDING_SESSION_UTTERANCE == session) ? "utterance recording" :
+               (MAS_RECORDING_SESSION_FOLLOW_UP == session) ? "follow-up speech recording" :
                "ERROR - Invalid recording session information"
        );
 }
index 5b39979..6803bdb 100644 (file)
@@ -1,11 +1,10 @@
-#include "dependency_default.h"
 #include "dependency_default_button.h"
 
 #include <dlog.h>
 
-static mas_proxy_interface g_proxy_interface;
+static mas_dependency_plugin_proxy_interface g_proxy_interface;
 
-void dependency_default_button_initialize(mas_proxy_interface interface)
+void dependency_default_button_initialize(mas_dependency_plugin_proxy_interface interface)
 {
        g_proxy_interface = interface;
 }
index cb12633..995c8cd 100644 (file)
 #define _DEPENDENCY_RESOLVER_H_
 
 #include <tzplatform_config.h>
+#include <multi_assistant_service.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-typedef void (*mas_dependency_error_cb)(int error, const char* err_msg, void* user_data);
-
-typedef int (*mas_proxy_process_event)(int event, void* data, int len);
-typedef int (*mas_proxy_feed_audio_data)(wakeup_speech_streaming_event_e event, void* buffer, int len);
-
-typedef struct {
-       mas_proxy_process_event                                         process_event;
-       mas_proxy_feed_audio_data                                       feed_audio_data;
-} mas_proxy_interface;
-
-int dependency_resolver_initialize(mas_proxy_interface interface);
+int dependency_resolver_initialize(mas_dependency_plugin_proxy_interface interface);
 int dependency_resolver_deinitialize(void);
-int dependency_resolver_set_error_callback(mas_dependency_error_cb callback, void* user_data);
+int dependency_resolver_set_error_callback(mas_error_cb callback, void* user_data);
 int dependency_resolver_start_recording();
 int dependency_resolver_stop_recording();
 int dependency_resolver_set_recording_session(unsigned int);
@@ -53,11 +44,11 @@ int dependency_resolver_process_wakeup_engine_command(const char* engine, const
 #define MAS_DEPENDENCY_MODULE_PATH "db/multi-assistant/dependency_module_path"
 
 #define MAS_DEPENDENCY_FUNC_INITIALIZE "mas_dependency_initialize"
-typedef int (*mas_dependency_initialize)(mas_proxy_interface interface, int *dependency_version);
+typedef int (*mas_dependency_initialize)(mas_dependency_plugin_proxy_interface interface, int *dependency_version);
 #define MAS_DEPENDENCY_FUNC_DEINITIALIZE "mas_dependency_deinitialize"
 typedef int (*mas_dependency_deinitialize)(void);
 #define MAS_DEPENDENCY_FUNC_SET_ERROR_CALLBACK "mas_dependency_set_error_callback"
-typedef int (*mas_dependency_set_error_callback)(mas_dependency_error_cb callback, void* user_data);
+typedef int (*mas_dependency_set_error_callback)(mas_error_cb callback, void* user_data);
 #define MAS_DEPENDENCY_FUNC_START_RECORDING "mas_dependency_start_recording"
 typedef int (*mas_dependency_start_recording)(void);
 #define MAS_DEPENDENCY_FUNC_STOP_RECORDING "mas_dependency_stop_recording"
@@ -84,7 +75,7 @@ typedef struct {
        mas_dependency_get_audio_format                                                 get_audio_format;
        mas_dependency_get_audio_source_type                                    get_audio_source_type;
        mas_dependency_process_wakeup_engine_command                    process_wakeup_engine_command;
-} mas_dependency;
+} mas_dependency_module_interface;
 
 #ifdef __cplusplus
 }
index 966e77a..0b81d89 100644 (file)
 #ifndef _WAKEUP_AUDIO_MANAGER_H_
 #define _WAKEUP_AUDIO_MANAGER_H_
 
-#include "wakeup_interfaces.h"
-
 #include <atomic>
 #include <list>
 #include <mutex>
 #include <thread>
 #include <vector>
 
+#include <multi_assistant_service.h>
 #include <audio_io.h>
 #include <sound_manager.h>
 #include <sound_manager_internal.h>
@@ -43,7 +42,7 @@ public:
        virtual ~IAudioEventObserver() = default;
        virtual bool on_recording_audio_data(long time, void* data, int len) = 0;
        virtual bool on_streaming_audio_data(
-               wakeup_speech_streaming_event_e event, void* buffer, unsigned int len) = 0;
+               mas_speech_streaming_event_e event, void* buffer, unsigned int len) = 0;
 };
 
 typedef enum
@@ -76,7 +75,7 @@ public:
 
        void set_recording_session(recording_session session);
 
-       void feed_audio_data(wakeup_speech_streaming_event_e event, void* buffer, int len);
+       void feed_audio_data(mas_speech_streaming_event_e event, void* buffer, int len);
        void finalize_audio_data();
        void clear_audio_data();
 
@@ -91,7 +90,7 @@ public:
 
        void set_background_volume(double ratio);
 private:
-       void add_audio_data(wakeup_speech_data& data, long time);
+       void add_audio_data(mas_speech_data& data, long time);
        void notify_audio_data_recording(long time, void* data, int len);
 
        void streaming_previous_audio_data_thread_func();
@@ -112,10 +111,10 @@ private:
        static constexpr long mAudioRecordingDurationMilliseconds = 10 * 1000;
        typedef struct {
                long time;
-               wakeup_speech_data data;
-       } wakeup_speech_data_with_time;
-       vector<wakeup_speech_data_with_time> mPreviousAudioData;
-       list<wakeup_speech_data_with_time> mAudioData;
+               mas_speech_data data;
+       } mas_speech_data_with_time;
+       vector<mas_speech_data_with_time> mPreviousAudioData;
+       list<mas_speech_data_with_time> mAudioData;
 
        mutex mMutex;
        bool mVoiceKeyPressed{false};
index cdf6f69..83d5b77 100644 (file)
@@ -67,11 +67,11 @@ typedef int (*wakeup_engine_feed_audio_data)(long time, void* data, int len);
 #define MA_WAKEUP_ENGINE_FUNC_GET_UTTERANCE_DATA_COUNT "wakeup_engine_get_utterance_data_count"
 typedef int (*wakeup_engine_get_utterance_data_count)(void);
 #define MA_WAKEUP_ENGINE_FUNC_GET_UTTERANCE_DATA "wakeup_engine_get_utterance_data"
-typedef int (*wakeup_engine_get_utterance_data)(int index, wakeup_speech_data *data);
+typedef int (*wakeup_engine_get_utterance_data)(int index, mas_speech_data *data);
 #define MA_WAKEUP_ENGINE_FUNC_GET_WAKE_WORD_DATA_COUNT "wakeup_engine_get_wake_word_data_count"
 typedef int (*wakeup_engine_get_wake_word_data_count)(void);
 #define MA_WAKEUP_ENGINE_FUNC_GET_WAKE_WORD_DATA "wakeup_engine_get_wake_word_data"
-typedef int (*wakeup_engine_get_wake_word_data)(int index, wakeup_speech_data *data);
+typedef int (*wakeup_engine_get_wake_word_data)(int index, mas_speech_data *data);
 #define MA_WAKEUP_ENGINE_FUNC_SET_ASSISTANT_SPECIFIC_COMMAND "wakeup_engine_set_assistant_specific_command"
 typedef int (*wakeup_engine_set_assistant_specific_command)(const char* appid, const char* command);
 #define MA_WAKEUP_ENGINE_FUNC_SET_WAKE_WORD_AUDIO_REQUIRE_FLAG "wakeup_engine_set_wake_word_audio_require_flag"
@@ -90,6 +90,8 @@ typedef int (*wakeup_engine_set_wakeup_engine_command_callback)(wakeup_service_e
 /* Interfaces after version 1 */
 #define MA_WAKEUP_ENGINE_FUNC_GET_VERSION "wakeup_engine_get_version"
 typedef int (*wakeup_engine_get_version)(int* version);
+#define MA_WAKEUP_ENGINE_FUNC_SET_DEPENDENCY_MODULE_COMMAND "wakeup_engine_set_dependency_module_command"
+typedef int (*wakeup_engine_set_dependency_module_command)(const char* command);
 
 typedef struct {
        wakeup_engine_initialize                                                                initialize;
@@ -111,6 +113,7 @@ typedef struct {
        wakeup_engine_get_version                                                               get_version;
        wakeup_engine_set_assistant_specific_command                    set_assistant_specific_command;
        wakeup_engine_set_wake_word_audio_require_flag                  set_wake_word_audio_require_flag;
+       wakeup_engine_set_dependency_module_command                             set_dependency_module_command;
        wakeup_engine_set_wakeup_event_callback                                 set_wakeup_event_callback;
        wakeup_engine_set_speech_status_callback                                set_speech_status_callback;
        wakeup_engine_set_error_callback                                                set_error_callback;
@@ -122,16 +125,16 @@ class IEngineEventObserver
 {
 public:
        virtual ~IEngineEventObserver() = default;
-       virtual bool on_wakeup_event(string engine_name, wakeup_event_info wakeup_info) = 0;
-       virtual bool on_speech_status(string engine_name, wakeup_service_speech_status_e status) = 0;
+       virtual bool on_wakeup_event(string engine_name, mas_wakeup_event_info wakeup_info) = 0;
+       virtual bool on_speech_status(string engine_name, mas_speech_status_e status) = 0;
        virtual bool on_error(string engine_name, int error_code, string error_message) = 0;
        virtual bool on_audio_data_require_status(string engine_name, bool require) = 0;
 
        virtual bool on_streaming_audio_data(
-               wakeup_speech_streaming_event_e event, void* buffer, unsigned int len) = 0;
+               mas_speech_streaming_event_e event, void* buffer, unsigned int len) = 0;
        virtual bool on_audio_streaming_data_section(ma_audio_streaming_data_section_e section) = 0;
        virtual bool on_wakeup_engine_command(
-               wakeup_engine_command_target_e target, string engine_name, string assistant_name, string command) = 0;
+               mas_wakeup_engine_command_target_e target, string engine_name, string assistant_name, string command) = 0;
 };
 
 class CWakeupEngineManager
@@ -151,7 +154,7 @@ public:
        void unsubscribe(IEngineEventObserver *observer);
 
        bool get_audio_data_required();
-       void set_selected_wakeup_info(wakeup_event_info wakeup_info);
+       void set_selected_wakeup_info(mas_wakeup_event_info wakeup_info);
 
        bool set_language(string language);
        bool set_assistant_language(string appid, string language);
@@ -168,14 +171,15 @@ public:
        void engine_add_target_assistant(string engine_name, string appid);
        void engine_add_wakeup_word(string appid, string wakeup_word, string language);
        void engine_set_assistant_specific_command(string appid, string command);
+       void engine_set_dependency_module_command(string engine_name, string command);
        void engine_feed_audio_data(long time, void* data, int len);
 
-       bool on_wakeup_event(string engine_name, wakeup_event_info wakeup_info);
-       bool on_speech_status(string engine_name, wakeup_service_speech_status_e status);
+       bool on_wakeup_event(string engine_name, mas_wakeup_event_info wakeup_info);
+       bool on_speech_status(string engine_name, mas_speech_status_e status);
        bool on_error(string engine_name, int error_code, string error_message);
        bool on_audio_data_require_status(string engine_name, bool require);
        bool on_wakeup_engine_command(string engine_name,
-               wakeup_engine_command_target_e target, string assistant_name, string command);
+               mas_wakeup_engine_command_target_e target, string assistant_name, string command);
 private:
        typedef struct {
                int version;
diff --git a/plugins/wakeup-manager/inc/wakeup_interfaces.h b/plugins/wakeup-manager/inc/wakeup_interfaces.h
deleted file mode 100644 (file)
index 6d12de9..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2018  Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * 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.
- */
-
-#ifndef _WAKEUP_INTERFACES_H_
-#define _WAKEUP_INTERFACES_H_
-
-typedef struct {
-       const char *wakeup_appid;
-       const char *wakeup_word;
-       const char *wakeup_language;
-       const char *wakeup_voice_id;
-       const char *wakeup_engine;
-       float wakeup_confidence_score;
-
-       long wakeup_start_time;
-       long wakeup_end_time;
-       bool wakeup_time_valid;
-
-       const void *extra_data;
-       int extra_data_length;
-       const char *extra_data_description;
-} wakeup_event_info;
-
-typedef enum {
-       WAKEUP_SPEECH_STREAMING_EVENT_FAIL = -1,    /**< Failed */
-       WAKEUP_SPEECH_STREAMING_EVENT_START = 1,    /**< Start event */
-       WAKEUP_SPEECH_STREAMING_EVENT_CONTINUE = 2, /**< Continue event */
-       WAKEUP_SPEECH_STREAMING_EVENT_FINISH = 3    /**< Finish event */
-} wakeup_speech_streaming_event_e;
-
-typedef struct {
-       wakeup_speech_streaming_event_e event;
-       void* buffer;
-       int len;
-} wakeup_speech_data;
-
-#endif /* _WAKEUP_INTERFACES_H_ */
\ No newline at end of file
index 3c7ba95..a53d36c 100644 (file)
@@ -44,12 +44,12 @@ enum class STREAMING_MODE {
 class IWakeupEventObserver {
 public:
        virtual ~IWakeupEventObserver() = default;
-       virtual void on_wakeup(wakeup_event_info wakeup_info) = 0;
+       virtual void on_wakeup(mas_wakeup_event_info wakeup_info) = 0;
        virtual void on_streaming_audio_data(
-               wakeup_speech_streaming_event_e event, void* buffer, unsigned int len) = 0;
+               mas_speech_streaming_event_e event, void* buffer, unsigned int len) = 0;
        virtual void on_audio_streaming_data_section(ma_audio_streaming_data_section_e section) = 0;
        virtual void on_wakeup_engine_command(
-               wakeup_engine_command_target_e target, const char* name, const char* command) = 0;
+               mas_wakeup_engine_command_target_e target, const char* name, const char* command) = 0;
 };
 
 class ISettingValueObserver {
@@ -97,7 +97,7 @@ public:
        bool send_assistant_specific_command(string appid, string command);
        bool set_background_volume(string appid, double ratio);
        bool update_recognition_result(string appid, int result);
-       bool process_event(ma_plugin_event_e event, void* data, int len);
+       bool process_event(mas_plugin_event_e event, void* data, int len);
        bool get_audio_format(int* rate, int* channel, int* audio_type);
        bool get_audio_source_type(char** type);
        bool set_language(string language);
@@ -120,28 +120,29 @@ public:
        CWakeupSettings* get_wakeup_settings();
 
        vector<IWakeupEventObserver*> get_wakeup_observers();
-       void set_last_wakeup_event_info(wakeup_event_info wakeup_info);
+       void set_last_wakeup_event_info(mas_wakeup_event_info wakeup_info);
 
        vector<ISettingValueObserver*> get_setting_observers();
 
        bool change_manager_state(wakeup_manager_state_e state);
        wakeup_manager_state_e get_manager_state();
 
-       void feed_audio_data(wakeup_speech_streaming_event_e event, void* buffer, int len);
+       void feed_audio_data(mas_speech_streaming_event_e event, void* buffer, int len);
+       void send_dependency_module_command(string engine_name, string command);
 private:
        class CEngineEventObserver : public IEngineEventObserver
        {
        public:
-               bool on_wakeup_event(string engine_name, wakeup_event_info wakeup_info) override;
-               bool on_speech_status(string engine_name, wakeup_service_speech_status_e status) override;
+               bool on_wakeup_event(string engine_name, mas_wakeup_event_info wakeup_info) override;
+               bool on_speech_status(string engine_name, mas_speech_status_e status) override;
                bool on_error(string engine_name, int error_code, string error_message) override;
                bool on_audio_data_require_status(string engine_name, bool require) override;
 
                bool on_streaming_audio_data(
-                       wakeup_speech_streaming_event_e event, void* buffer, unsigned int len) override;
+                       mas_speech_streaming_event_e event, void* buffer, unsigned int len) override;
                bool on_audio_streaming_data_section(ma_audio_streaming_data_section_e section) override;
                bool on_wakeup_engine_command(
-                       wakeup_engine_command_target_e target, string engine, string name, string command) override;
+                       mas_wakeup_engine_command_target_e target, string engine, string name, string command) override;
 
                void set_wakeup_manager(CWakeupManager *manager) { mWakeupManager = manager; }
        private:
@@ -151,7 +152,7 @@ private:
        class CPolicyEventObserver : public IPolicyEventObserver
        {
        public:
-               void on_wakeup(wakeup_event_info wakeup_info) override;
+               void on_wakeup(mas_wakeup_event_info wakeup_info) override;
 
                void set_wakeup_manager(CWakeupManager *manager) { mWakeupManager = manager; }
        private:
@@ -163,7 +164,7 @@ private:
        public:
                bool on_recording_audio_data(long time, void* data, int len) override;
                bool on_streaming_audio_data(
-                       wakeup_speech_streaming_event_e event, void* buffer, unsigned int len) override;
+                       mas_speech_streaming_event_e event, void* buffer, unsigned int len) override;
 
                void set_wakeup_manager(CWakeupManager *manager) { mWakeupManager = manager; }
                void set_wakeup_engine_manager(CWakeupEngineManager *manager) { mEngineManager = manager; }
@@ -220,7 +221,7 @@ private:
 
        wakeup_manager_state_e mWakeupManagerState{WAKEUP_MANAGER_STATE_INACTIVE};
 
-       wakeup_event_info mLastWakeupEventInfo;
+       mas_wakeup_event_info mLastWakeupEventInfo;
 };
 
 } // wakeup
index 1e975b9..0af69cf 100644 (file)
 #include <tizen.h>
 #include <tzplatform_config.h>
 
-#include "wakeup_interfaces.h"
+#include <multi_assistant_service.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 typedef enum {
-       WAKEUP_SPEECH_STATUS_NONE = -1,                                         /**< None */
-       WAKEUP_SPEECH_STATUS_BEGINNING_POINT_DETECTED = 1,      /**< Beginning point of speech is detected */
-       WAKEUP_SPEECH_STATUS_END_POINT_DETECTED = 2             /**< End point of speech is detected */
-} wakeup_service_speech_status_e;
-
-typedef enum {
        WAKEUP_MANAGER_STATE_INACTIVE = 0,
        WAKEUP_MANAGER_STATE_LISTENING = 1,
        WAKEUP_MANAGER_STATE_UTTERANCE = 2,
@@ -43,31 +37,13 @@ typedef enum {
        WAKEUP_MANAGER_STATE_VOICE_FEEDBACK = 4
 } wakeup_manager_state_e;
 
-typedef enum {
-       MA_PREPROCESSING_ALLOW_NONE = 0,        /**< No preprocessing allowed */
-       MA_PREPROCESSING_ALLOW_UTTERANCE,       /**< Preprocessing allowed for utterance audio only */
-       MA_PREPROCESSING_ALLOW_FOLLOW_UP,       /**< Preprocessing allowed for follow-up audio only */
-       MA_PREPROCESSING_ALLOW_ALL,                     /**< Preprocessing allowed for all audio */
-} ma_preprocessing_allow_mode_e;
-
-typedef enum {
-       MA_AUDIO_STREAMING_DATA_SECTION_UTTERANCE = 0,  /**< Utterance section started */
-       MA_AUDIO_STREAMING_DATA_SECTION_WAKE_WORD,              /**< Wake word section started */
-} ma_audio_streaming_data_section_e;
-
-typedef enum {
-       WAKEUP_ENGINE_COMMAND_TARGET_ALL_ASSISTANTS = 0,        /**< All assistants - name not required */
-       WAKEUP_ENGINE_COMMAND_TARGET_SPECIFIC_ASSISTANT,        /**< Specific assistant - name required */
-       WAKEUP_ENGINE_COMMAND_TARGET_DEPENDENCY_MODULE,         /**< Dependency module - name not required */
-} wakeup_engine_command_target_e;
-
 typedef void (*ma_audio_streaming_data_section_changed_cb)(ma_audio_streaming_data_section_e section, void* user_data);
 
-typedef void (*wakeup_service_wakeup_event_cb)(wakeup_event_info wakeup_info, void* user_data);
+typedef void (*wakeup_service_wakeup_event_cb)(mas_wakeup_event_info wakeup_info, void* user_data);
 
-typedef void (*wakeup_service_speech_streaming_cb)(wakeup_speech_streaming_event_e event, void* buffer, int len, void *user_data);
+typedef void (*wakeup_service_speech_streaming_cb)(mas_speech_streaming_event_e event, void* buffer, int len, void *user_data);
 
-typedef void (*wakeup_service_speech_status_cb)(wakeup_service_speech_status_e status, void *user_data);
+typedef void (*wakeup_service_speech_status_cb)(mas_speech_status_e status, void *user_data);
 
 typedef void (*wakeup_service_setting_changed_cb)( void *user_data);
 
@@ -77,19 +53,7 @@ typedef void (*wakeup_service_audio_data_require_status_cb)(bool require, void*
 
 typedef void (*wakeup_service_streaming_section_changed_cb)(ma_audio_streaming_data_section_e section, void* user_data);
 
-typedef void (*wakeup_service_engine_command_cb)(wakeup_engine_command_target_e target, const char* assistant_name, const char* command, void* user_data);
-
-typedef enum {
-       MA_PLUGIN_EVENT_VOICE_KEY_PRESSED = 0,
-       MA_PLUGIN_EVENT_VOICE_KEY_RELEASED,
-       MA_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_PUSH = MA_PLUGIN_EVENT_VOICE_KEY_RELEASED,
-       MA_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_TAP,
-} ma_plugin_event_e;
-
-typedef enum {
-       MA_SYSTEM_VOLUME_EVENT_CHANGE,
-       MA_SYSTEM_VOLUME_EVENT_RECOVER
-} ma_system_volume_event_e;
+typedef void (*wakeup_service_engine_command_cb)(mas_wakeup_engine_command_target_e target, const char* assistant_name, const char* command, void* user_data);
 
 typedef struct {
        int plugin_version;
@@ -126,7 +90,7 @@ EXPORT_API int wakeup_manager_set_background_volume(const char *appid, double ra
 
 EXPORT_API int wakeup_manager_update_recognition_result(const char *appid, int result);
 
-EXPORT_API int wakeup_manager_process_event(int event, void* data, int len);
+EXPORT_API int wakeup_manager_process_event(mas_plugin_event_e event, void* data, int len);
 
 EXPORT_API int wakeup_manager_start_streaming_utterance_data(void);
 
@@ -168,7 +132,9 @@ EXPORT_API int wakeup_manager_set_wakeup_engine_command_callback(wakeup_service_
 
 /* Internal API declarations for dependency modules */
 
-int wakeup_manager_feed_audio_data(wakeup_speech_streaming_event_e event, void* buffer, int len);
+int wakeup_manager_feed_audio_data(mas_speech_streaming_event_e event, void* buffer, int len);
+
+int wakeup_manager_send_dependency_module_command(const char* engine_name, const char* command);
 
 #ifdef __cplusplus
 }
index d1738ab..0cedcda 100644 (file)
@@ -20,7 +20,7 @@
 #include <string>
 #include <memory>
 
-#include "wakeup_interfaces.h"
+#include <multi_assistant_service.h>
 
 namespace multiassistant
 {
@@ -33,7 +33,7 @@ class IPolicyEventObserver
 {
 public:
        virtual ~IPolicyEventObserver() = default;
-       virtual void on_wakeup(wakeup_event_info wakeup_info) = 0;
+       virtual void on_wakeup(mas_wakeup_event_info wakeup_info) = 0;
 };
 
 class CWakeupPolicyImpl;
@@ -51,7 +51,7 @@ public:
        void subscribe(IPolicyEventObserver *observer);
        void unsubscribe(IPolicyEventObserver *observer);
 
-       virtual void wakeup_candidate(wakeup_event_info wakeup_info) = 0;
+       virtual void wakeup_candidate(mas_wakeup_event_info wakeup_info) = 0;
 protected:
        unique_ptr<CWakeupPolicyImpl> mImpl;
 };
index be20625..6dc132c 100644 (file)
@@ -41,7 +41,7 @@ public:
        void set_assistant_priority(string appid, int priority);
        void set_delay(float seconds);
 
-       void wakeup_candidate(wakeup_event_info wakeup_info);
+       void wakeup_candidate(mas_wakeup_event_info wakeup_info);
        void timer_expired();
 private:
        typedef struct {
@@ -51,7 +51,7 @@ private:
 
        float mDelaySeconds{0.0f};
        vector<PRIORITY_INFO> mPriorityInfos;
-       vector<wakeup_event_info> mWakeupInfos;
+       vector<mas_wakeup_event_info> mWakeupInfos;
 
        Ecore_Timer *mTimer{nullptr};
 };
index 63723f1..8a615f8 100644 (file)
@@ -35,7 +35,7 @@ public:
        void subscribe(IPolicyEventObserver *observer);
        void unsubscribe(IPolicyEventObserver *observer);
 
-       void wakeup(wakeup_event_info wakeup_info);
+       void wakeup(mas_wakeup_event_info wakeup_info);
 private:
        vector<IPolicyEventObserver*> mObservers;
 };
index 793d38f..7f89343 100644 (file)
@@ -33,9 +33,9 @@
 #define LOG_TAG "dependency-resolver"
 
 static void *g_handle = NULL;
-static mas_dependency g_mas_dependency = { NULL, };
+static mas_dependency_module_interface g_mas_dependency = { NULL, };
 
-int dependency_resolver_initialize(mas_proxy_interface interface)
+int dependency_resolver_initialize(mas_dependency_plugin_proxy_interface interface)
 {
        MAS_LOGD("[Enter]");
 
@@ -144,7 +144,7 @@ int dependency_resolver_deinitialize(void)
        return ret;
 }
 
-int dependency_resolver_set_error_callback(mas_dependency_error_cb callback, void* user_data)
+int dependency_resolver_set_error_callback(mas_error_cb callback, void* user_data)
 {
        int ret = -1;
        if (NULL != g_handle) {
index 94ce56e..201c8a6 100644 (file)
@@ -1,6 +1,5 @@
 #include "wakeup_audio_manager.h"
 #include "wakeup_manager_main.h"
-#include "wakeup_interfaces.h"
 #include "dependency_resolver.h"
 #include "heap_tracer.h"
 
@@ -179,7 +178,7 @@ void CAudioManager::streaming_previous_audio_data_thread_func()
        lock.lock();
        audio_data_size = mPreviousAudioData.size();
        for (int index = 0; index < audio_data_size; index++) {
-               wakeup_speech_data& speech_data = mPreviousAudioData.at(index).data;
+               mas_speech_data& speech_data = mPreviousAudioData.at(index).data;
                for (const auto& observer : mObservers) {
                        if (observer) {
                                if (!observer->on_streaming_audio_data(
@@ -188,7 +187,7 @@ void CAudioManager::streaming_previous_audio_data_thread_func()
                                }
                        }
 
-                       if (WAKEUP_SPEECH_STREAMING_EVENT_FINISH == speech_data.event) {
+                       if (MAS_SPEECH_STREAMING_EVENT_FINISH == speech_data.event) {
                                MWR_LOGI("[INFO] Finish to send previous speech data");
                                return;
                        }
@@ -255,7 +254,7 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time)
                                        for (const auto& observer : mObservers) {
                                                if (observer) {
                                                        if (!observer->on_streaming_audio_data(
-                                                               WAKEUP_SPEECH_STREAMING_EVENT_FAIL, NULL, 0)) {
+                                                               MAS_SPEECH_STREAMING_EVENT_FAIL, NULL, 0)) {
                                                                LOGE("[Recorder WARNING] One of the observer returned false");
                                                        }
                                                }
@@ -275,7 +274,7 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time)
 
                /* FIXME : Extracted audio data here should be used as previous audio data*/
 
-               wakeup_speech_data& speech_data = iter->data;
+               mas_speech_data& speech_data = iter->data;
                for (const auto& observer : mObservers) {
                        if (observer) {
                                if (!observer->on_streaming_audio_data(
@@ -285,7 +284,7 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time)
                        }
                }
 
-               if (WAKEUP_SPEECH_STREAMING_EVENT_FINISH == speech_data.event) {
+               if (MAS_SPEECH_STREAMING_EVENT_FINISH == speech_data.event) {
                        MWR_LOGI("[INFO] Finish to get and send speech data");
                        break;
                }
@@ -295,13 +294,13 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time)
        MWR_LOGD("[EXIT]");
 }
 
-void CAudioManager::add_audio_data(wakeup_speech_data& data, long time)
+void CAudioManager::add_audio_data(mas_speech_data& data, long time)
 {
        long delta = mAudioRecordingDurationMilliseconds;
 
        notify_audio_data_recording(time, data.buffer, data.len);
 
-       wakeup_speech_data_with_time data_with_time;
+       mas_speech_data_with_time data_with_time;
        data_with_time.data = data;
        data_with_time.time = time;
 
@@ -318,11 +317,11 @@ void CAudioManager::add_audio_data(wakeup_speech_data& data, long time)
        mAudioData.push_back(data_with_time);
 }
 
-void CAudioManager::feed_audio_data(wakeup_speech_streaming_event_e event, void* buffer, int len)
+void CAudioManager::feed_audio_data(mas_speech_streaming_event_e event, void* buffer, int len)
 {
        if (NULL == buffer || 0 == len) return;
 
-       wakeup_speech_data speech_data;
+       mas_speech_data speech_data;
        speech_data.buffer = vm_malloc_simple(len);
        if (speech_data.buffer) {
                long time = get_current_milliseconds_after_epoch();
@@ -337,8 +336,8 @@ void CAudioManager::feed_audio_data(wakeup_speech_streaming_event_e event, void*
 void CAudioManager::finalize_audio_data()
 {
        unsigned char final_buffer[2] = {'\0', };
-       wakeup_speech_data speech_data;
-       speech_data.event = WAKEUP_SPEECH_STREAMING_EVENT_FINISH;
+       mas_speech_data speech_data;
+       speech_data.event = MAS_SPEECH_STREAMING_EVENT_FINISH;
        speech_data.len = sizeof(final_buffer);
        speech_data.buffer = vm_malloc_simple(speech_data.len);
        if (speech_data.buffer) {
index f75f958..596b697 100644 (file)
@@ -1,3 +1,5 @@
+#include <multi_assistant_service.h>
+
 #include "wakeup_engine_manager.h"
 #include "wakeup_manager_main.h"
 
@@ -142,7 +144,7 @@ bool CWakeupEngineManager::get_audio_data_required()
        return mAudioDataRequired;
 }
 
-void CWakeupEngineManager::set_selected_wakeup_info(wakeup_event_info wakeup_info)
+void CWakeupEngineManager::set_selected_wakeup_info(mas_wakeup_event_info wakeup_info)
 {
        mSelectedEngine = nullptr;
        for (const auto& info : mEngineInfo) {
@@ -267,7 +269,7 @@ void CWakeupEngineManager::streaming_speech_data_thread_func()
 
        MWR_LOGD("data_count : %d", interface->get_utterance_data_count());
 
-       wakeup_speech_data speech_data;
+       mas_speech_data speech_data;
        int index = 0;
        bool finish_event_sent = false;
 
@@ -331,7 +333,7 @@ void CWakeupEngineManager::streaming_speech_data_thread_func()
                                                for (const auto& observer : mObservers) {
                                                        if (observer) {
                                                                if (!observer->on_streaming_audio_data(
-                                                                       WAKEUP_SPEECH_STREAMING_EVENT_FAIL, NULL, 0)) {
+                                                                       MAS_SPEECH_STREAMING_EVENT_FAIL, NULL, 0)) {
                                                                        LOGE("[Recorder WARNING] One of the observer returned false");
                                                                }
                                                        }
@@ -355,7 +357,7 @@ void CWakeupEngineManager::streaming_speech_data_thread_func()
                                }
                        }
 
-                       if (WAKEUP_SPEECH_STREAMING_EVENT_FINISH == speech_data.event) {
+                       if (MAS_SPEECH_STREAMING_EVENT_FINISH == speech_data.event) {
                                MWR_LOGI("[INFO] Finish to get and send speech data");
                                finish_event_sent = true;
                                break;
@@ -370,7 +372,7 @@ void CWakeupEngineManager::streaming_speech_data_thread_func()
                for (const auto& observer : mObservers) {
                        if (observer) {
                                if (!observer->on_streaming_audio_data(
-                                       WAKEUP_SPEECH_STREAMING_EVENT_FINISH, final_buffer, sizeof(final_buffer))) {
+                                       MAS_SPEECH_STREAMING_EVENT_FINISH, final_buffer, sizeof(final_buffer))) {
                                        LOGE("[Recorder WARNING] One of the observer returned false");
                                }
                        }
@@ -509,7 +511,31 @@ void CWakeupEngineManager::engine_feed_audio_data(long time, void* data, int len
        }
 }
 
-bool CWakeupEngineManager::on_wakeup_event(string engine_name, wakeup_event_info info)
+void CWakeupEngineManager::engine_set_dependency_module_command(string engine_name, string command)
+{
+       const auto& iter = find_if(mEngineInfo.begin(), mEngineInfo.end(),
+               [engine_name](const EngineInfo& info) {
+                       return (0 == info.engine_name.compare(engine_name));
+               });
+
+       if (mEngineInfo.end() != iter) {
+               if (iter->activated &&
+                       iter->interface.set_dependency_module_command) {
+                       try {
+                               int ret = iter->interface.set_dependency_module_command(command.c_str());
+                               if (0 != ret) {
+                                       LOGE("[ERROR] Fail to set dependency module command, ret(%d) : %s",
+                                               ret, iter->engine_name.c_str());
+                               }
+                       } catch (const std::exception& e) {
+                               MWR_LOGE("[ERROR] wakeup engine %s threw exception : %s",
+                                       iter->engine_name.c_str(), e.what());
+                       }
+               }
+       }
+}
+
+bool CWakeupEngineManager::on_wakeup_event(string engine_name, mas_wakeup_event_info info)
 {
        MWR_LOGD("[ENTER]");
 
@@ -524,7 +550,7 @@ bool CWakeupEngineManager::on_wakeup_event(string engine_name, wakeup_event_info
        return true;
 }
 
-bool CWakeupEngineManager::on_speech_status(string engine_name, wakeup_service_speech_status_e status)
+bool CWakeupEngineManager::on_speech_status(string engine_name, mas_speech_status_e status)
 {
        MWR_LOGD("[ENTER]");
 
@@ -590,13 +616,13 @@ bool CWakeupEngineManager::on_audio_data_require_status(string engine_name, bool
        return true;
 }
 
-bool CWakeupEngineManager::on_wakeup_engine_command(string engine_name, wakeup_engine_command_target_e target, string assistant_name, string command)
+bool CWakeupEngineManager::on_wakeup_engine_command(string engine_name, mas_wakeup_engine_command_target_e target, string assistant_name, string command)
 {
        MWR_LOGD("[ENTER]");
 
        for (const auto& observer : mObservers) {
                if (observer) {
-                       if (WAKEUP_ENGINE_COMMAND_TARGET_DEPENDENCY_MODULE == target) {
+                       if (MAS_WAKEUP_ENGINE_COMMAND_TARGET_DEPENDENCY_MODULE == target) {
                                if (!observer->on_wakeup_engine_command(target, engine_name, assistant_name, command)) {
                                        LOGE("[Recorder WARNING] One of the observer returned false");
                                }
@@ -608,7 +634,7 @@ bool CWakeupEngineManager::on_wakeup_engine_command(string engine_name, wakeup_e
                                if (mEngineInfo.end() != iter) {
                                        for (const auto& assistant : iter->assistant_list) {
                                                if (0 == assistant_name.compare(assistant) ||
-                                                       WAKEUP_ENGINE_COMMAND_TARGET_ALL_ASSISTANTS == target) {
+                                                       MAS_WAKEUP_ENGINE_COMMAND_TARGET_ALL_ASSISTANTS == target) {
                                                        if (!observer->on_wakeup_engine_command(target, engine_name, assistant, command)) {
                                                                LOGE("[Recorder WARNING] One of the observer returned false");
                                                        }
@@ -710,6 +736,9 @@ void CWakeupEngineManager::add_engine(string name, string path)
        info.interface.get_version =
                (wakeup_engine_get_version)dlsym(info.engine_handle,
                MA_WAKEUP_ENGINE_FUNC_GET_VERSION);
+       info.interface.set_dependency_module_command =
+               (wakeup_engine_set_dependency_module_command)dlsym(info.engine_handle,
+               MA_WAKEUP_ENGINE_FUNC_SET_DEPENDENCY_MODULE_COMMAND);
 
        info.version = 0;
        info.engine_path = path;
@@ -741,7 +770,7 @@ void CWakeupEngineManager::add_engine(string name, string path)
        try {
                if (info.interface.set_wakeup_event_callback) {
                        info.interface.set_wakeup_event_callback(
-                               [](wakeup_event_info info, void* user_data) {
+                               [](mas_wakeup_event_info info, void* user_data) {
                                        CallbackUserData *data = static_cast<CallbackUserData*>(user_data);
                                        if (nullptr == data) return;
                                        if (nullptr == data->manager) return;
@@ -762,7 +791,7 @@ void CWakeupEngineManager::add_engine(string name, string path)
 
                if (info.interface.set_wakeup_engine_command_callback) {
                        info.interface.set_wakeup_engine_command_callback(
-                               [](wakeup_engine_command_target_e target,
+                               [](mas_wakeup_engine_command_target_e target,
                                        const char* assistant_name, const char* command, void* user_data) {
                                        CallbackUserData* data = static_cast<CallbackUserData*>(user_data);
                                        if (nullptr == data) return;
index d4e82fc..f68e145 100644 (file)
@@ -30,7 +30,7 @@ static bool check_language_valid(string language)
        return true;
 }
 
-static bool initialize_wakeup_event_info(wakeup_event_info* wakeup_info)
+static bool initialize_wakeup_event_info(mas_wakeup_event_info* wakeup_info)
 {
        bool ret = false;
        if (wakeup_info) {
@@ -111,9 +111,10 @@ bool CWakeupManager::initialize()
        mWakeupEngineManager.subscribe(&mEngineEventObserver);
        mWakeupEngineManager.initialize();
 
-       mas_proxy_interface interface;
+       mas_dependency_plugin_proxy_interface interface;
        interface.process_event = wakeup_manager_process_event;
        interface.feed_audio_data = wakeup_manager_feed_audio_data;
+       //interface.send_dependency_module_command = wakeup_manager_send_dependency_module_command;
 
        dependency_resolver_initialize(interface);
 
@@ -458,14 +459,14 @@ static long get_current_milliseconds_after_epoch()
        return value.count();
 }
 
-bool CWakeupManager::process_event(ma_plugin_event_e event, void* data, int len)
+bool CWakeupManager::process_event(mas_plugin_event_e event, void* data, int len)
 {
        MWR_LOGD("[ENTER] : %d", event);
        if (WAKEUP_MANAGER_STATE_INACTIVE == mWakeupManagerState)
                return false;
 
        // LOCK REQUIRED
-       if (MA_PLUGIN_EVENT_VOICE_KEY_PRESSED == event) {
+       if (MAS_PLUGIN_EVENT_VOICE_KEY_PRESSED == event) {
                if (mVoiceKeyPressed != true) {
                        mAudioManager.stop_recording(true);
 
@@ -484,7 +485,7 @@ bool CWakeupManager::process_event(ma_plugin_event_e event, void* data, int len)
 
                        /* Wakeup default assistant */
                        /* TODO: apply conversation timeout for selecting assistant here */
-                       wakeup_event_info wakeup_info;
+                       mas_wakeup_event_info wakeup_info;
                        initialize_wakeup_event_info(&wakeup_info);
                        /* Make sure to use background data */
                        wakeup_info.wakeup_time_valid = true;
@@ -501,7 +502,7 @@ bool CWakeupManager::process_event(ma_plugin_event_e event, void* data, int len)
                                observer->on_wakeup(wakeup_info);
                        }
                }
-       } else if (MA_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_PUSH == event) {
+       } else if (MAS_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_PUSH == event) {
                if (mVoiceKeyPressed != false) {
                        mAudioManager.finalize_audio_data();
                        mVoiceKeyPressed = false;
@@ -521,7 +522,7 @@ bool CWakeupManager::process_event(ma_plugin_event_e event, void* data, int len)
                                mAudioManager.stop_recording(true);
                        }
                }
-       } else if (MA_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_TAP == event) {
+       } else if (MAS_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_TAP == event) {
                if (mVoiceKeyPressed != false) {
                        mVoiceKeyPressed = false;
                }
@@ -537,7 +538,7 @@ vector<IWakeupEventObserver*> CWakeupManager::get_wakeup_observers()
        return mWakeupObservers;
 }
 
-void CWakeupManager::set_last_wakeup_event_info(wakeup_event_info wakeup_info)
+void CWakeupManager::set_last_wakeup_event_info(mas_wakeup_event_info wakeup_info)
 {
        mLastWakeupEventInfo = wakeup_info;
 }
@@ -580,7 +581,7 @@ static Eina_Bool streaming_duration_expired(void *data)
        vector<IWakeupEventObserver*> observers = wakeup_manager->get_wakeup_observers();
        for (const auto& observer : observers) {
                observer->on_streaming_audio_data(
-                       WAKEUP_SPEECH_STREAMING_EVENT_FINISH, final_buffer, sizeof(final_buffer));
+                       MAS_SPEECH_STREAMING_EVENT_FINISH, final_buffer, sizeof(final_buffer));
        }
        wakeup_manager->set_streaming_mode(STREAMING_MODE::NONE);
 
@@ -815,12 +816,17 @@ CWakeupSettings* CWakeupManager::get_wakeup_settings()
        return &mWakeupSettings;
 }
 
-void CWakeupManager::feed_audio_data(wakeup_speech_streaming_event_e event, void* buffer, int len)
+void CWakeupManager::feed_audio_data(mas_speech_streaming_event_e event, void* buffer, int len)
 {
        mAudioManager.feed_audio_data(event, buffer, len);
 }
 
-bool CWakeupManager::CEngineEventObserver::on_wakeup_event(string engine_name, wakeup_event_info wakeup_info)
+void CWakeupManager::send_dependency_module_command(string engine_name, string command)
+{
+       mWakeupEngineManager.engine_set_dependency_module_command(engine_name, command);
+}
+
+bool CWakeupManager::CEngineEventObserver::on_wakeup_event(string engine_name, mas_wakeup_event_info wakeup_info)
 {
        MWR_LOGD("[ENTER]");
        if (nullptr == mWakeupManager) return false;
@@ -840,7 +846,7 @@ bool CWakeupManager::CEngineEventObserver::on_wakeup_event(string engine_name, w
        return true;
 }
 
-bool CWakeupManager::CEngineEventObserver::on_speech_status(string engine_name, wakeup_service_speech_status_e status)
+bool CWakeupManager::CEngineEventObserver::on_speech_status(string engine_name, mas_speech_status_e status)
 {
        MWR_LOGD("[ENTER]");
        if (nullptr == mWakeupManager) return false;
@@ -881,7 +887,7 @@ bool CWakeupManager::CEngineEventObserver::on_audio_data_require_status(string e
 }
 
 bool CWakeupManager::CEngineEventObserver::on_streaming_audio_data(
-       wakeup_speech_streaming_event_e event, void* buffer, unsigned int len)
+       mas_speech_streaming_event_e event, void* buffer, unsigned int len)
 {
        if (nullptr == mWakeupManager) return false;
 
@@ -889,7 +895,7 @@ bool CWakeupManager::CEngineEventObserver::on_streaming_audio_data(
        for (const auto& observer : observers) {
                observer->on_streaming_audio_data(event, buffer, len);
        }
-       if (WAKEUP_SPEECH_STREAMING_EVENT_FINISH == event) {
+       if (MAS_SPEECH_STREAMING_EVENT_FINISH == event) {
                mWakeupManager->set_streaming_mode(STREAMING_MODE::NONE);
        }
 
@@ -910,16 +916,16 @@ bool CWakeupManager::CEngineEventObserver::on_audio_streaming_data_section(
 }
 
 bool CWakeupManager::CEngineEventObserver::on_wakeup_engine_command(
-       wakeup_engine_command_target_e target, string engine_name, string assistant_name, string command)
+       mas_wakeup_engine_command_target_e target, string engine_name, string assistant_name, string command)
 {
        if (nullptr == mWakeupManager) return false;
 
-       if (WAKEUP_ENGINE_COMMAND_TARGET_DEPENDENCY_MODULE == target) {
+       if (MAS_WAKEUP_ENGINE_COMMAND_TARGET_DEPENDENCY_MODULE == target) {
                dependency_resolver_process_wakeup_engine_command(engine_name.c_str(), command.c_str());
        }
 
-       if (WAKEUP_ENGINE_COMMAND_TARGET_ALL_ASSISTANTS == target ||
-               WAKEUP_ENGINE_COMMAND_TARGET_SPECIFIC_ASSISTANT == target) {
+       if (MAS_WAKEUP_ENGINE_COMMAND_TARGET_ALL_ASSISTANTS == target ||
+               MAS_WAKEUP_ENGINE_COMMAND_TARGET_SPECIFIC_ASSISTANT == target) {
                vector<IWakeupEventObserver*> observers = mWakeupManager->get_wakeup_observers();
                for (const auto& observer : observers) {
                        observer->on_wakeup_engine_command(target, assistant_name.c_str(), command.c_str());
@@ -929,7 +935,7 @@ bool CWakeupManager::CEngineEventObserver::on_wakeup_engine_command(
        return true;
 }
 
-void CWakeupManager::CPolicyEventObserver::on_wakeup(wakeup_event_info wakeup_info)
+void CWakeupManager::CPolicyEventObserver::on_wakeup(mas_wakeup_event_info wakeup_info)
 {
        if (nullptr == mWakeupManager) return;
 
@@ -970,7 +976,7 @@ bool CWakeupManager::CAudioEventObserver::on_recording_audio_data(long time, voi
 }
 
 bool CWakeupManager::CAudioEventObserver::on_streaming_audio_data(
-       wakeup_speech_streaming_event_e event, void* buffer, unsigned int len)
+       mas_speech_streaming_event_e event, void* buffer, unsigned int len)
 {
        if (nullptr == mWakeupManager) return false;
 
@@ -978,7 +984,7 @@ bool CWakeupManager::CAudioEventObserver::on_streaming_audio_data(
        for (const auto& observer : observers) {
                observer->on_streaming_audio_data(event, buffer, len);
        }
-       if (WAKEUP_SPEECH_STREAMING_EVENT_FINISH == event) {
+       if (MAS_SPEECH_STREAMING_EVENT_FINISH == event) {
                mWakeupManager->set_streaming_mode(STREAMING_MODE::NONE);
        }
 
index 1abfbdf..324c27a 100644 (file)
@@ -50,12 +50,12 @@ static void* g_wakeup_engine_command_user_data;
 
 class CWakeupEventObserver : public IWakeupEventObserver
 {
-       void on_wakeup(wakeup_event_info wakeup_info) override;
+       void on_wakeup(mas_wakeup_event_info wakeup_info) override;
        void on_streaming_audio_data(
-               wakeup_speech_streaming_event_e event, void* buffer, unsigned int len) override;
+               mas_speech_streaming_event_e event, void* buffer, unsigned int len) override;
        void on_audio_streaming_data_section(ma_audio_streaming_data_section_e section) override;
        void on_wakeup_engine_command(
-               wakeup_engine_command_target_e target, const char* assistant_name, const char* command) override;
+               mas_wakeup_engine_command_target_e target, const char* assistant_name, const char* command) override;
 };
 
 class CSettingValueObserver : public ISettingValueObserver
@@ -360,12 +360,12 @@ int wakeup_manager_update_recognition_result(const char* appid, int result)
        return 0;
 }
 
-int wakeup_manager_process_event(int event, void* data, int len)
+int wakeup_manager_process_event(mas_plugin_event_e event, void* data, int len)
 {
        MWR_LOGD("[ENTER]");
 
        if (nullptr == g_wakeup_manager) return -1;
-       g_wakeup_manager->process_event(static_cast<ma_plugin_event_e>(event), data, len);
+       g_wakeup_manager->process_event(event, data, len);
 
        MWR_LOGD("[END]");
        return 0;
@@ -644,15 +644,23 @@ int wakeup_manager_set_wakeup_engine_command_callback(wakeup_service_engine_comm
        return 0;
 }
 
-
-int wakeup_manager_feed_audio_data(wakeup_speech_streaming_event_e event, void* buffer, int len)
+int wakeup_manager_feed_audio_data(mas_speech_streaming_event_e event, void* buffer, int len)
 {
        if (nullptr == g_wakeup_manager) return -1;
        g_wakeup_manager->feed_audio_data(event, buffer, len);
        return 0;
 }
 
-void CWakeupEventObserver::on_wakeup(wakeup_event_info wakeup_info)
+int wakeup_manager_send_dependency_module_command(const char* engine_name, const char* command)
+{
+       if (nullptr == g_wakeup_manager) return -1;
+       g_wakeup_manager->send_dependency_module_command(
+               engine_name ? engine_name : "",
+               command ? command : "");
+       return 0;
+}
+
+void CWakeupEventObserver::on_wakeup(mas_wakeup_event_info wakeup_info)
 {
        if (NULL != g_wakeup_event_cb) {
                g_wakeup_event_cb(wakeup_info, g_wakeup_event_user_data);
@@ -660,12 +668,12 @@ void CWakeupEventObserver::on_wakeup(wakeup_event_info wakeup_info)
 }
 
 void CWakeupEventObserver::on_streaming_audio_data(
-       wakeup_speech_streaming_event_e event, void* buffer, unsigned int len)
+       mas_speech_streaming_event_e event, void* buffer, unsigned int len)
 {
-       if (WAKEUP_SPEECH_STREAMING_EVENT_START == event) {
+       if (MAS_SPEECH_STREAMING_EVENT_START == event) {
                MWR_LOGD("streaming_cb START");
        }
-       if (WAKEUP_SPEECH_STREAMING_EVENT_FINISH == event) {
+       if (MAS_SPEECH_STREAMING_EVENT_FINISH == event) {
                MWR_LOGD("streaming_cb FINISH");
        }
        if (NULL != g_utterance_streaming_cb) {
@@ -684,7 +692,7 @@ void CWakeupEventObserver::on_audio_streaming_data_section(
 }
 
 void CWakeupEventObserver::on_wakeup_engine_command(
-       wakeup_engine_command_target_e target, const char* assistant_name, const char* command)
+       mas_wakeup_engine_command_target_e target, const char* assistant_name, const char* command)
 {
        if (g_wakeup_engine_command_cb) {
                g_wakeup_engine_command_cb(target, assistant_name, command, g_wakeup_engine_command_user_data);
@@ -696,4 +704,4 @@ void CSettingValueObserver::on_value_changed()
        if (g_setting_changed_cb) {
                g_setting_changed_cb(g_setting_changed_user_data);
        }
-}
\ No newline at end of file
+}
index 1ab9f12..e196ac0 100644 (file)
@@ -22,7 +22,7 @@ void CWakeupPolicyImpl::unsubscribe(IPolicyEventObserver *observer)
        }
 }
 
-void CWakeupPolicyImpl::wakeup(wakeup_event_info wakeup_info)
+void CWakeupPolicyImpl::wakeup(mas_wakeup_event_info wakeup_info)
 {
        for (const auto& observer : mObservers) {
                if (observer) {
index 2415636..1715ddf 100644 (file)
@@ -58,7 +58,7 @@ static Eina_Bool timer_func(void *data)
        return ECORE_CALLBACK_CANCEL;
 }
 
-void CWakeupPolicyDefault::wakeup_candidate(wakeup_event_info wakeup_info)
+void CWakeupPolicyDefault::wakeup_candidate(mas_wakeup_event_info wakeup_info)
 {
        mWakeupInfos.push_back(wakeup_info);
        if (nullptr == mTimer) {
@@ -73,7 +73,7 @@ void CWakeupPolicyDefault::timer_expired()
        LOGD("[ENTER]");
        if (0 == mWakeupInfos.size()) return;
 
-       wakeup_event_info selected = mWakeupInfos.front();
+       mas_wakeup_event_info selected = mWakeupInfos.front();
        int selected_priority = -1;
        for (const auto &wakeup : mWakeupInfos) {
                for (const auto &info : mPriorityInfos) {
index 40c9e13..83d9cc3 100644 (file)
@@ -17,7 +17,7 @@
 #include "multi_assistant_main.h"
 #include "multi_assistant_dbus.h"
 #include "multi_assistant_dbus_server.h"
-#include "multi_assistant_service.h"
+#include "multi_assistant_service_client.h"
 
 /*
 * Dbus Client-Daemon Server
index 8c1101f..98688ad 100644 (file)
@@ -31,7 +31,7 @@
 #include <glib.h>
 
 #include "multi_assistant_main.h"
-#include "multi_assistant_service.h"
+#include "multi_assistant_service_client.h"
 #include "multi_assistant_service_plugin.h"
 #include "multi_assistant_dbus.h"
 #include "multi_assistant_config.h"
@@ -1130,16 +1130,6 @@ int mas_prelaunch_default_assistant()
 }
 
 
-int mas_process_voice_key_event(bool pressed)
-{
-       if (pressed) {
-               multi_assistant_service_plugin_process_event(MA_PLUGIN_EVENT_VOICE_KEY_PRESSED, NULL, 0);
-       } else {
-               multi_assistant_service_plugin_process_event(MA_PLUGIN_EVENT_VOICE_KEY_RELEASED, NULL, 0);
-       }
-       return 0;
-}
-
 ma_preprocessing_allow_mode_e get_preprocessing_allow_mode(const char* appid)
 {
        for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM; loop++) {
index f07d730..232fbfa 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "multi_wakeup_recognizer.h"
 #include "multi_assistant_main.h"
-#include "multi_assistant_service.h"
+#include "multi_assistant_service_client.h"
 #include "multi_assistant_service_plugin.h"
 #include "multi_assistant_dbus.h"
 
@@ -137,7 +137,7 @@ Eina_Bool process_wakeup_event_by_word_timer(char* wakeup_word)
        return ECORE_CALLBACK_CANCEL;
 }
 
-static void __wakeup_event_cb(wakeup_event_info wakeup_info, void* user_data)
+static void __wakeup_event_cb(mas_wakeup_event_info wakeup_info, void* user_data)
 {
        MAS_LOGD("[SUCCESS] __wakeup_event_cb is called, wakeup_word(%s)", wakeup_info.wakeup_word);
        int ret = -1;
@@ -217,26 +217,26 @@ static void __wakeup_event_cb(wakeup_event_info wakeup_info, void* user_data)
 
 }
 
-static bool __validate_streaming_event_order(int pid, wakeup_speech_streaming_event_e *event)
+static bool __validate_streaming_event_order(int pid, mas_speech_streaming_event_e *event)
 {
        bool ret = false;
 
        static int previous_pid = -1;
-       static wakeup_speech_streaming_event_e previous_event = WAKEUP_SPEECH_STREAMING_EVENT_FINISH;
+       static mas_speech_streaming_event_e previous_event = MAS_SPEECH_STREAMING_EVENT_FINISH;
 
        if (NULL == event) return false;
 
-       wakeup_speech_streaming_event_e expected_sequence [][2] = {
-               {WAKEUP_SPEECH_STREAMING_EVENT_START, WAKEUP_SPEECH_STREAMING_EVENT_CONTINUE},
-               {WAKEUP_SPEECH_STREAMING_EVENT_START, WAKEUP_SPEECH_STREAMING_EVENT_FINISH},
-               {WAKEUP_SPEECH_STREAMING_EVENT_CONTINUE, WAKEUP_SPEECH_STREAMING_EVENT_CONTINUE},
-               {WAKEUP_SPEECH_STREAMING_EVENT_CONTINUE, WAKEUP_SPEECH_STREAMING_EVENT_FINISH},
-               {WAKEUP_SPEECH_STREAMING_EVENT_FINISH, WAKEUP_SPEECH_STREAMING_EVENT_START},
+       mas_speech_streaming_event_e expected_sequence [][2] = {
+               {MAS_SPEECH_STREAMING_EVENT_START, MAS_SPEECH_STREAMING_EVENT_CONTINUE},
+               {MAS_SPEECH_STREAMING_EVENT_START, MAS_SPEECH_STREAMING_EVENT_FINISH},
+               {MAS_SPEECH_STREAMING_EVENT_CONTINUE, MAS_SPEECH_STREAMING_EVENT_CONTINUE},
+               {MAS_SPEECH_STREAMING_EVENT_CONTINUE, MAS_SPEECH_STREAMING_EVENT_FINISH},
+               {MAS_SPEECH_STREAMING_EVENT_FINISH, MAS_SPEECH_STREAMING_EVENT_START},
        };
 
        if (pid != previous_pid) {
                /* When sending streaming event to a new client, it always sends START message first */
-               previous_event = WAKEUP_SPEECH_STREAMING_EVENT_FINISH;
+               previous_event = MAS_SPEECH_STREAMING_EVENT_FINISH;
        }
 
        for (int loop = 0;loop < sizeof(expected_sequence) / sizeof(expected_sequence[0]);loop++) {
@@ -247,9 +247,9 @@ static bool __validate_streaming_event_order(int pid, wakeup_speech_streaming_ev
        }
        if (!ret) {
                /* In case of FINISH -> CONTINUE without START, simply modify current event value */
-               if (WAKEUP_SPEECH_STREAMING_EVENT_FINISH == previous_event &&
-                       WAKEUP_SPEECH_STREAMING_EVENT_CONTINUE == *event) {
-                       *event = WAKEUP_SPEECH_STREAMING_EVENT_START;
+               if (MAS_SPEECH_STREAMING_EVENT_FINISH == previous_event &&
+                       MAS_SPEECH_STREAMING_EVENT_CONTINUE == *event) {
+                       *event = MAS_SPEECH_STREAMING_EVENT_START;
                        ret = true;
 
                        MAS_LOGD("[WARNING] forcibly changed CONTINUE to START : %d -> %d (PID %d -> %d)",
@@ -272,14 +272,14 @@ static void handle_speech_streaming_event_failure(void *data)
        mas_client_send_recognition_result(0, MA_RECOGNITION_RESULT_EVENT_ERROR);
 }
 
-static void __audio_streaming_cb(wakeup_speech_streaming_event_e event, unsigned char* buffer, int len, void *user_data)
+static void __audio_streaming_cb(mas_speech_streaming_event_e event, unsigned char* buffer, int len, void *user_data)
 {
-       if (event == WAKEUP_SPEECH_STREAMING_EVENT_FAIL) {
+       if (event == MAS_SPEECH_STREAMING_EVENT_FAIL) {
                ecore_main_loop_thread_safe_call_async(handle_speech_streaming_event_failure, NULL);
                return;
        }
        static int count = 0;
-       if (event != WAKEUP_SPEECH_STREAMING_EVENT_CONTINUE || count % 100 == 0) {
+       if (event != MAS_SPEECH_STREAMING_EVENT_CONTINUE || count % 100 == 0) {
                MAS_LOGD( "[SUCCESS] __audio_streaming_cb is called, event(%d), buffer(%p), len(%d)", event, buffer, len);
        }
        ++count;
@@ -308,7 +308,7 @@ static void __audio_streaming_cb(wakeup_speech_streaming_event_e event, unsigned
        if (g_pFile)
                fwrite(buffer, 1, len, g_pFile);
 
-       if (WAKEUP_SPEECH_STREAMING_EVENT_FINISH == event) {
+       if (MAS_SPEECH_STREAMING_EVENT_FINISH == event) {
                if (g_pFile) {
                        MAS_LOGE("[Recorder SUCCESS] File Close");
                        fclose(g_pFile);
@@ -320,7 +320,7 @@ static void __audio_streaming_cb(wakeup_speech_streaming_event_e event, unsigned
 #endif
 }
 
-static void __speech_status_cb(wakeup_speech_status_e status, void *user_data)
+static void __speech_status_cb(mas_speech_status_e status, void *user_data)
 {
        MAS_LOGD( "[SUCCESS] __speech_status_cb is called, status(%d)", status);
 }
@@ -354,7 +354,7 @@ static void __streaming_section_changed_cb(ma_audio_streaming_data_section_e sec
        }
 }
 
-static void __wakeup_engine_command_cb(wakeup_engine_command_target_e target, const char* assistant_name, const char* command, void* user_data)
+static void __wakeup_engine_command_cb(mas_wakeup_engine_command_target_e target, const char* assistant_name, const char* command, void* user_data)
 {
        MAS_LOGD( "[SUCCESS] __wakeup_engine_command_cb is called, command(%s)", command);
 
@@ -811,7 +811,7 @@ int multi_assistant_service_plugin_process_event(int event, void *data, int len)
                if (NULL == func) {
                        MAS_LOGE("[ERROR] symbol lookup failed : %s", MA_WAKEUP_MANAGER_FUNC_PROCESS_EVENT);
                } else {
-                       ret = func(event, data, len);
+                       ret = func((mas_plugin_event_e)event, data, len);
                        if (0 != ret) {
                                MAS_LOGE("[ERROR] Fail to stop recording, ret(%d)", ret);
                        }