void CWakeupEngineManager::add_engine(string name, string path)
{
- MWR_LOGD("Name (%s), Filepath(%s)", name.c_str(), path.c_str());
+ MWR_LOGE("Name (%s), Filepath(%s)", name.c_str(), path.c_str());
char* error = NULL;
EngineInfo info;
info.engine_handle = dlopen(path.c_str(), RTLD_LAZY);
if (nullptr != (error = dlerror()) || nullptr == info.engine_handle) {
- MWR_LOGD("[ERROR] Fail to dlopen(%s), error(%s)", path.c_str(), error);
+ MWR_LOGE("[ERROR] Fail to dlopen(%s), error(%s)", path.c_str(), error);
if (info.engine_handle) dlclose(info.engine_handle);
+ info.engine_handle = nullptr;
return;
}
(wakeup_engine_set_dependency_module_command)dlsym(info.engine_handle,
MA_WAKEUP_ENGINE_FUNC_SET_DEPENDENCY_MODULE_COMMAND);
+ if (info.interface.initialize == nullptr) {
+ MWR_LOGE("[ERROR] Initialize interface does not exist, skipping %s", path.c_str());
+ if (info.engine_handle) dlclose(info.engine_handle);
+ info.engine_handle = nullptr;
+ return;
+ }
+
info.version = 0;
info.engine_path = path;
info.engine_name = name;