Class F7SerialPort
Represents a serial port on STM32F7 devices
Assembly: Meadow.F7.dll
View Source
Declaration
public class F7SerialPort : SerialPortBase, ISerialPort, IDisposable
Inheritance: System.Object -> Meadow.Hardware.SerialPortBase
Implements:
Meadow.Hardware.ISerialPort, System.IDisposable
Methods
GetPortNames()
Gets an array of serial port names for the current device.
View Source
Declaration
public static string[] GetPortNames()
Returns
System.String[]
OpenHardwarePort(string)
Opens the OS hardware port
View Source
Declaration
protected override IntPtr OpenHardwarePort(string portName)
Returns
System.IntPtr
Parameters
| Type | Name |
|---|---|
System.String | portName |
Exceptions
CloseHardwarePort(IntPtr)
Closes the OS hardware port
View Source
Declaration
protected override void CloseHardwarePort(IntPtr handle)
Parameters
| Type | Name |
|---|---|
System.IntPtr | handle |
WriteHardwarePort(IntPtr, byte[], int)
Writes data to the OS hardware port
View Source
Declaration
protected override int WriteHardwarePort(IntPtr handle, byte[] data, int count)
Returns
System.Int32
Parameters
| Type | Name |
|---|---|
System.IntPtr | handle |
System.Byte[] | data |
System.Int32 | count |
Exceptions
ReadHardwarePort(IntPtr, byte[], int)
Reads data from the OS hardware port
View Source
Declaration
protected override int ReadHardwarePort(IntPtr handle, byte[] readBuffer, int count)
Returns
System.Int32
Parameters
| Type | Name |
|---|---|
System.IntPtr | handle |
System.Byte[] | readBuffer |
System.Int32 | count |
Exceptions
SetHardwarePortSettings(IntPtr)
Calls the OS to set serial port settings (e.g. parity and stop bits)
View Source
Declaration
protected override void SetHardwarePortSettings(IntPtr handle)
Parameters
| Type | Name |
|---|---|
System.IntPtr | handle |
Exceptions
Implements
- Meadow.Hardware.ISerialPort
System.IDisposable