Serial port handshake. What the difference between Hardware and None handshaking?
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 be开发者_如何转开发tween 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?
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!
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.
精彩评论