// %BANNER_BEGIN% // --------------------------------------------------------------------- // %COPYRIGHT_BEGIN% // Copyright (c) 2023 Magic Leap, Inc. All Rights Reserved. // Use of this file is governed by the Software License Agreement, located here: https://www.magicleap.com/software-license-agreement-ml2 // Terms and conditions applicable to third-party materials accompanying this distribution may also be found in the top-level NOTICE file appearing herein. // %COPYRIGHT_END% // --------------------------------------------------------------------- // %BANNER_END% using System; using System.Runtime.InteropServices; using static UnityEngine.XR.MagicLeap.MLPowerManager; using static UnityEngine.XR.MagicLeap.MLPowerManager.NativeBindings; namespace UnityEngine.XR.MagicLeap { public partial class MLPowerManager { [StructLayout(LayoutKind.Explicit)] public struct ComponentPropertyData { /// /// Extra info about battery. /// [FieldOffset(0)] public BatteryInfo BatteryInfo; /// /// Battery level. Range is between 0 and 100. /// [FieldOffset(0)] public byte BatteryLevel; /// /// Charging state. /// [FieldOffset(0)] public ChargingState ChargingState; /// /// Connection state. /// [FieldOffset(0)] public ConnectionState ConnectionState; } /// /// A structure to encapsulate the data for each #MLPowerManagerPropertyType. /// public struct ComponentProperty { /// /// The type of each property. /// public PropertyType Type; public ComponentPropertyData Data; } /// /// A structure to encapsulate output data when getting the /// current properties. /// public struct PropertyData { /// /// Array of #MLPowerManagerComponentProperty elements. /// public ComponentProperty[] Properties; } /// /// A structure to encapsulate output data when getting a component's available property types. /// public struct PropertyTypeData { /// /// Array of #PropertyType elements. /// public PropertyType[] PropertyTypes; } /// /// A structure to encapsulate settings used by the Power Manager /// when requesting the power state to be changed. /// public struct Settings { /// /// New power state to request. /// public PowerState State; } /// /// A structure to encapsulate output data when either getting /// available power states, or the current power state. /// public struct PowerStateData { /// /// Array of PowerState elements. /// public PowerState[] PowerStates; } } }