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

Function main

src/examples/serialportclient.cpp:16–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14using namespace std;
15
16int main(int argc, char **argv) {
17 string deviceName;
18
19 if (argc == 2) {
20 deviceName = string(argv[1]);
21 } else {
22 deviceName = "tty0";
23 }
24
25 cout << "Params are :" << endl;
26 cout << "\t deviceName: " << deviceName << endl;
27
28 LinuxSerialPortClient client(deviceName);
29 Client c(client);
30
31 Json::Value params;
32 params["name"] = "Peter";
33
34 try {
35 cout << c.CallMethod("sayHello", params) << endl;
36 } catch (JsonRpcException &e) {
37 cerr << e.what() << endl;
38 }
39}

Callers

nothing calls this directly

Calls 3

stringClass · 0.85
CallMethodMethod · 0.80
whatMethod · 0.45

Tested by

no test coverage detected