About

System.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.

Key Features

  • synchronous and event-driven I/O
  • access to pin and break states
  • access to serial driver properties
  • access to Stream object through the BaseStream property
  • How to Use

    using 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!");
    

    Main Types

    The main type provided by this library is:

  • SerialPort
  • Additional Documentation

  • SerialPort class documentation
  • API documentation
  • System.IO.Ports
  • Feedback & Contributing

    System.IO.Ports is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

    This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard.