C# 클래스 LitDev.LDCommPort

파일 보기 프로젝트 열기: litdev1/LitDev

공개 메소드들

메소드 설명
AvailablePorts ( ) : Primitive

Returns a list of available serial ports.

ClosePort ( ) : Primitive

Closes the open serial port.

OpenPort ( Primitive portName, Primitive baudRate ) : Primitive

Opens a serial port for use. Assumes 8 databits, no parity.

RXAll ( ) : Primitive

Reads all available bytes in the open comm port input buffer.

RXByte ( ) : Primitive

Reads one byte from the open serial port and returns that byte as an integer.

RXChar ( ) : Primitive

Reads one byte from the open serial port and returns that byte as a unicode character.

SetDataBits ( Primitive dataBits ) : Primitive

Sets current port data bits. 5 to 8 (default).

SetEncoding ( Primitive encoding ) : Primitive

Sets current port encoding for send and receive text conversion.

SetHandshake ( Primitive handshake ) : Primitive

Sets or clears hardware flow control for the current port.

SetParity ( Primitive parity ) : Primitive

Sets current port parity.

SetStopBits ( Primitive stopBits ) : Primitive

Current port stop bits.

SwapPort ( Primitive portName ) : Primitive

Switch the current active port to a previously opened port.

TXByte ( Primitive dataByte ) : Primitive

Sends one byte to the serial port.

TXString ( Primitive dataString ) : Primitive

Sends a string to the serial port.

비공개 메소드들

메소드 설명
DataReceivedEvent ( Object sender, System.IO.Ports.SerialDataReceivedEventArgs e ) : void
ErrorReceivedEvent ( Object sender, System.IO.Ports.SerialErrorReceivedEventArgs e ) : void

메소드 상세

AvailablePorts() 공개 정적인 메소드

Returns a list of available serial ports.
public static AvailablePorts ( ) : Primitive
리턴 Primitive

ClosePort() 공개 정적인 메소드

Closes the open serial port.
public static ClosePort ( ) : Primitive
리턴 Primitive

OpenPort() 공개 정적인 메소드

Opens a serial port for use. Assumes 8 databits, no parity.
public static OpenPort ( Primitive portName, Primitive baudRate ) : Primitive
portName Primitive /// String identifying which port to open in the form of "COM8". ///
baudRate Primitive /// Integer baud rate, for example 9600. ///
리턴 Primitive

RXAll() 공개 정적인 메소드

Reads all available bytes in the open comm port input buffer.
public static RXAll ( ) : Primitive
리턴 Primitive

RXByte() 공개 정적인 메소드

Reads one byte from the open serial port and returns that byte as an integer.
public static RXByte ( ) : Primitive
리턴 Primitive

RXChar() 공개 정적인 메소드

Reads one byte from the open serial port and returns that byte as a unicode character.
public static RXChar ( ) : Primitive
리턴 Primitive

SetDataBits() 공개 정적인 메소드

Sets current port data bits. 5 to 8 (default).
public static SetDataBits ( Primitive dataBits ) : Primitive
dataBits Primitive The data bits: /// 5 to 8 (default). ///
리턴 Primitive

SetEncoding() 공개 정적인 메소드

Sets current port encoding for send and receive text conversion.
public static SetEncoding ( Primitive encoding ) : Primitive
encoding Primitive The encoding: /// "Ascii" (default), "Unicode", "UTF7", "UTF8", "UTF32" or "BigEndianUnicode". ///
리턴 Primitive

SetHandshake() 공개 정적인 메소드

Sets or clears hardware flow control for the current port.
public static SetHandshake ( Primitive handshake ) : Primitive
handshake Primitive /// "H" to select hardware flow control, "HX" for hardware and software flow control, "X" for software fow control, any other character to clear. ///
리턴 Primitive

SetParity() 공개 정적인 메소드

Sets current port parity.
public static SetParity ( Primitive parity ) : Primitive
parity Primitive The parity: /// "None" (default), "Even", "Mark", "Odd" or "Space". ///
리턴 Primitive

SetStopBits() 공개 정적인 메소드

Current port stop bits.
public static SetStopBits ( Primitive stopBits ) : Primitive
stopBits Primitive The stop bits: /// "One" (default), "None", "OnePointFive" or "Two". ///
리턴 Primitive

SwapPort() 공개 정적인 메소드

Switch the current active port to a previously opened port.
public static SwapPort ( Primitive portName ) : Primitive
portName Primitive String identifying a port that is already opened.
리턴 Primitive

TXByte() 공개 정적인 메소드

Sends one byte to the serial port.
public static TXByte ( Primitive dataByte ) : Primitive
dataByte Primitive /// The byte to be written to the port. ///
리턴 Primitive

TXString() 공개 정적인 메소드

Sends a string to the serial port.
public static TXString ( Primitive dataString ) : Primitive
dataString Primitive /// String value to be sent. ///
리턴 Primitive