Table of Contents

Class Power

Namespace
nanoFramework.Runtime.Native
Assembly
nanoFramework.Runtime.Native.dll

Provides access to power management functionalities on target device.

public class Power
Inheritance
Power
Inherited Members
Extension Methods

Remarks

This API is a general one common to all devices. There could be available target specific APIs providing other methods.

Constructors

Power()

public Power()

Methods

RebootDevice()

The RebootDevice method enables the caller to force a reboot of the device. This method raises the OnRebootEvent.

public static void RebootDevice()

Remarks

If there are any handlers subscribing OnRebootEvent the reboot will happen only after all handlers complete their execution, no matter the time that takes. In case the developer want's to set a timeout for those to complete, use the alternative RebootDevice(int) call and set an execution constrain.

RebootDevice(int)

The RebootDevice method enables the caller to force a reboot of the device. This method raises the OnRebootEvent.

public static void RebootDevice(int exeConstraintTimeout)

Parameters

exeConstraintTimeout int

Execution constraint timeout (in milliseconds) for the event handlers. If the event handlers take longer than the given value, then the handlers will be aborted and the reboot will be executed.

Events

OnRebootEvent

This event notifies listeners prior to a device reboot. The event handlers may have an execution constraint placed on them by the caller of the Reboot method. Therefore, it is recommended that the event handlers be short atomic operations.

public static event RebootEventHandler OnRebootEvent

Event Type

RebootEventHandler