Read and Write on serial port in Ubuntu with C/C++ and LibSerial

后端 未结 2 1306
我寻月下人不归
我寻月下人不归 2020-12-05 21:48

I\'m using LibSerial on Ubuntu to read and write data on serial port.

At the moment, I\'m able to write and receive strings over the serial port, but my code does no

2条回答
  •  感情败类
    2020-12-05 22:18

    I think you just need to use while( serial_port.rdbuf()->in_avail() > 0 ) as a condition for your last while loop. Then it'll read out all the available data (“answer”) and you can send the second command after that.

提交回复
热议问题