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.
Managing Ports and Transfers in .NET
211
The code to use the PinChanged event is similar to the code for the DataReceived
event earlier in this chapter. The application assigns a routine to execute
when a PinChanged event occurs on an open port:
' Define a delegate class to handle PinChanged events.
Friend Delegate Sub SerialPinChangedEventHandlerDelegate _
(ByVal sender As Object, ByVal e As SerialPinChangedEventArgs)
' Create an instance of the delegate.
Private SerialPinChangedEventHandler1 _
As New SerialPinChangedEventHandler(AddressOf PinChanged)
// Define a delegate class to handle PinChanged events.
internal delegate void SerialPinChangedEventHandlerDelegate
(object sender, SerialPinChangedEventArgs e);
// Create an instance of the delegate.
Pages:
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244