I am communicating with a device via a serial port using ubuntu. All the messages need to be hex values. I have tested the communication setup using termite in a Windows environment and I get the responses I am expecting. I cannot get any responses when using Boost:asio though.
Here is how I am setting up my serial port:
boost::asio::serial_port serialPort;
serialPort.open(portNumber);
serialPort.set_option(boost::asio::serial_port_base::baud_rate(baudRate));
serialPort.set_option(boost::asio::serial_port_base::character_size(8));
serialPort.set_option(boost::asio::serial_port_base::stop_bits(boost::asio::serial_port_base::stop_bits::one));
serialPort.set_option(boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::none));
serialPort.set_option(boost::asio::serial_port_base::flow_control(boost::asio::serial_port_base::flow_control::none));
uint8_t hexValue = message.at(i) >= 'A' ? (message.at(i) - 'A' + 10) : message.at(i) - '0';
serialPort.write_some(boost::asio::buffer(&hexValue, sizeof(uint8_t)));
So is there something I need to setup in ASIO to make it send correctly?