# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog],
and this project adheres to [Semantic Versioning].

## [Unreleased]

## [2.2.3] - 2026-05-20
### Changed
* Support non-MIL build variant for deployment without MIL dependency. Default is non-MIL

## [2.2.2] - 2026-05-18
### Changed
* CPU governor options are now limited to performance, powersave, and schedutil

## [2.2.1] - 2026-05-14
### Fixed
* ltc3350-monitor: correct sysfs source used to read supercap system current

## [2.2.0] - 2025-05-11
### Added
* Support new models: BXP-C101, BXP-C200, DRP-C200, V2202D
* Restrict write actions to root via SO_PEERCRED

### Fixed
* cpu set-governor <Core>: support set governor for just a single core
* power show: round floating-point values to 3 decimal places and strip trailing zeros
* Correct UC-1200A series name

### Changed
* UC-3400A: continue power-mode transitions when a user hook script fails (log only, do not abort)
* Suppress repeated supercap-related warnings in syslog
* Normalize cli output indent and key width across modules
* Drop syslog warnings for client-facing errors in cpu, thermal, power, and system modules (already returned to the CLI)

### Removed
* Remove V2406D empty configuration

## [2.1.2] - 2026-04-30
### Fixed
* Remove erroneous `power_ctx` from UC-8600A and UC-3400A; neither model has power supply hardware
* Module handlers now return correct error codes per product-command when ctx is absent or hardware is unavailable
* Power `set-auto-shutdown`, `set-shutdown-delay`, and `reset-soh` restricted to V2406D-PLP; other models return `ERROR_NOT_SUPPORTED`
* Daemon now includes `err_message` in JSON response for `status=0` replies; CLI prints it as plain text

## [2.1.1] - 2026-04-28

### Fixed
* Set configured log level before first syslog calls in main
* Kill action hook process group on timeout and log outcome as Success, Failed, or Timeout

### Changed
* Replace name-list model lookup with two-step series and product detection
* Rename "module" to "command" in CLI help and error strings

## [2.1.0] - 2026-04-22
### Added
* Add D-Bus signal service for power and supercap state change events

### Changed
* power show (supercap):
  - Rename plain-text field `Capacity` → `Level` to align with JSON key
  - Capacitance is now reported as percent instead of raw µF
* Action hook: log successful completion to syslog (previously only failures were logged)
* Move `plp_state`/`power_source` enums into `power-monitor-task.h`

### Fixed
* Standardize deprecation warnings in mx-pwr-mgmt to include removal notice

## [2.0.0] - 2026-04-16
### Added
* Support functionalities into distinct modules
  - System: global power mode management
  - Power: input and backup power monitoring
  - Thermal: temperature sensor and cooling management
  - CPU: processor policy management
* Model specific function
  - V2406D: run auto shutdown process when main power is lost and show health status of supercapacitor
  - UC-3400A: power mode switching
* Support models
  - V2406D
  - UC-3400A
  - UC-4400A series
  - UC-8600A series
  - UC-1222A / UC-2222A series
* Add set-wakeup-source action to system module with anti-brick protection
* Add timeout support for system mode hook scripts
* Add bash-completion script for mx-power-mgmt
* Add manual pages for mx-power-mgmt
* Add mx-pwr-mgmt legacy compatibility wrapper script with model check
* Add postinst migration script for legacy UC-3400A.conf format

## [1.2.1] - 2025-12-19
### Fixed
- Fix FILE resource leak and remove TOCTOU race condition in runtime directory handling

## [1.2.0] - 2025-12-18
### Added
- Store the current power mode in a runtime file and enable
  moxa-power-manager.service to set active mode at boot

## [1.1.1] - 2025-10-01
### Changed
- Updated dependencies
  * Bump moxa-version to 2.1.2-1+deb13
  * Bump moxa-computer-interface-manager to 2.1.3-1+deb13
- Remove Bluetooth module before suspend as Wi-Fi powers down; u-blox
  M2-MAYA-W271 Bluetooth is now integrated into the kernel, requiring
  config update

### Fixed
- Remove sa2ul kernel module for sleep mode since it malfunctions after sleep.
- Correct the WiFi module name to "mlan" when reloading the module.
- Reorder suspend/resume execution steps:
  - Suspend sequence: Run script -> Stop systemd services -> Power off peripherals -> Unbind driver
  - Resume sequence: Reverse of the above.

## [1.1.0] - 2025-09-18
### Added
- Added syslog output support.

### Changed
- Default governor in Active mode switched from performance to schedutil to
  align with the Linux kernel 6.12 default.
- Users can now override the governor for Active mode through configuration.

## [1.0.0] - 2025-08-04
### Changed
- Migrate package to Debian 13 (trixie).
  - Introduce libgpiod instead of GPIO sysfs.

## [0.6.4] - 2024-10-23
### Changed
- Adjusted the usage information to clearly indicate the power mode.

## [0.6.3] - 2024-09-20
### Changed
- Display wakeup sources only if the LAN is enabled.
- Adjusted and fixed typos in the usage information.

## [0.6.2] - 2024-09-18
### Fixed
- Configured only if the LAN, USB, or SD card was enabled.

## [0.6.1] - 2024-08-14
### Fixed
- Set a long enough wake-up time if the user doesn't specify one to prevent the
  OS from restarting due to the watchdog.
- Re-enable Wake on LAN in LAN settings each time the OS enters standby mode to
  ensure persistent WOL functionality.

## [0.6.0] - 2024-08-05
### Added
- Displayed a warning message if all wake devices were disabled.

### Fixed
- Did not control the power pin of the SD card on the UC-3400A series.

### Changed
- Set the wake device list in the code; no need to describe it in the
  configuration file.

## [0.5.0] - 2024-07-17
### Fixed
- Resolved issue with obtaining WiFi information when powering on/off WiFi.
- Corrected M2-MAYA-W2 WiFi driver power on/off sequence.
- Fixed application crash when powering on/off the LAN.

### Added
- Added display for scaling governor.

## [0.4.0] - 2024-06-25
### Fixed
- Corrected spelling in the source code and CLI messages.
- Checked the MPM timer status when stopping it.
- Verified that the model has network and SD device before power-related
  operations.

## [0.3.0] - 2024-04-09
### Changed
- Put the executable into the sbin directory

## [0.2.0] - 2024-04-01
### Added
- Applied CPU governor policy of conservation mode from configuration.
- Disabled peripherals when switching power modes.

### Fixed
- Fixed warning in src/main.c.
- Applied WOL only to the LAN interface.

## [0.1.0] - 2024-03-13

- initial release

<!-- Links -->
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html
