Power Manager

API Reference

Components need access to the Power Manager to control the system's wake-up state. Operations that need fast response times (e.g., maintaining call state or playing/recording a media stream) result in high interrupt rates; keeping the system awake results in better performance and power efficiency.

Power Manager uses kernel wakeup sources to keep the system awake when at least one of the registered components requests a wakeup source to be held. When all wakeup sources are released, the system may enter a suspend state depending on the status of other (unrelated) wakeup sources.

IPC interfaces binding

All the functions of this API are provided by the powerMgr service.

Here's a code sample binding to Power Manager services:

   clientExe.clientComponent.le_pm -> powerMgr.le_pm

Requesting and releasing a wakeup source

The Power Manager service provides basic API for requesting and releasing a wakeup source. Power Manager's clients call le_pm_NewWakeupSource() to create a wakeup source. This function returns a le_pm_WakeupSourceRef_t type that can later be used to acquire and release a wakeup source through le_pm_StayAwake() and le_pm_Relax(), respectively. Wakeup sources are not reference-counted, which means multiple calls to le_pm_StayAwake() can be canceled by a single call to le_pm_Relax().

Power Manager service will automatically release and delete all wakeup sources held on behalf of an exiting or disconnecting client.

For deterministic behaviour, clients requesting services of Power Manager should have CAP_EPOLLWAKEUP (or CAP_BLOCK_SUSPEND) capability assigned.

Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.