Class PortSerialManager
- Namespace
- nanoFramework.Tools.Debugger.PortSerial
- Assembly
- nanoFramework.Tools.DebugLibrary.Net.dll
public class PortSerialManager : PortBase
- Inheritance
-
PortSerialManager
- Inherited Members
- Extension Methods
Constructors
PortSerialManager(bool, List<string>, int)
Creates an Serial debug client
public PortSerialManager(bool startDeviceWatchers = true, List<string> portExclusionList = null, int bootTime = 3000)
Parameters
startDeviceWatchersboolIndicates whether to start the device watcher.
portExclusionListList<string>The collection of serial ports to ignore when searching for devices. Changes in the collection after the start of the device watcher are taken into account.
bootTimeint
Properties
BootTime
public int BootTime { get; set; }
Property Value
Methods
AddDevice(string)
Adds a new PortSerial device to list of NanoFrameworkDevices.
public override NanoDeviceBase AddDevice(string deviceId)
Parameters
deviceIdstringThe serial port name where the device is connected.
Returns
- NanoDeviceBase
The device with the unique ID that is added or (if it was already discovered before) retrieved from the list of devices. Returns null if no device has been added.
DisposeDevice(string)
Disposes a device.
public override void DisposeDevice(string instanceId)
Parameters
instanceIdstringId of the device to dispose.
GetRegisteredDevice(string)
Get the device that communicates via the serial port, provided it has been added to the list of known devices.
public static NanoDeviceBase GetRegisteredDevice(string portName)
Parameters
portNamestringThe port name of the device to get.
Returns
- NanoDeviceBase
The NanoDeviceBase that communicates via the serial port, or null if the device is not found.
GetSerialNumber(string)
public static string GetSerialNumber(string value)
Parameters
valuestring
Returns
OnDeviceEnumerationCompleted()
protected virtual void OnDeviceEnumerationCompleted()
ReScanDevices()
Performs a re-scan of the connected devices. This operation resets the list of available devices and attempts to validate if a connected device it's a nanoDevice.
public override void ReScanDevices()
StartDeviceWatchers()
Starts the device watchers. If they are already started this operation won't have any effect.
public override void StartDeviceWatchers()
StartSerialDeviceWatchers()
public void StartSerialDeviceWatchers()
StopDeviceWatchers()
Stops the device watchers. If they are already stopped this operation won't have any effect.
public override void StopDeviceWatchers()
Events
DeviceEnumerationCompleted
Event that is raised when enumeration of all watched devices is complete.
public override event EventHandler DeviceEnumerationCompleted
Event Type
LogMessageAvailable
Event that is raised when a log message is available.
public override event EventHandler<StringEventArgs> LogMessageAvailable