Interface ISerialConnection
Represents a generic serial connection.
Inherited Members
Namespace: RGB.NET.Devices.WS281X
Assembly: RGB.NET.Devices.WS281X.dll
Syntax
public interface ISerialConnection : IDisposable
Properties
| Edit this page View SourceBaudRate
Gets the baud-rate used by the serial connection.
Declaration
int BaudRate { get; }
Property Value
Type | Description |
---|---|
int |
IsOpen
Gets the connection-status of the serial connection.
true
if connected; otherwise false
.
Declaration
bool IsOpen { get; }
Property Value
Type | Description |
---|---|
bool |
Port
Gets the COM-port used by the serial connection.
Declaration
string Port { get; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceDiscardInBuffer()
Discards the in-buffer of the serial connection.
Declaration
void DiscardInBuffer()
Open()
Opens the serial connection.
Declaration
void Open()
ReadByte()
Reads a single byte from the serial connection
Declaration
byte ReadByte()
Returns
Type | Description |
---|---|
byte | The byte read. |
ReadTo(char)
Blocks till the provided char is received from the serial connection.
Declaration
void ReadTo(char target)
Parameters
Type | Name | Description |
---|---|---|
char | target | The target-character to read to. |
Write(byte[], int, int)
Writes the provided data to the serial connection.
Declaration
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. |
WriteLine(string)
Write the provided text to the serial connection followed by a line break.
Declaration
void WriteLine(string line)
Parameters
Type | Name | Description |
---|---|---|
string | line | The text to write. |