Skip to content

ninedigit/SerialPort

Repository files navigation

NineDigit.SerialPort

NuGet License: MIT

A lightweight library for discovering and enumerating connected serial port devices.

Provides API for listing serial devices and retrieving metadata such as product/vendor names, IDs, and port names.

📦 Installation

Install via NuGet:

dotnet add package NineDigit.SerialPort

Or using the Visual Studio Package Manager Console:

Install-Package NineDigit.SerialPort

⚙️ Supported Platforms

Platform Supported Notes
Windows Fully supported.
macOS Fully supported.
Linux Not yet supported.
Android Not yet supported.

🚀 Usage

using NineDigit.SerialPort;

ISerialPortDeviceScanner deviceScanner = SerialPortDeviceScanner.Current;
IReadOnlyList<ISerialPortDevice> devices = deviceScanner.GetConnectedSerialPortDevices();

Console.WriteLine($"Detected {devices.Count} serial port device(s).");

for (int i = 0; i < devices.Count; i++)
{
    ISerialPortDevice device = devices[i];

    Console.WriteLine(
        $"{i + 1}. Product: {device.ProductName} (id = {device.ProductId}), " +
        $"Vendor: {device.VendorName} (id = {device.VendorId}), " +
        $"Port: {device.SerialPortName}");
}

Example output:

Detected 2 serial port device(s).

1. Product: CP2102N USB to UART Bridge Controller (id = 60000), Vendor: Silicon Labs (id = 4292), Port: COM4
2. Product: CHDU Lite VCP (id = 22336), Vendor: Microsoft (id = 1155), Port: COM8

🧾 License

This project is licensed under the MIT License.

🧑‍💻 Author

Nine Digit, s.r.o.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages