Internal implementation package not meant for direct consumption. Please do not reference directly.
$ dotnet add package runtime.linux-arm64.runtime.native.System.IO.PortsSystem.IO.Ports package provides synchronous serial port file resource. Additionally, the functionality of this class can be wrapped in an internal Stream object, accessible through the BaseStream property, and passed to classes that wrap or use streams.
Stream object through the BaseStream propertyusing System.IO.Ports;
// Provides list of available serial ports
string[] portNames = SerialPort.GetPortNames();
// First available port
string myPortName = portNames[0];
int baudRate = 9600;
SerialPort sp = new SerialPort(myPortName, baudRate);
sp.Open();
sp.WriteLine("Hello World!");
The main type provided by this library is:
SerialPortSystem.IO.Ports is released as open source under the . Bug reports and contributions are welcome at .