I\'m writing a C++ program for communicating with a Arduino over a serial port using boost::asio. After establishing the connection the Arduino resets itself. However the in
You can flush the serial buffer, which should do what you want (get rid of all pending data up to the time of the flush). Unfortunately, it seems Boost does not have a wrapper for doing this, so you have to grab the native_handle for the serial port. I based the code I'm using off this answer: https://stackoverflow.com/a/22598329/1167230