Show / Hide Table of Contents

    Class Power

    Provides access to power management functionalities on target device.

    Inheritance
    Object
    Power
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    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 Source

    RebootDevice()

    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.

    | Improve this Doc View Source

    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 Source

    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.

    Declaration
    public static event RebootEventHandler OnRebootEvent
    Event Type
    Type Description
    RebootEventHandler

    Extension Methods

    LogDispatcher.GetCurrentClassLogger(Object)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018 nanoFramework Contributors
    Generated by DocFX