Class Power
Provides access to power management functionalities on target device.
Inherited Members
Namespace: nanoFramework.Runtime.Native
Assembly: nanoFramework.Runtime.Native.dll
Syntax
public class Power
Remarks
This API is a general one common to all devices. There could be available target specific APIs providing other methods.
Methods
| Improve this Doc View SourceRebootDevice()
The RebootDevice method enables the caller to force a reboot of the device. This method raises the OnRebootEvent.
Declaration
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(Int32) call and set an execution constrain.
RebootDevice(Int32)
The RebootDevice method enables the caller to force a reboot of the device. This method raises the OnRebootEvent.
Declaration
public static void RebootDevice(int exeConstraintTimeout)
Parameters
Type | Name | Description |
---|---|---|
Int32 | exeConstraintTimeout | 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
| Improve this Doc View SourceOnRebootEvent
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.
Declaration
public static event RebootEventHandler OnRebootEvent
Event Type
Type | Description |
---|---|
RebootEventHandler |