C# 클래스 CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort

Provides access to the RS232 UARTs (serial port) on the Raspberry Pi.
상속: IDisposable
파일 보기 프로젝트 열기: cyrusbuilt/MonoPi 1 사용 예제들

공개 메소드들

메소드 설명
Close ( ) : void

Close this instance.

Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort object.

Call Dispose when you are finished using the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort. The Dispose method leaves the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort was occupying.

GetBytesAvailable ( ) : Int32

Gets the bytes available to be read.

GetCharacter ( ) : Char

Gets a single character from the serial device.

Open ( ) : void

Opens the serial port.

Open ( String device, BaudRates baud ) : void

Open the specified device with the specified BAUD rate.

PutChar ( Char c ) : void

Sends a single character to the port.

PutString ( String s ) : void

Sends a string to the port.

Rs232SerialPort ( ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort class. This is the default constructor.

Rs232SerialPort ( BaudRates baud ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort class with the BAUD rate to negotiate.

Rs232SerialPort ( String device ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort class with the device to open.

Rs232SerialPort ( String device, BaudRates baud ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort class with the device path and the BAUD rate to negotiate.

Write ( Byte val ) : void

Writes a single byte to the port.

메소드 상세

Close() 공개 메소드

Close this instance.
public Close ( ) : void
리턴 void

Dispose() 공개 메소드

Releases all resource used by the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort object.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort. The Dispose method leaves the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort was occupying.
public Dispose ( ) : void
리턴 void

GetBytesAvailable() 공개 메소드

Gets the bytes available to be read.
/// This instance has been disposed and is no longer usable. ///
public GetBytesAvailable ( ) : Int32
리턴 System.Int32

GetCharacter() 공개 메소드

Gets a single character from the serial device.
/// This instance has been disposed and is no longer usable. /// /// The port is not open. ///
public GetCharacter ( ) : Char
리턴 Char

Open() 공개 메소드

Opens the serial port.
/// This instance has been disposed and is no longer usable. /// /// The port is already open. ///
public Open ( ) : void
리턴 void

Open() 공개 메소드

Open the specified device with the specified BAUD rate.
/// This instance has been disposed and is no longer usable. /// /// The serial port is already open. ///
public Open ( String device, BaudRates baud ) : void
device String /// The path to the serial port device to open. ///
baud BaudRates /// The BAUD rate to negotiate. ///
리턴 void

PutChar() 공개 메소드

Sends a single character to the port.
/// This instance has been disposed and is no longer usable. /// /// The port is closed. ///
public PutChar ( Char c ) : void
c Char /// The character to send to the port. ///
리턴 void

PutString() 공개 메소드

Sends a string to the port.
/// This instance has been disposed and is no longer usable. /// /// The port is closed. ///
public PutString ( String s ) : void
s String /// The string to send to the port. ///
리턴 void

Rs232SerialPort() 공개 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort class. This is the default constructor.
public Rs232SerialPort ( ) : System
리턴 System

Rs232SerialPort() 공개 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort class with the BAUD rate to negotiate.
public Rs232SerialPort ( BaudRates baud ) : System
baud BaudRates /// The BAUD rate to negotiate (default is , /// which is 9600 BAUD). ///
리턴 System

Rs232SerialPort() 공개 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort class with the device to open.
public Rs232SerialPort ( String device ) : System
device String /// The device path to open (default is "/dev/ttyAMA0"). ///
리턴 System

Rs232SerialPort() 공개 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.IO.Serial.Rs232SerialPort class with the device path and the BAUD rate to negotiate.
public Rs232SerialPort ( String device, BaudRates baud ) : System
device String /// The device path to open (default is "/dev/ttyAMA0"). ///
baud BaudRates /// The BAUD rate to negotiate (default is , /// which is 9600 BAUD). ///
리턴 System

Write() 공개 메소드

Writes a single byte to the port.
/// This instance has been disposed and is no longer usable. /// /// The port is closed. ///
public Write ( Byte val ) : void
val Byte /// The byte to write. ///
리턴 void