Table of Contents

Class NanoDeviceBase

Namespace
nanoFramework.Tools.Debugger
Assembly
nanoFramework.Tools.DebugLibrary.Net.dll
public abstract class NanoDeviceBase : INotifyPropertyChanged
Inheritance
NanoDeviceBase
Implements
Derived
Inherited Members
Extension Methods

Constructors

NanoDeviceBase()

protected NanoDeviceBase()

Properties

BooterVersion

Version of nanoBooter.

public Version BooterVersion { get; }

Property Value

Version

CLRVersion

Version of nanoCLR.

public Version CLRVersion { get; }

Property Value

Version

ConnectionId

Id of the connection to the device.

public string ConnectionId { get; set; }

Property Value

string

ConnectionPort

Port here this device is connected.

public IPort ConnectionPort { get; set; }

Property Value

IPort

DebugEngine

nanoFramework debug engine.

public Engine DebugEngine { get; set; }

Property Value

Engine

Description

Device description.

public string Description { get; }

Property Value

string

DeviceBase

public object DeviceBase { get; }

Property Value

object

DeviceInfo

Detailed info about the NanoFramework device hardware, solution and CLR.

public INanoFrameworkDeviceInfo DeviceInfo { get; }

Property Value

INanoFrameworkDeviceInfo

DeviceUniqueId

Unique ID of the NanoDevice.

public Guid DeviceUniqueId { get; set; }

Property Value

Guid

HasNanoBooter

This indicates if the target device has nanoBooter.

public bool HasNanoBooter { get; }

Property Value

bool

HasProprietaryBooter

This indicates if the device has a proprietary bootloader.

public bool HasProprietaryBooter { get; }

Property Value

bool

IsIFUCapable

This indicates if the target device is IFU capable.

public bool IsIFUCapable { get; }

Property Value

bool

OnProgress

public object OnProgress { get; }

Property Value

object

Platform

Target platform.

public string Platform { get; set; }

Property Value

string

SerialNumber

Device serial number (if defined on the target).

public string SerialNumber { get; set; }

Property Value

string

TargetName

Target name.

public string TargetName { get; set; }

Property Value

string

Transport

Transport to the device.

public TransportType Transport { get; set; }

Property Value

TransportType

Methods

ConnectToNanoBooter()

Attempt to establish a connection with nanoBooter (with reboot if necessary)

public bool ConnectToNanoBooter()

Returns

bool

true connection was made, false otherwise

CreateDebugEngine()

Creates a new debug engine for this nanoDevice. Transport to the device.

public void CreateDebugEngine()

CreateDebugEngine(int)

Creates a new debug engine for this nanoDevice. Transport to the device.

public void CreateDebugEngine(int timeoutMilliseconds)

Parameters

timeoutMilliseconds int

DeployBinaryFile(string, uint, IProgress<string>)

Attempts to deploy a binary (.bin) file to the connected nanoFramework device.

public bool DeployBinaryFile(string binFile, uint address, IProgress<string> progress = null)

Parameters

binFile string

Path to the binary file (.bin).

address uint

Address to write to.

progress IProgress<string>

Returns

bool

Returns false if the deployment fails, true otherwise.

Remarks

To perform the update the device has to be running:

  • nanoCLR if this is meant to update the deployment region.
  • nanoBooter if this is meant to update nanoCLR Failing to meet this condition will abort the operation.

Disconnect(bool)

public abstract void Disconnect(bool force = false)

Parameters

force bool

Erase(EraseOptions, IProgress<MessageWithProgress>, IProgress<string>)

Erases the deployment sectors of the connected NanoDevice.

public bool Erase(EraseOptions options, IProgress<MessageWithProgress> progress = null, IProgress<string> log = null)

Parameters

options EraseOptions

Identifies which areas are to be erased.

progress IProgress<MessageWithProgress>

Progress report of execution.

log IProgress<string>

Progress report of execution

Returns

bool

Returns false if the erase fails, true otherwise Possible exceptions: MFUserExitException, MFDeviceNoResponseException

Execute(uint)

Starts execution on the connected nanoDevice at the supplied address (parameter entrypoint). This method is generally used after the Deploy method to jump into the code that was deployed.

public bool Execute(uint entryPoint)

Parameters

entryPoint uint

Returns

bool

Returns false if execution fails, true otherwise

GetCLRStartAddress()

Start address of the CLR block. Returns (-1) as invalid value if the address can't be retrieved from the device properties.

public int GetCLRStartAddress()

Returns

int

GetDeploymentStartAddress()

Start address of the deployment block. Returns (-1) as invalid value if the address can't be retrieved from the device properties.

public int GetDeploymentStartAddress()

Returns

int

GetDeviceInfo(bool)

Get INanoFrameworkDeviceInfo from device. If the device information has been retrieved before this method returns the cached data, unless the force argument is true.

public INanoFrameworkDeviceInfo GetDeviceInfo(bool force = true)

Parameters

force bool

Force retrieving the information from the device.

Returns

INanoFrameworkDeviceInfo

Return the INanoFrameworkDeviceInfo for this device.

OnPropertyChanged(PropertyChangedEventArgs)

protected virtual void OnPropertyChanged(PropertyChangedEventArgs eventArgs)

Parameters

eventArgs PropertyChangedEventArgs

OnPropertyChanged(string?)

protected void OnPropertyChanged(string? propertyName = null)

Parameters

propertyName string

Ping()

Attempts to communicate with the connected nanoFramework device

public ConnectionSource Ping()

Returns

ConnectionSource

Events

PropertyChanged

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler