NativeBindings
See ml_power_manager.h for additional comments.
Inherits from:
MagicLeapNativeBindings
Public Methods
void HandleOnErrorOccurred
public static void HandleOnErrorOccurred(
Error error,
in IntPtr user_data
)
Parameters
Type | Name | Description |
---|---|---|
Error | error | Power Manager error codes. |
in IntPtr | user_data |
void HandleOnPowerChanged
public static void HandleOnPowerChanged(
PowerState state,
in IntPtr user_data
)
Parameters
Type | Name | Description |
---|---|---|
PowerState | state | Power states. |
in IntPtr | user_data |
void HandleOnPropertiesChanged
public static void HandleOnPropertiesChanged(
in MLPowerManagerPropertyData properties,
in IntPtr user_data
)
Parameters
Type | Name | Description |
---|---|---|
in MLPowerManagerPropertyData | properties | A structure to encapsulate output data when getting the current properties. |
in IntPtr | user_data |
MLResult.Code MLPowerManagerCreate
Creates a Power Manager handle for a specified component.
public static MLResult.Code MLPowerManagerCreate(
Component component,
out ulong handle
)
Parameters
Type | Name | Description |
---|---|---|
Component | component | The component specific to the handle to be created. |
out ulong | handle | The handle to be created. |
MLResult.Code MLPowerManagerDestroy
Destroys a Power Manager handle.
public static MLResult.Code MLPowerManagerDestroy(
ulong handle
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | The Power Manager handle for a specific component to be destroyed. |
MLResult.Code MLPowerManagerGetAvailablePowerStates
Query available power states for a component.
public static MLResult.Code MLPowerManagerGetAvailablePowerStates(
ulong handle,
in MLPowerManagerPowerStateInfo in_info,
out MLPowerManagerPowerStateData out_states
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Power Manager handle for component to get list of all available power states for. |
in MLPowerManagerPowerStateInfo | in_info | #MLPowerManagerPowerStateInfo struct filled with data to be used by the Power Manager when requesting/receiving all available power states. |
out MLPowerManagerPowerStateData | out_states | #MLPowerManagerPowerStateData holding list of available power states. |
MLResult.Code MLPowerManagerGetAvailableProperties
Request a list of the available #MLPowerManagerPropertyType.
public static MLResult.Code MLPowerManagerGetAvailableProperties(
ulong handle,
in MLPowerManagerPropertyTypeInfo in_info,
out MLPowerManagerPropertyTypeData out_properties
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Power Manager handle for component to get properties from. |
in MLPowerManagerPropertyTypeInfo | in_info | #MLPowerManagerPropertyTypeInfo struct filled with data to be used by the Power Manager when requesting/receiving available property types. |
out MLPowerManagerPropertyTypeData | out_properties | Information about the properties of a component. Must be released using #MLPowerManagerReleasePropertyTypeData after each successful call. |
MLResult.Code MLPowerManagerGetComponentProperties
Gets the power manager properties of a component.
public static MLResult.Code MLPowerManagerGetComponentProperties(
ulong handle,
in MLPowerManagerPropertyInfo in_info,
out MLPowerManagerPropertyData out_properties
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Power Manager handle for component to get properties of. |
in MLPowerManagerPropertyInfo | in_info | #MLPowerManagerPropertyInfo struct filled with information about the power manager properties of a component to request. |
out MLPowerManagerPropertyData | out_properties | Information about the properties of a component. Must be released using #MLPowerManagerReleasePropertyData after each successful call. |
MLResult.Code MLPowerManagerGetPowerState
Gets the power state of a component.
public static MLResult.Code MLPowerManagerGetPowerState(
ulong handle,
in MLPowerManagerPowerStateInfo in_info,
out MLPowerManagerPowerStateData out_state
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Power Manager handle for component to get power state from. |
in MLPowerManagerPowerStateInfo | in_info | #MLPowerManagerPowerStateInfo struct filled with data to be used by the Power Manager when requesting/receiving power state. |
out MLPowerManagerPowerStateData | out_state | #MLPowerManagerPowerStateData with the current power state.Must be released using #MLPowerManagerReleasePowerStateData after each successful call. |
MLResult.Code MLPowerManagerReleasePowerStateData
Releases specified #MLPowerManagerPowerStateData.
public static MLResult.Code MLPowerManagerReleasePowerStateData(
ulong handle,
in MLPowerManagerPowerStateData power_states
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Power Manager handle for component relating to #MLPowerManagerPowerStateData. |
in MLPowerManagerPowerStateData | power_states | Pointer to a #MLPowerManagerPowerStateData. |
MLResult.Code MLPowerManagerReleasePropertyData
Releases specified #MLPowerManagerPropertyData.
public static MLResult.Code MLPowerManagerReleasePropertyData(
ulong handle,
in MLPowerManagerPropertyData properties
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Power Manager handle for component relating to #MLPowerManagerPropertyData. |
in MLPowerManagerPropertyData | properties | Pointer to a #MLPowerManagerPropertyData returned from #MLPowerManagerGetComponentProperties. |
MLResult.Code MLPowerManagerReleasePropertyTypeData
Releases specified #MLPowerManagerPropertyTypeData.
public static MLResult.Code MLPowerManagerReleasePropertyTypeData(
ulong handle,
in MLPowerManagerPropertyTypeData properties
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Power Manager handle for component relating to #MLPowerManagerPropertyTypeData. |
in MLPowerManagerPropertyTypeData | properties | Pointer to a #MLPowerManagerPropertyTypeData. |
MLResult.Code MLPowerManagerSetCallbacks
Register Power Manager callbacks for a specific handle.
public static MLResult.Code MLPowerManagerSetCallbacks(
ulong handle,
in MLPowerManagerCallbacks callbacks,
in IntPtr user_data
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Power Manager handle for component to set #MLPowerManagerCallbacks for. |
in MLPowerManagerCallbacks | callbacks | Callbacks to receive Power Manager events. Set this to NULL to unregister callbacks. |
in IntPtr | user_data | The caller can pass in user context data that will be returned in the callback(can be NULL). |
MLResult.Code MLPowerManagerSetPowerState
Sets the power state of a component.
public static MLResult.Code MLPowerManagerSetPowerState(
ulong handle,
in MLPowerManagerPowerStateSettings settings
)
Parameters
Type | Name | Description |
---|---|---|
ulong | handle | Power Manager handle for component to set power state for. |
in MLPowerManagerPowerStateSettings | settings | Settings used by the Power Manager updating a component's power state. |