namespace wakeup
{
+typedef struct {
+ std::string wakeup_appid;
+ std::string wakeup_word;
+ std::string wakeup_language;
+ std::string wakeup_voice_id;
+ std::string wakeup_engine;
+
+ std::string extra_data_description;
+ mas_wakeup_event_info info;
+} mas_wakeup_event_info_wrapper;
+
+
using namespace std;
class CWakeupPolicyDefault : public CWakeupPolicy
float mDelaySeconds{0.0f};
vector<PRIORITY_INFO> mPriorityInfos;
- vector<mas_wakeup_event_info> mWakeupInfos;
+ vector<mas_wakeup_event_info_wrapper> mWakeupInfos;
Ecore_Timer *mTimer{nullptr};
};
void CWakeupPolicyDefault::wakeup_candidate(mas_wakeup_event_info wakeup_info)
{
MWR_LOGI("[ENTER]");
- mWakeupInfos.push_back(wakeup_info);
+ mas_wakeup_event_info_wrapper wrapper;
+ if (wakeup_info.wakeup_appid) wrapper.wakeup_appid = wakeup_info.wakeup_appid;
+ if (wakeup_info.wakeup_word) wrapper.wakeup_word = wakeup_info.wakeup_word;
+ if (wakeup_info.wakeup_language) wrapper.wakeup_language = wakeup_info.wakeup_language;
+ if (wakeup_info.wakeup_voice_id) wrapper.wakeup_voice_id = wakeup_info.wakeup_voice_id;
+ if (wakeup_info.wakeup_engine) wrapper.wakeup_engine = wakeup_info.wakeup_engine;
+ if (wakeup_info.extra_data_description) wrapper.extra_data_description = wakeup_info.extra_data_description;
+
+ wrapper.info = wakeup_info;
+
+ LOGI("wake word : %s", wakeup_info.wakeup_word);
+ mWakeupInfos.push_back(wrapper);
if (nullptr == mTimer) {
ecore_main_loop_thread_safe_call_async([](void* data) {
CWakeupPolicyDefault* policy = static_cast<CWakeupPolicyDefault*>(data);
MWR_LOGD("[ENTER]");
if (0 == mWakeupInfos.size()) return;
- mas_wakeup_event_info selected = mWakeupInfos.front();
+ mas_wakeup_event_info_wrapper selected = mWakeupInfos.front();
+ LOGD("wake word : %s", selected.wakeup_word.c_str());
int selected_priority = -1;
for (const auto &wakeup : mWakeupInfos) {
for (const auto &info : mPriorityInfos) {
}
}
}
- if (mImpl) mImpl->wakeup(selected);
+ selected.info.wakeup_appid = selected.wakeup_appid.c_str();
+ selected.info.wakeup_word = selected.wakeup_word.c_str();
+ selected.info.wakeup_language = selected.wakeup_language.c_str();
+ selected.info.wakeup_voice_id = selected.wakeup_voice_id.c_str();
+ selected.info.wakeup_engine = selected.wakeup_engine.c_str();
+ selected.info.extra_data_description = selected.extra_data_description.c_str();
+
+ if (mImpl) mImpl->wakeup(selected.info);
mWakeupInfos.clear();
if (mTimer) {