libserial

wrong sequence of libserial received data

自闭症网瘾萝莉.ら 提交于 2019-12-25 02:21:58
问题 I'm now working on a project which uses libserial for serial port communication under Ubuntu. we modified the libserial source code to allow MARK/SPACE parity. but when doing data receiving test, sometimes (about 5% chance) the incoming data sequence is wrong. The first byte can jump to the middle of the incoming buffer or even to the end. The problem is inside the original SerialPort::SerialPortImpl::HandlePosixSignal( int singnalNumber) f unction, when the error happens it can not read some

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

风格不统一 提交于 2019-11-27 21:40:28
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 not work very well: in particular, I'd like to control the reading function in order to read only if there is something to read and exit when there is no information to read in order to send another command without bloicking the flow program. I want to do: Write a command Wait for the answer then Write another command Wait for answer Now, i'm able to send the first command and read the answer by using read function in a while loop but

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

ⅰ亾dé卋堺 提交于 2019-11-26 20:48:03
问题 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 not work very well: in particular, I'd like to control the reading function in order to read only if there is something to read and exit when there is no information to read in order to send another command without bloicking the flow program. I want to do: Write a command Wait for the answer then Write another command Wait for answer