Table of Contents

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

startDeviceWatchers bool

Indicates whether to start the device watcher.

portExclusionList List<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.

bootTime int

Properties

BootTime

public int BootTime { get; set; }

Property Value

int

Methods

AddDevice(string)

Adds a new PortSerial device to list of NanoFrameworkDevices.

public override NanoDeviceBase AddDevice(string deviceId)

Parameters

deviceId string

The 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

instanceId string

Id 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

portName string

The 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

value string

Returns

string

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

EventHandler

LogMessageAvailable

Event that is raised when a log message is available.

public override event EventHandler<StringEventArgs> LogMessageAvailable

Event Type

EventHandler<StringEventArgs>