cmdGetBattery: take a profile like its siblings - #63
Conversation
control.dart already branches on profile.isGen5 to decode this exact opcode's reply (gen4 u16 deci-percent vs gen5 direct u8 percent), but the request builder had no way to frame gen5 at all. same fix as cmdAbortHistorical got in #62.
There was a problem hiding this comment.
Sorry @abdulsaheel, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 6 days and 8 hours by commenting @sourcery-ai review. Upgrade to get a review now.
|
Warning Review limit reachedNext included review available in 38 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideAdds the missing profile parameter to Sequence diagram for profile-aware battery command framingsequenceDiagram
participant Caller
participant cmdGetBattery
participant buildCommand
participant Device
Caller->>cmdGetBattery: cmdGetBattery(seq, profile)
cmdGetBattery->>buildCommand: buildCommand(seq, Cmd.getBatteryLevel, const [], profile)
buildCommand-->>cmdGetBattery: framed GET_BATTERY_LEVEL command
cmdGetBattery-->>Caller: command bytes
Caller->>Device: send command
Device-->>Caller: battery-level reply
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
control.dart already branches on
profile.isGen5to decode GET_BATTERY_LEVEL's reply (gen4 u16 LE deci-percent vs gen5 direct u8 percent), butcmdGetBatteryhad noprofileparam at all, so it always built the gen4 envelope. every other request builder that got a gen-aware decode grew the same{BandProfile profile = BandProfile.gen4}param (cmdGetClock, cmdAbortHistorical in #62, etc). this one just never did.no current callers (edge builds this opcode inline via its own session profile), so it's a live trap for whoever calls the exported helper next rather than a shipped bug.
profileparam, forwarded intobuildCommand, default stays gen4 (purely additive)dart testgreen.Summary by Sourcery
Support profile-specific framing when building GET_BATTERY_LEVEL requests.
New Features:
Tests: