wangyantian e9bc5e652d refactor: replace nlohmann_json with cJSON and refactor CLI handler
- Replace nlohmann::json with cJSON for JSON output (remove heavy dependency)
- Split CmdHelp into PrintFullHelp + PrintSubcommandHelp (reduce cyclomatic complexity 12→3/4)
- Extract HasHelpFlag helper from HandleCommand (reduce cyclomatic complexity 6→5)
- Fix bug: PrintSubcommandHelp return value now propagated (unknown-cmd --help returns 1)
- Rename global variables to g_camelCase convention (g_commands, g_programName, etc.)
- Replace magic number with CJSON_DEEP_COPY constant
- Add test cases 031-032 for PrintSubcommandHelp failure path and top-level --help priority
- Remove nlohmann_json_static from both BUILD.gn files

Co-Authored-By: Agent
Change-Id: Ie3a7c1b2d4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9
Signed-off-by: wangyantian <wangyantian@huawei.com>
2026-05-01 00:11:13 +08:00
2023-07-21 15:15:33 +08:00
2022-01-11 18:23:52 -08:00
2025-11-17 13:56:07 +08:00
2026-04-14 17:42:22 +08:00
2026-03-04 11:12:20 +08:00
2026-02-25 16:46:41 +08:00
2022-08-30 14:19:25 +08:00
2021-06-02 02:19:06 +08:00
2021-10-20 15:13:26 +08:00
2023-12-27 17:15:41 +08:00
2023-03-09 14:21:38 +08:00

Battery Manager

Introduction

The Battery Manager module provides the following functions:

  1. Obtaining battery information
  2. Obtaining the battery charging status and the battery state of charge (SoC)
  3. Power off charging

Figure 1 Architecture of the Battery Manager module

Directory Structure

base/powermgr/battery_manager
├── figures                  	# Architecture
├── frameworks                  # Framework layer
│   ├── napi                 	# NAPI layer
│   └── native                  # Native layer
├── interfaces                  # API layer
│   └── inner_api               # Internal APIs
├── sa_profile                  # SA profile
└── services                    # Service layer
│   └── native                  # Native layer
│   └── zidl                    # Zidl API layer
├── test                        # Test cases
│   ├── fuzztest                # Fuzz test
│   ├── unittest                # Unit test
│   ├── systemtest              # System test
│   └── utils                   # Test tools
└── utils                       # Utilities

Repositories Involved

Power Management Subsystem

powermgr_power_manager

powermgr_display_manager

powermgr_battery_manager

powermgr_thermal_manager

powermgr_battery_statistics

powermgr_battery_lite

powermgr_powermgr_lite

S
Description
暂无描述
Readme 12 MiB
Languages
C++ 99.5%
C 0.5%