Serial receive delay

Hi,

I’m using read() to receive data from serial port in 1200 baud (ConnectMe, NetOS 6.3).

I want to get data at end of first char, then continue receive the remaining data, but it give me data after last char 20 ms, that delay is too long.

Is there anyway to receive data from serial port in real time?

Thanks!

Jiaxin

  1. Are you using read() to read one char at a time? Otherwise it will wait for the last char to fail (~20ms) or the end of your read buffer.
  2. Take a look at tcsetattr().
  3. Try non-blocking I/O by using O_NONBLOCK.

-Erik

Hi Erik,

  1. I do using read() to read one char at a time.

  2. I used tcsetattr() to set some settings, didn’t see any parameters can help.

  3. I open the serial port by open() with O_NONBLOCK option.

What else I can do?

Thank a lot.

Jiaxin