I'm having a problem running code from the C++ implementation.
I copied robust_serial.hpp to my project and implemented a class to read and write information to the serial port using std::fstream.
std::fstream serial_port;
serial_port.open(device, ios::in|ios::out|ios::app|ios::binary);
write_order(serial_port, SEND);
write_i32(serial_port, id);
setup() {
Serial.begin(SERIAL_BAUD);
}
loop() {
if(Serial.available() > 0)
{
Order order_received = read_order();
switch(order_received)
{
case SEND:
uint32_t ID = (uint32_t) read_i32();
}
}
}
But the data is not arriving to the arduino board, but i noticed that if I use a sniffer like interceptty like that:
interceptty /dev/ttyACM0
That create a bind to the /dev/pts/3, and if I connect to that port the data is Ok and is arriving to arduino. But if I remove the interceptty and connect direct to the /dev/ttyACM0 it stop working again. And if I start interceptty and kept it running I can communicate either, even with the /dev/ttyACM0 port.