How to read RTS/CTS pins' values on Linux?

℡╲_俬逩灬. 提交于 2019-12-24 02:05:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!