Reading from serial port with Boost Asio

后端 未结 2 793
时光取名叫无心
时光取名叫无心 2020-12-16 21:42

I\'m want to check for incoming data packages on the serial port, using boost.asio. Each data packet will start with a header that is one byte long, and will sp

2条回答
  •  再見小時候
    2020-12-16 22:13

    This article is helpful in understanding how ASIO can be used asynchronously with serial ports:

    • https://gist.github.com/kaliatech/427d57cb1a8e9a8815894413be337cf9

    UPDATE (2019-03):

    The original article I had linked to is no longer available and is difficult to find even in Internet Archive. (Here is a snapshot.). There are now newer articles on using ASIO for serial I/O found easily by searching, but this older article is still very useful. I'm putting it in a public gist so that it doesn't get lost:

    • https://gist.github.com/kaliatech/427d57cb1a8e9a8815894413be337cf9

    The code described in the article appears to have been copied here:

    • https://github.com/fedetft/serial-port

    The author seems to have updated it for C++11. I believe the article was originally written by fede.tft.

提交回复
热议问题