Class Power
- Namespace
- nanoFramework.Runtime.Native
- Assembly
- nanoFramework.Runtime.Native.dll
Provides access to power management functionalities on the target device.
public class Power
- Inheritance
-
Power
- Inherited Members
- Extension Methods
Remarks
This API is a general one common to all devices. There are platform-specific APIs available.
Constructors
Power()
public Power()
Methods
RebootDevice(int, RebootOption)
Forces a reboot of the device with an execution constraint timeout for event handlers.
public static void RebootDevice(int exeConstraintTimeout, RebootOption rebootOption = RebootOption.NormalReboot)
Parameters
exeConstraintTimeout
intThe execution constraint timeout, in milliseconds, for the event handlers to complete. If the event handlers take longer than the allotted time, they will be aborted and the reboot will be executed.
rebootOption
RebootOptionThe reboot options.
RebootDevice(RebootOption)
Forces a reboot of the device using the optional rebootOption
parameter.
public static void RebootDevice(RebootOption rebootOption = RebootOption.NormalReboot)
Parameters
rebootOption
RebootOption
Remarks
This method raises the OnRebootEvent. If there are any handlers subscribing to OnRebootEvent, the reboot will occur only after all handlers complete their execution, regardless of the time taken. To set a timeout for the handlers to complete, use the RebootDevice(int, RebootOption) method and specify an execution constraint.
If the rebootOptions parameter is set to an option other than ClrOnly, any ongoing debug session will be terminated.
Events
OnRebootEvent
Occurs before the device reboots.
public static event RebootEventHandler OnRebootEvent
Event Type
Remarks
The event handlers may have an execution constraint placed on them by the caller of the RebootDevice(RebootOption) method. Therefore, it is recommended that the event handlers perform short, atomic operations.