Share via


SerialPort Constructor (String, Int32, Parity, Int32, StopBits)

Initializes a new instance of the SerialPort class using the specified port name, baud rate, parity bit, data bits, and stop bit.

Namespace: System.IO.Ports
Assembly: Microsoft.SPOT.Hardware (in microsoft.spot.hardware.dll)

Syntax

public SerialPort (
         string portName,
         int baudRate,
         Parity parity,
         int dataBits,
         StopBits stopBits
)

Parameters

  • portName
    The port to use (for example, COM1).
  • baudRate
    The baud rate.
  • parity
    One of the Parity values.
  • dataBits
    The data bits value.
  • stopBits
    One of the StopBits values.

Remarks

Use this constructor to create a new instance of the SerialPort class when you want to specify the port name.

Version Information

Available in the .NET Micro Framework versions 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

SerialPort Class
SerialPort Members
System.IO.Ports Namespace