8

I want to configure a UART to use the Hardware Flow Control lines RTS and CTS in Linux. According to http://linux.die.net/man/3/termios, CRTSCTS enables RTS/CTS (hardware) flow control, and CLOCAL configures the serial port to ignore modem control lines. The 2 flags seem contradictory, how can you have hardware flow control enabled with CRTSCTS and ignore the lines with CLOCAL?

dsolimano
  • 8,870
  • 3
  • 48
  • 63
Samuel
  • 8,063
  • 8
  • 45
  • 41

1 Answers1

12

CLOCAL ignores only the CD signal.

ninjalj
  • 42,493
  • 9
  • 106
  • 148
  • 1
    Thank you for your answer. I was using a UART with only RTS and CTS, I wasn't aware of a CD signal. A quick Google search showed me that RS-232 (and maybe other serial protocols) uses a Carrier Detect line in addition to RTS and CTS. – Samuel Oct 25 '12 at 21:57
  • 6
    A little more information from the Linux tty_ioctl(4) man page. "If the CLOCAL flag for a line is off, the hardware carrier detect (DCD) signal is significant, and an open(2) of the corresponding terminal will block until DCD is asserted, unless the O_NONBLOCK flag is given. If CLOCAL is set, the line behaves as if DCD is always asserted. The software carrier flag is usually turned on for local devices, and is off for lines with modems." – David Poole Oct 16 '15 at 19:13