Boost.Asio uses a Proactor to magnificently handle I/O using a single thread. I used it with sockets and I love it. I see that there is a way to use the io_service of Boost.Asio (and the underlying Proactor) with serial ports (COMX devices on Windows and /dev/ttyXXX on Linux) instead of sockets. In fact, I think that Boost.Asio is meant to be used with whatever type of I/O, including file handle and so on.
I am wondering if I can use it directly, out-of-the-box, for any serial devices like SPI or I2C. These kind of serial devices appear like /dev/spi under Linux.
For example, could I use it like this:
boost::asio::io_service my_io_service;
boost::asio::serial_port my_spi_serial_port("/dev/spi0", my_io_service);
and automagically, it works just like a regular serial port (i.e. RS232)?
Alternatively, if SPI is not directly supported by Boost.Asio, do the later offers a way of easily incorporate support for any other device type, without modifying the core code of Boost.Asio?