MCPcopy Create free account
hub / github.com/cinemast/libjson-rpc-cpp / SampleServer

Method SampleServer

src/examples/serialportserver.cpp:20–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18class SampleServer : public AbstractServer<SampleServer> {
19public:
20 SampleServer(LinuxSerialPortServer &server) : AbstractServer<SampleServer>(server) {
21 this->bindAndAddMethod(Procedure("sayHello", PARAMS_BY_NAME, JSON_STRING, "name", JSON_STRING, NULL), &SampleServer::sayHello);
22 this->bindAndAddNotification(Procedure("notifyServer", PARAMS_BY_NAME, NULL), &SampleServer::notifyServer);
23 }
24
25 // method
26 void sayHello(const Json::Value &request, Json::Value &response) { response = "Hello: " + request["name"].asString(); }

Callers

nothing calls this directly

Calls 3

ProcedureClass · 0.50
bindAndAddMethodMethod · 0.45

Tested by

no test coverage detected