Carrot.IO.Ports 0.1.4

dotnet add package Carrot.IO.Ports --version 0.1.4
                    
NuGet\Install-Package Carrot.IO.Ports -Version 0.1.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Carrot.IO.Ports" Version="0.1.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Carrot.IO.Ports" Version="0.1.4" />
                    
Directory.Packages.props
<PackageReference Include="Carrot.IO.Ports" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Carrot.IO.Ports --version 0.1.4
                    
#r "nuget: Carrot.IO.Ports, 0.1.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Carrot.IO.Ports@0.1.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Carrot.IO.Ports&version=0.1.4
                    
Install as a Cake Addin
#tool nuget:?package=Carrot.IO.Ports&version=0.1.4
                    
Install as a Cake Tool

Carrot.IO.Ports

Asynchronous serial communication library for Windows using Overlapped I/O, supporting cancellation and sync/async read/write operations.

Compatibility

Device Model Status Behavior Description
Virtual COM Port (VSPD) ✔️ Full Matches expected behavior
CH340 Series ✔️ Full Matches expected behavior
CH343 Series ⚠️ Partial Immediate response on data arrival
FTDI FT2232H ✔️ Full Matches expected behavior

📚 API Reference

Constructor

public SerialPort(
    string portName,
    int baudRate = 115200,
    int dataBits = 8,
    Parity parity = Parity.None,
    StopBits stopBits = StopBits.One,
    int readBufferSize = 8192,
    int writeBufferSize = 8192,
    TimeoutModel timeoutModel = TimeoutModel.WaitAny,
    int timeout = 2000)

Open

public void Open()

Close

public void Close()

Read/ReadAsync

int Read(byte[] buffer, int offset, int count)

Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken = default)

Write/WriteAsync

int Write(byte[] buffer, int offset, int count)

Task<int> WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)

⏰ Timeout Behavior

TimeoutModel Start read on empty buffer Partial data arrives (less than requested bytes) All data arrives during read
TimeoutModel.Immediately Return 0 bytes Return immediately Return immediately
TimeoutModel.WaitAny(default) Wait until data arrives (cancellable) Return immediately Return immediately
TimeoutModel.WaitAll Wait until data arrives (cancellable) Wait until data arrives (cancellable) Return immediately
Product Compatible and additional computed target framework versions.
.NET net5.0-windows7.0 is compatible.  net6.0-windows was computed.  net7.0-windows was computed.  net8.0-windows was computed.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.4 261 4/25/2025
0.1.3 243 4/25/2025
0.1.2-alpha 262 4/23/2025
0.1.1-alpha 251 4/23/2025
0.1.0-alpha 244 4/23/2025