crozone.SerialPorts.LinuxSerialPort
2.0.1
See the version list below for details.
dotnet add package crozone.SerialPorts.LinuxSerialPort --version 2.0.1
NuGet\Install-Package crozone.SerialPorts.LinuxSerialPort -Version 2.0.1
<PackageReference Include="crozone.SerialPorts.LinuxSerialPort" Version="2.0.1" />
paket add crozone.SerialPorts.LinuxSerialPort --version 2.0.1
#r "nuget: crozone.SerialPorts.LinuxSerialPort, 2.0.1"
// Install crozone.SerialPorts.LinuxSerialPort as a Cake Addin
#addin nuget:?package=crozone.SerialPorts.LinuxSerialPort&version=2.0.1
// Install crozone.SerialPorts.LinuxSerialPort as a Cake Tool
#tool nuget:?package=crozone.SerialPorts.LinuxSerialPort&version=2.0.1
crozone.SerialPorts.LinuxSerialPort
A managed Linux Serial Port implementation targeting netstandard2.0.
This implementation performs all serial port setup by calling the /bin/stty
binary, rather than relying on any native interop directly. This means it should work on any system that has a POSIX compatible /bin/stty binary.
About
This SerialPort class is intended to offer similar functionality to the System.IO.Ports.SerialPort
class provided by Microsoft in System.IO.Ports
. However, although much of the interface is the same or similar, it is not intended to be a direct drop in replacement.
Most basic functionality is covered, including the configuration of the BaudRate, DataBits, StopBits, Handshake, and Parity.
The class implements the shared ISerialPort
interface from crozone.SerialPorts.Abstractions
. This allows it to be compatible with the crozone.SerialPorts.WindowsSerialPort
wrapper for System.IO.Ports.SerialPort
, which makes cross-platform development easier.
Basic sample code
// Open the first serial port that matches /dev/ttyUSB* (eg, /dev/ttyUSB0).
//
using (LinuxSerialPort serialPort = new LinuxSerialPort("/dev/ttyUSB*")
{
EnableDrain = false,
MinimumBytesToRead = 0,
ReadTimeout = 0,
BaudRate = 9600,
DataBits = 8,
Parity = Parity.None,
StopBits = StopBits.One,
Handshake = Handshake.None
})
{
serialPort.Open();
Stream stream = serialPort.BaseStream;
// Use stream to read and write
} // Serial port is automatically closed here when Dispose() is called by the using statement.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- crozone.SerialPorts.Abstractions (>= 2.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on crozone.SerialPorts.LinuxSerialPort:
Package | Downloads |
---|---|
TRONIC.GsmModemSmsLibrary
Library to handle connection to GSM Modem and sending sms using AT+ commands. Support for both Windows and Linux OS. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Support new ISerialPort that has IDisposable