0

I am a beginner with Serial port and want to get more ideas for it. I would like to know, if it is possible that, the device at one side of Serial Connecting makes and send a request, for instance add(a, b), the other device at the other side of Serial Connecting receives the request, processing it (calculate it) and later return the result to the first device. We assume that in the second device exist a program with the function add(int a, int b).

Thanks and best regards, Chunya

Chunya
  • 1

1 Answers1

0

Boost Asio with serial ports

You can send command identifier (unique ID known to both devices, the simplest example is command name) and its arguments serialized. Exact protocol and format is up to you.

So it could look like:

Device1 -> Device2: add(1, 2)
Device2 -> Device1: result(3)
Community
  • 1
  • 1
Andriy Tylychko
  • 15,967
  • 6
  • 64
  • 112
  • Thanks. Then is it possible using XML as a special data-transfer format in case of call a Method, which as described in the above? If so, can you please introduce a Tutorial? – Chunya Mar 31 '14 at 17:22