| 14 | using namespace std; |
| 15 | |
| 16 | int 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 | } |
nothing calls this directly
no test coverage detected