串口握手。硬件握手和无握手有什么区别?
我试图确定当我使用硬件握手和无握手打开串行端口时的差异。
看来在这两种情况下我都必须控制 RTS/CTS 信号(刚刚使用一个 COM 设备进行了测试)。 那么硬件握手打开串口和不握手打开串口有什么区别呢?
根据我之前的理解,当我们在没有握手
的情况下工作时,我们不关心RTS/CTS
和DTR/DSR
信号。只要我们需要就可以发送和接收数据。我错了吗?
还有一个问题。我们可以仅在全双工
模式下不握手
工作吗?
I'm trying to determine the difference when I open serial port with hardware handshake and none handshake.
It seems that in both cases I have to control RTS/CTS
signals (just tested it with one COM device).
So what the difference between opening serial port with hardware handshake and without handshaking?
From my previous understanding, when we work without handshaking
, we don't care about RTS/CTS
and DTR/DSR
signals. Just send and receive data whenever we want. Was I wrong?
One more question. Can we work without handshaking
in full duplex
mode only?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能知道,问题在于“流量控制”。就像Clash的歌曲“我应该留下还是应该走?”。
RTS/CTS是硬件控制。 XON/XOFF 是软件控制。否则,“继续前进”。
此链接可能会进一步解释:
http://www.lammertbies.nl/comm/info /RS-232_flow_control.html
我怀疑当您询问有关“双工”的“握手”时,也许您的意思是:
'希望有帮助!
As you probably know, the issue is "flow control". Like the Clash song "Should I stay or should I go?".
RTS/CTS is hardware control. XON/XOFF is software control. Otherwise, "just keep going".
This link might explain further:
http://www.lammertbies.nl/comm/info/RS-232_flow_control.html
I suspect that when you were asking about "handshaking" with respect to "duplex", perhaps you meant this:
'Hope that helps!
区别更多在于内核在决定是否发送更多数据时是否会关注
CTS
/RTS
行。打开硬件握手后,它会的。如果将其设置为 none,则不会,即使CTS
/RTS
线路可能保持断言状态,以便对等方知道它可以发送数据。The difference is more about whether the kernel will pay attention to the
CTS
/RTS
lines when deciding whether to send more data or not. With hardware handshaking turned on, it will. With it set to none, it won't, even though theCTS
/RTS
lines may stay asserted, so that the peer will know it can send data.