Class SerialConnection
A connection to a Brainboxes device via a direct COM/serial port.
Assembly: Brainboxes.IO.dll
View Source
Declaration
public class SerialConnection : Connection, IConnection, IDisposable
Inheritance: System.Object -> Brainboxes.IO.Connection
Implements:
Brainboxes.IO.IConnection, System.IDisposable
Properties
PortName
The name of the serial port
View Source
Declaration
public string PortName { get; }
BaudRate
The serial port baud rate
View Source
Declaration
public int BaudRate { get; }
Timeout
The timeout for Stream reads and writes, and connection availability test
View Source
Declaration
public override int Timeout { get; set; }
Fields
_serialPort
The underlying serial port object
View Source
Declaration
protected SerialPort _serialPort
Methods
_computeIsConnectedValue()
Computes whether the serial port is open.
View Source
Declaration
protected override bool _computeIsConnectedValue()
Returns
System.Boolean
_computeIsAvailableValue()
Computes whether the serial port exists and is available to connect to.
View Source
Declaration
protected override bool _computeIsAvailableValue()
Returns
System.Boolean
ToString()
ToString
View Source
Declaration
public override string ToString()
Returns
System.String
_connect()
Opens a new connection to a serial port
View Source
Declaration
protected override void _connect()
_disconnect()
Closed the port connection
View Source
Declaration
protected override void _disconnect()
Implements
- Brainboxes.IO.IConnection
System.IDisposable