Hello all, I am having trouble getting asio serial ports to work.
Specifically when I call boost::asio::async_read, it immediately calls
the read completion handler with error EINVAL aka Invalid argument.
Please help! I have invested significant time in asio serial ports!
Mac OSX 10.6.4
GCC 4.2.1
boost version 1.44.0
The test case console output:
$ ./test
ERROR 22 Invalid argument
$
The test case code:
#include <iostream>
#include <cstdlib>
#include <vector>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
const int HeaderSize = 2;
std::vector<char> ReadVector;
void ReadHandler(const boost::system::error_code& error, std::size_t bytes_transferred)
{
if (error)
{
std::cout << "ERROR " << error.value() << " " << error.category().message(