comp • gb.net • serialport

SerialPort (gb.net)

This class was designed to allow to communicate using a serial interface (usually RS-232 serial port). This class inherits from Stream class, so you can use standard streams methods to send and receive data, and to close the port.

This class inherits Stream in gb.
This class is
Creates a new SerialPort object.
creatable
.

Constants

Constant used when the serial port has one stop bit.
Bits1  
Constant used when the serial port has two stop bits.
Bits2  
Constant used when the serial port has 5 data bits.
Bits5  
Constant used when the serial port has 6 data bits.
Bits6  
Constant used when the serial port has 7 data bits.
Bits7  
Constant used when the serial port has 8 data bits.
Bits8  
Constant used when the serial port has both software and hardware flow control.
Both  
This constant represents an even parity for the serial port.
Even  
Constant used when the serial port has hardware flow control.
Hardware  
This constant is used in the following cases:
None  
This constant represents an odd parity for the serial port.
Odd  
Constant used when the serial port has software flow control.
Software  

Properties

Methods Events
Returns or sets if the stream is blocking.
Blocking  
Returns or sets the byte order used to read or write binary data to the stream.
ByteOrder  
Returns current status of the "Clear To Send" serial port signal, or FALSE if port is closed.
CTS  
Returns current status of the "Data Carrier Detect" serial port signal, or FALSE if port is closed.
DCD  
Returns current status of the "Data Set Ready" serial port signal, or FALSE if port is closed.
DSR  
Returns or Sets current status of the "Data Terminal Ready" serial port signal. This value cannot be set when serial port is closed. If serial port is closed and you read this property, it returns FALSE.
DTR  
Return or set the number of data bits used by the serial port.
DataBits  
This property signals whether the last use of LINE INPUT reached the end of file, instead of reading a full line with an end-of-line character.
EndOfFile  
Returns or sets the newline separator used by this stream.
EndOfLine  
Return or set the serial port flow control.
FlowControl  
Returns the system file descriptor associated with this Stream.
Handle  
Return the number of bytes of the internal input buffer.
InputBufferSize  
Return if a stream is associated with a terminal.
IsTerm  
Returns a virtual object that allows you to enumerate a stream line by line.
Lines  
Return the number of bytes of the internal output buffer.
OutputBufferSize  
Returns or sets the serial port parity.
Parity  
Returns or sets current serial port device path. This property can be changed only when serial port is closed.
PortName  
Returns current status of the "Ring Indicator" serial port signal, or FALSE if port is closed.
RNG  
Returns or Sets current status of the "Request To Send" serial port signal. This value cannot be set when serial port is closed. If serial port is closed and you read this property, it returns FALSE.
RTS  
Place here communication speed in bauds, speed value must be a valid standard value allowed by the serial port driver (19200, 9600...). Be careful, as some common speed values like 38400 bauds are allowed by modems, but not by all serial port chips.
Speed  
Reflects the current status of a SerialPort object. It can be:
Status  
Return or set the serial port stop bits.
StopBits  
Returns or sets the tag associated with the stream.
Tag  
Return a virtual object that allows to manage the terminal associated with the stream.
Term  
Start to buffer data written to the stream, so that everything will be sent when the Send method is called.
Begin  
Closes the stream.
Close  
Drop the data that has been buffered since the last call to the Begin method.
Drop  
Opens the serial port.
Open  
Read a line of text from the stream, like the LINE INPUT instruction.
ReadLine  
Send all the data, in one shot, since the last call to Begin.
Send  
Start or stop watching the stream file descriptor for reading or writing, after it has been opened.
Watch  
Raised when CTS signal value changes.
CTSChange  
Raised when DCD signal value changes.
DCDChange  
Raised when DSR signal value changes.
DSRChange  
Raised when DTR signal value changes.
DTRChange  
Raised when RNG signal value changes.
RNGChange  
Raised when RTS signal value changes.
RTSChange  
Raised when there is data to be read from the serial port.
Read