How do I perform a nonblocking read using asio? has a great little example of how to implement asynch serial with a timeout. If it is suitable for your application, I'd highly recommend implementing a callback-based asynchronous serial RX. The author seems to have updated it for C++11. The code described in the article appears to have been copied here: I'm putting it in a public gist so that it doesn't get lost: There are now newer articles on using ASIO for serial I/O found easily by searching, but this older article is still very useful. The original article I had linked to is no longer available and is difficult to find even in Internet Archive. ![]() This article is helpful in understanding how ASIO can be used asynchronously with serial ports:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |