std::string plugin_path = root_path + "/lib/" + schema.GetPluginPath();
LOG(INFO) << "Plugin path: " + plugin_path;
auto plugin = std::make_unique<Plugin>(plugin_path);
- std::string result_json = plugin->Execute(action.Getjson());
- common::SafeJson result("{}");
- result.set("data", result_json);
- result_cb->Invoke(result.stringify());
+ std::string result = plugin->Execute(action.Getjson());
+ common::SafeJson result_json("{}");
+ result_json.set("result", result);
+ result_cb->Invoke(result_json.stringify());
} catch (const std::runtime_error& e) {
LOG(ERROR) << "Exception occurred: " << e.what();
- common::SafeJson result("{}");
- result.set("error", e.what());
- result_cb->Invoke(result.stringify());
+ common::SafeJson result_json("{}");
+ result_json.set("error", e.what());
+ result_cb->Invoke(result_json.stringify());
}
}
}
}
*/
-API const char* PLUGIN_EXECUTE(const char* action_model_json) {
+API const char* TIZEN_ACTION_EXECUTE(const char* action_model_json) {
if (action_model_json == nullptr) {
LOG(ERROR) << "Invalid parameter";
return nullptr;
std::string param1 = json.get<std::string>("params.param1");
std::string param2 = json.get<std::string>("params.param2");
LOG(INFO) << "param1: " << param1 << ", param2: " << param2;
- result.set("result", "success");
+ return strdup((param1 + " " + param2).c_str());
} catch (const std::runtime_error& e) {
common::SafeJson error_result("{}");
error_result.set("error", e.what());