问题
I would like to know the status of RTS/CTS pins on the serial port on my Linux machine.
Also, since I am using /dev/ttyUSB0 will the same mechanism work?
Regards, Aakash
回答1:
It is usually recommended to use termios for interacting with a serial port but I believe RTS/CTS access is not supported. You will need to use ioctl(2) along with TIOCMGET and TIOCMSET. You can see an example here.
Your USB dongle probably supports RTS/CTS but there are many different USB serial devices and not all of them do. Also, latency may be an issue. FTDI (probably the most popular USB serial chip provider) takes up to 3 characters to stop transmitting after CTS stops being active.
回答2:
I used gtkterm and it shows the status of the pins in the bottom status bar. This worked properly with /dev/ttyUSB0 also.
来源:https://stackoverflow.com/questions/17385272/how-to-read-rts-cts-pins-values-on-linux