Serial Port Complete - Latest Microcontroller projects

(lily) #1

Chapter 10


Table 10-1 shows the signals that applications can monitor and control. An
application can control the RTS and DTR outputs and can read the CD, CTS,
and DSR inputs. A True state corresponds to a positive RS-232 voltage, and a
False state corresponds to a negative RS-232 voltage. As Chapter 16 explains,
the drivers for some USB virtual COM ports don’t support reading CTS explic-
itly, and applications that access these ports can’t use the value of CTSHolding.
The BreakState property enables controlling the TX line. Setting the property
True brings the RS-232 TX line positive. When TX is True, writing data to the
port fails and raises an InvalidOperationException. Setting the property False
brings TX negative and enables transmitting data on the line.
The PinChanged event can notify an application when a change has occurred
on the CTS, DSR, or CD input, when RI has changed from False to True, and
when RX has entered the Break state (but not when RX exits the Break state).
RX is in the Break state when the line’s state has equaled logic 0 for longer than
the time required to transmit one word at the current bit rate.

Table 10-1: The SerialPort class includes properties for reading and writing to
flow-control signals.


  ! 
BreakState Gets or sets the state of the TX output.
If set to True, no data can transmit on TX.
CDHolding Gets the state of the CD input.
CtsHolding Gets the state of the CTS input.
DsrHolding Gets the state of the DSR input.
DtrEnable Gets or sets the state the of the DTR output.
RtsEnable Gets or sets the state the of the RTS output.
Free download pdf