Property | Type | Description | |
---|---|---|---|
Opened | bool |
Method | Description | |
---|---|---|
Close ( ) : void | ||
ConvertHexChar ( char ch ) : int | ||
Dispose ( ) : void |
Disconnects and disposes of the SerialCom instance.
|
|
Flush ( ) : bool |
Flushes the serial I/O buffers.
|
|
Open ( ) : bool |
Opens and initializes the serial connection.
|
|
Read ( byte data ) : int |
Reads any bytes that have been received and writes them to the specified array.
|
|
ReadString ( int maxBytesToRead ) : string |
Reads any data that has been received as a string.
|
|
SerialPort ( string portName, int baudRate, StopBits stopBits, Parity parity ) : System |
Creates a new instance of SerialCom.
|
|
SerialPort ( string portName, int baudRate, StopBits stopBits, Parity parity, byte byteSize ) : System |
Creates a new instance of SerialCom.
|
|
String2Hex ( string str, byte senddata ) : int | ||
Write ( byte data ) : int |
Transmits the specified array of bytes.
|
|
Write ( int data ) : int |
Transmits the specified string.
|
|
WriteLine ( int data ) : int |
Transmits the specified string and appends the carriage return to the end if it does not exist. Note that the string must end in '\r\n' before any serial device will interpret the data sent. For ease of programmability, this method should be used instead of Write() when you want to automatically execute the specified command string. |
Method | Description | |
---|---|---|
CloseHandle ( |
||
ConfigureSerialPort ( ) : bool |
Configures the serial device based on the connection parameters pased in by the user.
|
|
CreateFile ( string fileName, [ fileAccess, [ fileShare, |
||
FailIfNotConnected ( ) : void |
Helper that throws a InvalidOperationException if we don't have a serial connection.
|
|
GetCommState ( |
||
PurgeComm ( |
||
ReadFile ( |
||
SetCommState ( |
||
SetCommTimeouts ( |
||
WriteFile ( |
public static ConvertHexChar ( char ch ) : int | ||
ch | char | |
return | int |
public ReadString ( int maxBytesToRead ) : string | ||
maxBytesToRead | int | |
return | string |
public SerialPort ( string portName, int baudRate, StopBits stopBits, Parity parity ) : System | ||
portName | string | |
baudRate | int | |
stopBits | StopBits | |
parity | Parity | |
return | System |
public SerialPort ( string portName, int baudRate, StopBits stopBits, Parity parity, byte byteSize ) : System | ||
portName | string | |
baudRate | int | |
stopBits | StopBits | |
parity | Parity | |
byteSize | byte | |
return | System |
public static String2Hex ( string str, byte senddata ) : int | ||
str | string | |
senddata | byte | |
return | int |