Skip to main content
Version: 14 Oct 2024

MLPowerManagerCallbacks

Module: Power Manager

A structure containing Power Manager callback events. Individual callbacks which are not required by the Power Manager can be NULL. More...

#include <ml_power_manager.h>

Public Attributes

TypeName
uint32_tversion
void()(MLPowerManagerPowerState state, void user_data)on_power_state_changed
This callback will be invoked when MLPowerManagerPowerState changes.
void()(const MLPowerManagerPropertyData properties, void *user_data)on_properties_changed
This callback will be invoked when MLPowerManagerPropertyData of a component changes. Only the properties that have changed will be returned, the component may support additional properties which values were not returned.
void()(MLPowerManagerError error, void user_data)on_error_occurred
This callback will be invoked when an MLPowerManagerError occurs on one of the components.

Detailed Description

struct MLPowerManagerCallbacks;

A structure containing Power Manager callback events. Individual callbacks which are not required by the Power Manager can be NULL.

API Level:

  • 27

Public Attributes Documentation

version

uint32_t version;

Version of this structure.


on_power_state_changed

void(*)(MLPowerManagerPowerState state, void *user_data) on_power_state_changed;

This callback will be invoked when MLPowerManagerPowerState changes.

TypeDescription
void()(MLPowerManagerPowerState state, void user_data))(MLPowerManagerPowerState state, void *user_data)

Parameters

stateMLPowerManagerPowerState representing the new power state.
user_dataUser data as passed to the MLPowerManagerSetCallbacks.

on_properties_changed

void(*)(const MLPowerManagerPropertyData *properties, void *user_data) on_properties_changed;

This callback will be invoked when MLPowerManagerPropertyData of a component changes. Only the properties that have changed will be returned, the component may support additional properties which values were not returned.

TypeDescription
void()(const MLPowerManagerPropertyData properties, void *user_data))(const MLPowerManagerPropertyData properties, void user_data)

Parameters

propertiesMLPowerManagerPropertyData struct encapsulating the properties changed.
user_dataUser data as passed to the MLPowerManagerSetCallbacks.

on_error_occurred

void(*)(MLPowerManagerError error, void *user_data) on_error_occurred;

This callback will be invoked when an MLPowerManagerError occurs on one of the components.

TypeDescription
void()(MLPowerManagerError error, void user_data))(MLPowerManagerError error, void *user_data)

Parameters

errorThe error which has occurred.
user_dataUser data as passed to the MLPowerManagerSetCallbacks.