martin naskovski
2014-07-16 08:51:59 UTC
Hi - I'm a fairly experienced programmer however new to Boost's ASIO and
would like to ask for some direction regarding usage of multiple serial
ports with ASIO.
I dug up a "minicom" example which does exactly what I need it to - async
read and writes to the serial port. I also found similar logic in the posix
chat client (fully asynchronous) and a few other examples, however my
specific use case involves reading from multiple serial ports...
My app works great modeled after the minicom example, however now I have a
need to open up one more, completely different serial port and attach it to
the same io_service that the first serial port is running on. The first
serial port has read and write operations applied to it, whereas the second
serial port (console) will only have async_read_until('\n') and dump to a
log file...
I am unsure as to how to implement a two serial port with a single
io_service, where both ports would be constantly streaming (i.e. via
async_read_until()) and only one of them will be written to...
Again, I have my app working great using ASIO with a single serial port,
but I'm a little lost due to lack of clear example (or maybe I just have
been looking in the wrong place?) on how would I go about doing the same
with 2 (or more) serial ports.
Any direction/guidance on where to look and what to read up about this is
appreciated.
thank you in advance,
Martin
would like to ask for some direction regarding usage of multiple serial
ports with ASIO.
I dug up a "minicom" example which does exactly what I need it to - async
read and writes to the serial port. I also found similar logic in the posix
chat client (fully asynchronous) and a few other examples, however my
specific use case involves reading from multiple serial ports...
My app works great modeled after the minicom example, however now I have a
need to open up one more, completely different serial port and attach it to
the same io_service that the first serial port is running on. The first
serial port has read and write operations applied to it, whereas the second
serial port (console) will only have async_read_until('\n') and dump to a
log file...
I am unsure as to how to implement a two serial port with a single
io_service, where both ports would be constantly streaming (i.e. via
async_read_until()) and only one of them will be written to...
Again, I have my app working great using ASIO with a single serial port,
but I'm a little lost due to lack of clear example (or maybe I just have
been looking in the wrong place?) on how would I go about doing the same
with 2 (or more) serial ports.
Any direction/guidance on where to look and what to read up about this is
appreciated.
thank you in advance,
Martin