Class SoftSerialPort
Provides a software based (bit-banged Serial Port).
Implements
Inherited Members
Namespace: Unosquare.PiGpio.ManagedModel
Syntax
public sealed class SoftSerialPort : IDisposable
Properties
BaudRate
Gets the baud rate.
Declaration
public int BaudRate { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
DataBits
Gets the data bits.
Declaration
public int DataBits { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Handle
Gets the handle.
Declaration
public UserGpio Handle { get; }
Property Value
| Type | Description |
|---|---|
| UserGpio |
Invert
Gets a value indicating whether the IO is inverted.
Declaration
public bool Invert { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
StopBits
Gets or sets the stop bits. Defaults to 2 stop bits.
Declaration
public int StopBits { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
Dispose()
Declaration
public void Dispose()
Read(Int32)
Reads up to count bytes.
Declaration
public byte[] Read(int count)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | count | The count. |
Returns
| Type | Description |
|---|---|
| Byte[] | The bytes that were read. |
Write(Byte[])
Writes the specified buffer to the transmit pin as a free-form wave.
Declaration
public void Write(byte[] buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte[] | buffer | The buffer. |