mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-10-17 17:20:19 +00:00
hw status's battery/BWM section (bwm_print_battery_status()) only ever formats its numbers into free-text Dbprintf lines, unusable by any embedded/non-terminal client. Add a new command that returns the same SoC/voltage/current/capacity/temp/health/fault numbers as one small packed struct via reply_ng(). Refactor the shared reads into bwm_read_battery_info() so hw status and the new command read the same values and can't drift apart - hw status keeps all its existing charger-detail lines (MainCtl, input limit, VIN_DPM, charge voltage/enable) unchanged, sourced from its own reads as before; only the fuel-gauge numbers and the two small charger-status reads the new struct needs are now shared. Motivated by wanting a Flipper Zero FAP battery-status test screen (separate app repo), but this command is generic and usable by any client, not CEP-specific. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>