fix cmdAbortHistorical missing profile param - #62
Conversation
it was the one command in the labrador prepare/start sequence (20 -> 123 -> 139 -> 125 -> 124) that never got the profile param when the others did. a gen5 caller had no way to make its abort step frame as gen5, so it silently sent a gen4 frame the strap can't parse. defaults to gen4, so existing callers are unaffected.
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesAbort command profile support
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 optional BandProfile support to cmdAbortHistorical and forwards it into buildCommand, enabling correctly framed gen5 Labrador abort commands while retaining gen4 default behavior; tests cover both profile-specific framing and compatibility. Sequence diagram for profile-aware historical abort commandsequenceDiagram
participant Caller
participant cmdAbortHistorical
participant buildCommand
participant Labrador
Caller->>cmdAbortHistorical: cmdAbortHistorical(seq, profile)
cmdAbortHistorical->>buildCommand: buildCommand(seq, abortHistoricalTransmits, body, profile)
buildCommand-->>cmdAbortHistorical: Profile-specific framed command
cmdAbortHistorical-->>Labrador: Abort historical transmits command
Flow diagram for gen4 and gen5 abort command framingflowchart LR
A["cmdAbortHistorical(seq)"] --> B{BandProfile}
B -->|gen4 default| C[4-byte header + crc8]
B -->|gen5| D[8-byte header + crc16-modbus]
C --> E[Labrador link]
D --> E
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
cmdAbortHistorical was the one command in the labrador prepare/start
sequence (20 abort -> 123 select wrist -> 139 -> 125 -> 124) that never
got the profile param the others got. a gen5 caller passing
profile: BandProfile.gen5 to selectWrist/labradorFiltered/etc had no
way to do the same for the abort step, so it silently framed as gen4
(4-byte header, crc8) on a gen5 link expecting 8-byte header + crc16-modbus.
adds the optional profile param (defaults gen4, so nothing existing
changes) and a test mirroring the existing gen5 command-surface tests.
Summary by Sourcery
Add profile support to the historical-transmit abort command so Labrador sequences can correctly operate on Gen5 links.
Bug Fixes:
Tests:
Summary by CodeRabbit
New Features
Tests