串口握手。硬件握手和无握手有什么区别?

发布于 2024-12-06 18:21:59 字数 348 浏览 1 评论 0原文

我试图确定当我使用硬件握手无握手打开串行端口时的差异。

看来在这两种情况下我都必须控制 RTS/CTS 信号(刚刚使用一个 COM 设备进行了测试)。 那么硬件握手打开串口和不握手打开串口有什么区别呢?

根据我之前的理解,当我们在没有握手的情况下工作时,我们不关心RTS/CTSDTR/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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏了南城 2024-12-13 18:21:59

您可能知道,问题在于“流量控制”。就像Clash的歌曲“我应该留下还是应该走?”。

RTS/CTS是硬件控制。 XON/XOFF 是软件控制。否则,“继续前进”。

此链接可能会进一步解释:

http://www.lammertbies.nl/comm/info /RS-232_flow_control.html

我怀疑当您询问有关“双工”的“握手”时,也许您的意思是:

http://en.wikipedia.org/wiki/RS-232< /p>

在旧版本的规范中,RS-232 使用 RTS 和
CTS 线路是不对称的:DTE 断言 RTS 来表明希望
传输到 DCE,DCE 断言 CTS 以响应授权
允许。这允许半双工调制解调器禁用其
不需要时发送器,并且必须发送同步
重新启用时发送给接收器的前导码。

'希望有帮助!

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:

http://en.wikipedia.org/wiki/RS-232

In older versions of the specification, RS-232's use of the RTS and
CTS lines is asymmetric: The DTE asserts RTS to indicate a desire to
transmit to the DCE, and the DCE asserts CTS in response to grant
permission. This allows for half-duplex modems that disable their
transmitters when not required, and must transmit a synchronization
preamble to the receiver when they are re-enabled.

'Hope that helps!

软糖 2024-12-13 18:21:59

区别更多在于内核在决定是否发送更多数据时是否会关注 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 the CTS/RTS lines may stay asserted, so that the peer will know it can send data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文