C# 클래스 SerialPortLib.SerialPortInput

Serial port I/O
파일 보기 프로젝트 열기: genielabs/serialport-lib-dotnet 1 사용 예제들

공개 메소드들

메소드 설명
Connect ( ) : bool

Connect to the serial port.

Disconnect ( ) : void

Disconnect the serial port.

SendMessage ( byte message ) : bool

Sends the message.

SetPort ( string portname, int baudrate = 115200, StopBits stopbits = StopBits.One, Parity parity = Parity.None ) : void

Sets the serial port options.

보호된 메소드들

메소드 설명
OnConnectionStatusChanged ( SerialPortLib.ConnectionStatusChangedEventArgs args ) : void

Raises the connected state changed event.

OnMessageReceived ( SerialPortLib.MessageReceivedEventArgs args ) : void

Raises the message received event.

비공개 메소드들

메소드 설명
Close ( ) : void
ConnectionWatcherTask ( ) : void
HandleErrorReceived ( object sender, System.IO.Ports.SerialErrorReceivedEventArgs e ) : void
Open ( ) : bool
ReaderTask ( ) : void

메소드 상세

Connect() 공개 메소드

Connect to the serial port.
public Connect ( ) : bool
리턴 bool

Disconnect() 공개 메소드

Disconnect the serial port.
public Disconnect ( ) : void
리턴 void

OnConnectionStatusChanged() 보호된 메소드

Raises the connected state changed event.
protected OnConnectionStatusChanged ( SerialPortLib.ConnectionStatusChangedEventArgs args ) : void
args SerialPortLib.ConnectionStatusChangedEventArgs Arguments.
리턴 void

OnMessageReceived() 보호된 메소드

Raises the message received event.
protected OnMessageReceived ( SerialPortLib.MessageReceivedEventArgs args ) : void
args SerialPortLib.MessageReceivedEventArgs Arguments.
리턴 void

SendMessage() 공개 메소드

Sends the message.
public SendMessage ( byte message ) : bool
message byte Message.
리턴 bool

SetPort() 공개 메소드

Sets the serial port options.
public SetPort ( string portname, int baudrate = 115200, StopBits stopbits = StopBits.One, Parity parity = Parity.None ) : void
portname string Portname.
baudrate int Baudrate.
stopbits StopBits Stopbits.
parity Parity Parity.
리턴 void