Skip to main content

Class SerialPortNameExtensions

Extension methods for the SerialPortName class

Assembly: Meadow.Contracts.dll
View Source
Declaration
public static class SerialPortNameExtensions

Methods

CreateSerialPort(SerialPortName, int, int, Parity, StopBits, int)

Creates an Meadow.Hardware.ISerialPort

View Source
Declaration
public static ISerialPort CreateSerialPort(this SerialPortName name, int baudRate = 9600, int dataBits = 8, Parity parity = Parity.None, StopBits stopBits = StopBits.One, int readBufferSize = 1024)
Returns

Meadow.Hardware.ISerialPort

Parameters
TypeName
Meadow.Hardware.SerialPortNamename
System.Int32baudRate
System.Int32dataBits
Meadow.Hardware.Parityparity
Meadow.Hardware.StopBitsstopBits
System.Int32readBufferSize

CreateSerialMessagePort(SerialPortName, byte[], bool, int, int, Parity, StopBits, int)

Creates an Meadow.Hardware.ISerialMessagePort

View Source
Declaration
public static ISerialMessagePort CreateSerialMessagePort(this SerialPortName name, byte[] suffixDelimiter, bool preserveDelimiter, int baudRate = 9600, int dataBits = 8, Parity parity = Parity.None, StopBits stopBits = StopBits.One, int readBufferSize = 512)
Returns

Meadow.Hardware.ISerialMessagePort

Parameters
TypeName
Meadow.Hardware.SerialPortNamename
System.Byte[]suffixDelimiter
System.BooleanpreserveDelimiter
System.Int32baudRate
System.Int32dataBits
Meadow.Hardware.Parityparity
Meadow.Hardware.StopBitsstopBits
System.Int32readBufferSize

CreateSerialMessagePort(SerialPortName, byte[], bool, int, int, int, Parity, StopBits, int)

Creates an Meadow.Hardware.ISerialMessagePort

View Source
Declaration
public static ISerialMessagePort CreateSerialMessagePort(this SerialPortName name, byte[] prefixDelimiter, bool preserveDelimiter, int messageLength, int baudRate = 9600, int dataBits = 8, Parity parity = Parity.None, StopBits stopBits = StopBits.One, int readBufferSize = 512)
Returns

Meadow.Hardware.ISerialMessagePort

Parameters
TypeName
Meadow.Hardware.SerialPortNamename
System.Byte[]prefixDelimiter
System.BooleanpreserveDelimiter
System.Int32messageLength
System.Int32baudRate
System.Int32dataBits
Meadow.Hardware.Parityparity
Meadow.Hardware.StopBitsstopBits
System.Int32readBufferSize