OpenDevicePartnership / OpenDevicePartnership/odp-secure-services
Implement battery service (all 15 opcodes)
Open
@dymk is already working on this.
Since Apr 16, 2026.
- Dominant language
- Rust
- Stars
- 3
- Forks
- 11
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 5
Description
Task\n\nImplement all 15 battery opcodes with stateful Battery struct:\n\nBTP, BMC, BST, BIX, BPC, BPS, BCT, BCV, BAR, BAT_DIS, BAT_STA, BAT_PSR, BAT_SOC, BAT_CYC, BAT_FCC\n\n### Key design decisions\n- set_flag byte mechanism for BTP/BMC to distinguish 'set to zero' from 'no update'\n- Stack-based Battery struct (no_std compatible)\n- Response serialization via fixed-size byte array packing\n\nAdd 20+ unit tests covering all opcodes, edge cases, and the BTP/BMC zero-value write fix.\n\n## Files\n- platform/qemu-sp/src/battery.rs\n\n## PR\n- #57\n\n## Parent\nPart of #60
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.