Implement battery readout and button remapping#1
Merged
Conversation
Replace the plain placeholder text on the Buttons tab with an amber warning box and triangle icon so it is clear remapping is not yet available.
Battery: parse the 0x04 reply as cell voltage (mV, bytes 7..=8) and map it to a percentage via a Li-Ion discharge curve anchored on captured points (3813 mV = 42%, 4013 mV = 77%), replacing the old guess. Buttons: decode the 0x07 slot-write frame format (slot, action category, HID button code, action + tail + global checksums). Add cmd_button plus confirmed slot/action constants for all five physical buttons, a cmd_set_button command for per-button remapping, and cmd_reset_buttons to restore factory defaults. UI: the buttons tab now applies real changes — each button has an action dropdown and Restore Default works. Bump version to 1.3.0. Co-Authored-By: WOZCODE <contact@withwoz.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reverse-engineered (from WebHID captures) and implemented two previously-missing features for the IPI FLY PRO.
Battery
0x04reply carries the cell voltage in mV (bytes 7..=8, big-endian), not a percent byte.Button remapping
0x07slot-write frame: slot address, action category, HID button code, and the action/tail/global checksums.0x60Left,0x64Right,0x68Middle,0x6cBack,0x70Forwardcmd_button,cmd_set_button(per-button remap) andcmd_reset_buttons(restore factory defaults).Still in progress: non-mouse actions (DPI shortcuts, keyboard keys, macros) use other categories and are not exposed yet.
Tests / build
cargo test: 68 passed (every button/battery frame reproduces a real capture byte-for-byte).tsc --noEmitclean,vite buildsucceeds.