Ferenc Szontágh
2024-06-27 0c428a79ef2379c6c7be29712e83f8c39e43c580
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "SamplePlugin.h"
 
extern "C" IPlugin *create(IPC *ipc)
{
    return new SamplePlugin(ipc);
}
 
SamplePlugin::SamplePlugin(IPC* ipc) : ipc(ipc)
{
}
 
void SamplePlugin::handleMessage(const Command &cmd)
{
    auto it = CommandTypeToString.find(cmd.commandType);
    if (it != CommandTypeToString.end())
    {
        DLOG(INFO) << "Handled command: " << it->second << " with payload: " << cmd.payload;
    }
}
 
void SamplePlugin::updateConfig(const nlohmann::json &config)
{
    DLOG(INFO) << "Updated plugin config: " << config.dump() << std::endl;
    
}
 
const std::string SamplePlugin::getPluginName() { return this->plugin_name;  }