# rdkcentral/entservices-powermanager architecture

> Architecture diagram of the GitHub repository rdkcentral/entservices-powermanager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rdkcentral/entservices-powermanager
- Repository: https://github.com/rdkcentral/entservices-powermanager

## Overview

This repository implements a Thunder/WPEFramework PowerManager plugin, despite the template README. Its principal workflow is a client request through the plugin’s IPowerManager implementation to power-state, deep-sleep, reboot, or thermal management, with platform operations handled by hardware abstraction implementations and settings retained by the plugin. The source index supports the module and controller boundaries, but does not expose every dispatch or implementation call; dashed links mark those unverified handoffs. Other documented-in-code capabilities include acknowledgements, wakeup configuration, and thermal protection.

Main entry points: [`plugin/PowerController.cpp`](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/PowerController.cpp) (Power controller), [`plugin/PowerManagerImplementation.cpp`](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/PowerManagerImplementation.cpp) (Power manager API), [`plugin/DeepSleepController.cpp`](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/DeepSleepController.cpp) (Deep sleep controller), [`plugin/PowerManager.cpp`](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/PowerManager.cpp) (PowerManager plugin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Plugin API"]
  node_manager["PowerManager plugin<br/>[PowerManager.cpp]"]
  node_manager_module["Plugin module<br/>[Module.cpp]"]
  node_implementation["Power manager API"]
  node_ack["Transition acknowledgements<br/>[AckController.h]"]
end

subgraph group_power["Power Management"]
  node_power_controller["Power controller"]
  node_deep_sleep["Deep sleep controller"]
  node_reboot["Reboot controller"]
  node_power_hal["Power platform<br/>[PowerImpl.h]"]
  node_deep_sleep_hal["Deep sleep platform<br/>[DeepSleepImpl.h]"]
end

subgraph group_thermal["Thermal Management"]
  node_thermal_controller["Thermal controller"]
  node_thermal_hal["Thermal platform<br/>[ThermalImpl.h]"]
  node_thermal_mfr["MFR thermal platform<br/>[ThermalMfrImpl.h]"]
  node_thermal_iface["Thermal interface<br/>[Thermal.h]"]
end

subgraph group_support["State and Platform"]
  node_settings[("Persistent settings<br/>[Settings.cpp]")]
  node_settings_api["Settings model<br/>[Settings.h]"]
  node_power_utils["Power utilities<br/>[PowerUtils.cpp]"]
  node_lambda["Async job helper<br/>[LambdaJob.h]"]
  node_power_iface["Power platform interface<br/>[Power.h]"]
  node_deep_sleep_iface["Deep sleep interface<br/>[DeepSleep.h]"]
end

node_client(("Power client"))

node_client -.->|"requests"| node_manager
node_manager -.->|"exposes API"| node_implementation
node_manager -.->|"registers"| node_manager_module
node_implementation -.->|"dispatches power"| node_power_controller
node_implementation -.->|"dispatches sleep"| node_deep_sleep
node_implementation -.->|"dispatches thermal"| node_thermal_controller
node_implementation -.->|"coordinates transitions"| node_ack
node_power_controller -.->|"activates sleep"| node_deep_sleep
node_power_controller -.->|"requests reboot"| node_reboot
node_power_controller -.->|"calls platform"| node_power_hal
node_deep_sleep -.->|"calls platform"| node_deep_sleep_hal
node_thermal_controller -.->|"uses platform"| node_thermal_hal
node_thermal_controller -.->|"selects platform"| node_thermal_mfr
node_thermal_hal -->|"implements"| node_thermal_iface
node_thermal_mfr -->|"implements"| node_thermal_iface
node_power_hal -->|"implements"| node_power_iface
node_deep_sleep_hal -->|"implements"| node_deep_sleep_iface
node_power_controller -->|"reads state"| node_settings_api
node_deep_sleep -->|"updates timeout"| node_settings_api
node_settings -->|"loads and saves"| node_settings_api
node_power_controller -->|"schedules jobs"| node_lambda
node_deep_sleep -->|"schedules jobs"| node_lambda
node_reboot -->|"schedules jobs"| node_lambda
node_implementation -->|"uses utilities"| node_power_utils
node_deep_sleep -->|"uses utilities"| node_power_utils
node_power_controller -->|"uses utilities"| node_power_utils

click node_manager "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/PowerManager.cpp"
click node_manager_module "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/Module.cpp"
click node_implementation "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/PowerManagerImplementation.cpp"
click node_ack "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/AckController.h"
click node_power_controller "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/PowerController.cpp"
click node_deep_sleep "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/DeepSleepController.cpp"
click node_reboot "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/RebootController.cpp"
click node_power_hal "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/PowerImpl.h"
click node_deep_sleep_hal "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/DeepSleepImpl.h"
click node_thermal_controller "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/ThermalController.cpp"
click node_thermal_hal "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/ThermalImpl.h"
click node_thermal_mfr "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/ThermalMfrImpl.h"
click node_thermal_iface "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/Thermal.h"
click node_settings "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/Settings.cpp"
click node_settings_api "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/Settings.h"
click node_power_utils "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/PowerUtils.cpp"
click node_lambda "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/LambdaJob.h"
click node_power_iface "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/Power.h"
click node_deep_sleep_iface "https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/DeepSleep.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manager,node_manager_module,node_implementation,node_ack,node_client toneBlue
class node_power_controller,node_deep_sleep,node_reboot,node_power_hal,node_deep_sleep_hal toneAmber
class node_thermal_controller,node_thermal_hal,node_thermal_mfr,node_thermal_iface toneMint
class node_settings,node_settings_api,node_power_utils,node_lambda,node_power_iface,node_deep_sleep_iface toneRose
```

## Components

### Plugin API

- [PowerManager plugin](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/PowerManager.cpp): `plugin/PowerManager.cpp`
- [Plugin module](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/Module.cpp): `plugin/Module.cpp`
- [Power manager API](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/PowerManagerImplementation.cpp): `plugin/PowerManagerImplementation.cpp`
- [Transition acknowledgements](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/AckController.h): `plugin/AckController.h`

### Power Management

- [Power controller](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/PowerController.cpp): `plugin/PowerController.cpp`
- [Deep sleep controller](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/DeepSleepController.cpp): `plugin/DeepSleepController.cpp`
- [Reboot controller](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/RebootController.cpp): `plugin/RebootController.cpp`
- [Power platform](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/PowerImpl.h): `plugin/hal/PowerImpl.h`
- [Deep sleep platform](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/DeepSleepImpl.h): `plugin/hal/DeepSleepImpl.h`

### Thermal Management

- [Thermal controller](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/ThermalController.cpp): `plugin/ThermalController.cpp`
- [Thermal platform](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/ThermalImpl.h): `plugin/hal/ThermalImpl.h`
- [MFR thermal platform](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/ThermalMfrImpl.h): `plugin/hal/ThermalMfrImpl.h`
- [Thermal interface](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/Thermal.h): `plugin/hal/Thermal.h`

### State and Platform

- [Persistent settings](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/Settings.cpp): `plugin/Settings.cpp`
- [Settings model](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/Settings.h): `plugin/Settings.h`
- [Power utilities](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/PowerUtils.cpp): `plugin/PowerUtils.cpp`
- [Async job helper](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/LambdaJob.h): `plugin/LambdaJob.h`
- [Power platform interface](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/Power.h): `plugin/hal/Power.h`
- [Deep sleep interface](https://github.com/rdkcentral/entservices-powermanager/blob/develop/plugin/hal/DeepSleep.h): `plugin/hal/DeepSleep.h`

### Other components

- **Power client**

## Connections

- Power client → PowerManager plugin: requests
- PowerManager plugin → Power manager API: exposes API
- PowerManager plugin → Plugin module: registers
- Power manager API → Power controller: dispatches power
- Power manager API → Deep sleep controller: dispatches sleep
- Power manager API → Thermal controller: dispatches thermal
- Power manager API → Transition acknowledgements: coordinates transitions
- Power controller → Deep sleep controller: activates sleep
- Power controller → Reboot controller: requests reboot
- Power controller → Power platform: calls platform
- Deep sleep controller → Deep sleep platform: calls platform
- Thermal controller → Thermal platform: uses platform
- Thermal controller → MFR thermal platform: selects platform
- Thermal platform → Thermal interface: implements (evidence: `plugin/hal/ThermalImpl.h`)
- MFR thermal platform → Thermal interface: implements (evidence: `plugin/hal/ThermalMfrImpl.h`)
- Power platform → Power platform interface: implements (evidence: `plugin/hal/PowerImpl.h`)
- Deep sleep platform → Deep sleep interface: implements (evidence: `plugin/hal/DeepSleepImpl.h`)
- Power controller → Settings model: reads state
- Deep sleep controller → Settings model: updates timeout
- Persistent settings → Settings model: loads and saves (evidence: `plugin/Settings.cpp`)
- Power controller → Async job helper: schedules jobs (evidence: `plugin/PowerController.cpp`)
- Deep sleep controller → Async job helper: schedules jobs (evidence: `plugin/DeepSleepController.cpp`)
- Reboot controller → Async job helper: schedules jobs (evidence: `plugin/RebootController.cpp`)
- Power manager API → Power utilities: uses utilities (evidence: `plugin/PowerManagerImplementation.cpp`)
- Deep sleep controller → Power utilities: uses utilities (evidence: `plugin/DeepSleepController.cpp`)
- Power controller → Power utilities: uses utilities (evidence: `plugin/PowerController.cpp`)
