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
Parameters
Type | Name |
---|---|
Meadow.Hardware.SerialPortName | name |
System.Int32 | baudRate |
System.Int32 | dataBits |
Meadow.Hardware.Parity | parity |
Meadow.Hardware.StopBits | stopBits |
System.Int32 | readBufferSize |
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
Type | Name |
---|---|
Meadow.Hardware.SerialPortName | name |
System.Byte[] | suffixDelimiter |
System.Boolean | preserveDelimiter |
System.Int32 | baudRate |
System.Int32 | dataBits |
Meadow.Hardware.Parity | parity |
Meadow.Hardware.StopBits | stopBits |
System.Int32 | readBufferSize |
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
Type | Name |
---|---|
Meadow.Hardware.SerialPortName | name |
System.Byte[] | prefixDelimiter |
System.Boolean | preserveDelimiter |
System.Int32 | messageLength |
System.Int32 | baudRate |
System.Int32 | dataBits |
Meadow.Hardware.Parity | parity |
Meadow.Hardware.StopBits | stopBits |
System.Int32 | readBufferSize |