Show / Hide Table of Contents

Class SerialPortConnection

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

Inheritance
object
SerialPortConnection
Implements
ISerialConnection
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: RGB.NET.Devices.WS281X
Assembly: RGB.NET.Devices.WS281X.dll
Syntax
public sealed class SerialPortConnection : ISerialConnection, IDisposable

Constructors

| Edit this page View Source

SerialPortConnection(string, int)

Initializes a new instance of the SerialPortConnection class.

Declaration
public SerialPortConnection(string port, int baudRate)
Parameters
Type Name Description
string port

The name of the serial-port to connect to.

int baudRate

The baud-rate used by the serial-connection.

Properties

| Edit this page View Source

BaudRate

Gets the baud-rate used by the serial connection.

Declaration
public int BaudRate { get; }
Property Value
Type Description
int
| Edit this page View Source

IsOpen

Gets the connection-status of the serial connection. true if connected; otherwise false.

Declaration
public bool IsOpen { get; }
Property Value
Type Description
bool
| Edit this page View Source

Port

Gets the COM-port used by the serial connection.

Declaration
public string Port { get; }
Property Value
Type Description
string
| Edit this page View Source

SerialPort

The SerialPort used for the connection.

Declaration
public SerialPort SerialPort { get; }
Property Value
Type Description
SerialPort

Methods

| Edit this page View Source

DiscardInBuffer()

Discards the in-buffer of the serial connection.

Declaration
public void DiscardInBuffer()
| Edit this page View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
| Edit this page View Source

Open()

Opens the serial connection.

Declaration
public void Open()
| Edit this page View Source

ReadByte()

Reads a single byte from the serial connection

Declaration
public byte ReadByte()
Returns
Type Description
byte

The byte read.

| Edit this page View Source

ReadTo(char)

Blocks till the provided char is received from the serial connection.

Declaration
public void ReadTo(char target)
Parameters
Type Name Description
char target

The target-character to read to.

| Edit this page View Source

Write(byte[], int, int)

Writes the provided data to the serial connection.

Declaration
public void Write(byte[] buffer, int offset, int length)
Parameters
Type Name Description
byte[] buffer

The buffer containing the data to write.

int offset

The offset of the data in the buffer.

int length

The amount of data to write.

| Edit this page View Source

WriteLine(string)

Write the provided text to the serial connection followed by a line break.

Declaration
public void WriteLine(string line)
Parameters
Type Name Description
string line

The text to write.

Implements

ISerialConnection
IDisposable
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX