问题描述
我想知道Linux机器串行端口上RTS / CTS引脚的状态。
I would like to know the status of RTS/CTS pins on the serial port on my Linux machine.
此外,由于我使用的是/ dev / ttyUSB0,相同的机制是否可以工作?
Also, since I am using /dev/ttyUSB0 will the same mechanism work?
请注意,
Aakash
Regards,Aakash
推荐答案
通常建议使用用于与串行端口进行交互,但我认为不支持RTS / CTS访问。您将需要将ioctl(2)与TIOCMGET和TIOCMSET一起使用。您可以在看到示例。
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.
您的USB加密狗可能支持RTS / CTS,但是有许多不同的USB串行设备,但并非所有人都支持。同样,延迟可能是一个问题。 (可能是最受欢迎的USB串行芯片提供商)最多需要3个字符才能停止传输CTS停止活动后。
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.
这篇关于如何在Linux上读取RTS / CTS引脚的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!