using System; namespace RGB.NET.Devices.WS281X; /// /// Represents a generic serial connection. /// public interface ISerialConnection : IDisposable { /// /// Gets the COM-port used by the serial connection. /// string Port { get; } /// /// Gets the baud-rate used by the serial connection. /// int BaudRate { get; } /// /// Gets the connection-status of the serial connection. /// true if connected; otherwise false. /// bool IsOpen { get; } /// /// Opens the serial connection. /// void Open(); /// /// Discards the in-buffer of the serial connection. /// void DiscardInBuffer(); /// /// Reads a single byte from the serial connection /// /// The byte read. byte ReadByte(); /// /// Blocks till the provided char is received from the serial connection. /// /// The target-character to read to. void ReadTo(char target); /// /// Writes the provided data to the serial connection. /// /// The buffer containing the data to write. /// The offset of the data in the buffer. /// The amount of data to write. void Write(byte[] buffer, int offset, int length); /// /// Write the provided text to the serial connection followed by a line break. /// /// The text to write. void WriteLine(string line); }