Свойство | Type | Description | |
---|---|---|---|
AutoReopen | bool | ||
BaudRate | int | ||
CheckAllSends | bool | ||
DataBits | int | ||
Parity | Parity | ||
RxFlowX | bool | ||
RxGateDsr | bool | ||
RxHighWater | int | ||
RxLowWater | int | ||
RxQueue | int | ||
SendTimeoutConstant | int | ||
SendTimeoutMultiplier | int | ||
StopBits | StopBits | ||
TxFlowCts | bool | ||
TxFlowDsr | bool | ||
TxFlowX | bool | ||
TxQueue | int | ||
TxWhenRxXoff | bool | ||
UseDtr | HsOutput | ||
UseRts | HsOutput | ||
XoffChar | ASCII | ||
XonChar | ASCII |
Méthode | Description | |
---|---|---|
Close ( ) : void |
Closes the com port.
|
|
Dispose ( ) : void |
For IDisposable
|
|
Flush ( ) : void |
Block until all bytes in the queue have been transmitted.
|
|
Open ( ) : bool |
Opens the com port and configures it with the required settings
|
|
SendImmediate ( byte tosend ) : void |
Sends a protocol byte immediately ahead of any queued bytes.
|
|
SerialPort ( string portName ) : System |
Class contructor
|
|
SerialPort ( string portName, int baudRate ) : System |
Class contructor
|
|
Write ( byte toSend ) : void |
Queues bytes for transmission.
|
|
Write ( char toSend ) : void |
Queues a single char for transmission.
|
|
Write ( string toSend ) : void |
Queues string for transmission.
|
|
WriteLine ( string toSend ) : void |
Queues string with a new line ("\r\n") for transmission.
|
Méthode | Description | |
---|---|---|
AfterOpen ( ) : bool |
Override this to provide processing after the port is openned (i.e. to configure remote device or just check presence).
|
|
BeforeClose ( bool error ) : void |
Override this to provide processing prior to port closure.
|
|
GetModemStatus ( ) : |
Gets the status of the modem control input signals.
|
|
GetQueueStatus ( ) : |
Get the status of the queues
|
|
OnBreak ( ) : void |
Override this to take action when a break condition is detected on the input line.
|
|
OnRing ( ) : void |
Override this to take action when a ring condition is signalled by an attached modem.
|
|
OnRxChar ( byte ch ) : void |
Override this to process received bytes.
|
|
OnRxException ( |
Override this to take action when the reception thread closes due to an exception being thrown.
|
|
OnStatusChange ( |
Override this to take action when one or more modem status inputs change state
|
|
OnTxDone ( ) : void |
Override this to take action when transmission is complete (i.e. all bytes have actually been sent, not just queued).
|
|
Sleep ( int milliseconds ) : void |
Delay processing.
|
|
ThrowException ( string reason ) : void |
Use this to throw exceptions in derived classes. Correctly handles threading issues and closes the port if necessary.
|
Méthode | Description | |
---|---|---|
CheckOnline ( ) : bool | ||
CheckResult ( ) : void | ||
InternalClose ( ) : void | ||
ReceiveThread ( ) : void |
protected BeforeClose ( bool error ) : void | ||
error | bool | True if closing due to an error |
Résultat | void |
protected OnRxChar ( byte ch ) : void | ||
ch | byte | The byte that was received |
Résultat | void |
protected OnRxException ( |
||
e | The exception which was thrown | |
Résultat | void |
protected OnStatusChange ( |
||
mask | The status inputs that have changed state | |
state | The state of the status inputs | |
Résultat | void |
public SendImmediate ( byte tosend ) : void | ||
tosend | byte | Byte to send |
Résultat | void |
public SerialPort ( string portName ) : System | ||
portName | string | |
Résultat | System |
public SerialPort ( string portName, int baudRate ) : System | ||
portName | string | |
baudRate | int | |
Résultat | System |
protected Sleep ( int milliseconds ) : void | ||
milliseconds | int | Milliseconds to delay by |
Résultat | void |
protected ThrowException ( string reason ) : void | ||
reason | string | Description of fault |
Résultat | void |
public Write ( byte toSend ) : void | ||
toSend | byte | Array of bytes to be sent |
Résultat | void |
public Write ( char toSend ) : void | ||
toSend | char | Byte to be sent |
Résultat | void |
public Write ( string toSend ) : void | ||
toSend | string | Array of bytes to be sent |
Résultat | void |
public WriteLine ( string toSend ) : void | ||
toSend | string | Array of bytes to be sent |
Résultat | void |