Skip to main content

Class BBSerialPort

Encapsulates a Brainboxes Serial Port, communicates over TCP rather than using the Com port API, this means no drivers are required to be installed on the computer

Assembly: Brainboxes.IO.dll
View Source
Declaration
public class BBSerialPort : Device<IConnection, ISerialProtocol>, IDevice<IConnection, ISerialProtocol>, IDisposable

Inheritance: System.Object -> Brainboxes.IO.Device<Brainboxes.IO.IConnection,Brainboxes.IO.ISerialProtocol>

Implements:
Brainboxes.IO.IDevice<Brainboxes.IO.IConnection,Brainboxes.IO.ISerialProtocol>, System.IDisposable

Properties

DataAvailable

Indicates whether data is available, can be 0, for no data, 1 for 1 or more bytes, or a number representing the precise number of bytes

View Source
Declaration
public int DataAvailable { get; }

Fields

BBSerialPortType

The type of Serial port either RS232 or RS422/485

View Source
Declaration
public readonly BBSerialPortType BBSerialPortType

PortNumber

The port number of the device

View Source
Declaration
public readonly int PortNumber

Methods

Send(string)

Transmit data to the serial port

View Source
Declaration
public void Send(string data)
Parameters
TypeName
System.Stringdata

Receive()

Receive data from the serial port

View Source
Declaration
public string Receive()
Returns

System.String

Implements

  • Brainboxes.IO.IDevice<Brainboxes.IO.IConnection,Brainboxes.IO.ISerialProtocol>
  • System.IDisposable