Skip to content

cmdToggleHr/cmdEnableOptical: take a profile like their siblings - #64

Closed
abdulsaheel wants to merge 1 commit into
mainfrom
fix/toggle-hr-optical-profile
Closed

abdulsaheel wants to merge 1 commit into
mainfrom
fix/toggle-hr-optical-profile

Conversation

@abdulsaheel

@abdulsaheel abdulsaheel commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

both hardcoded gen4 framing internally with no way to override, so a gen5 caller silently got a crc8/gen4-header packet the strap can't parse at all. same bug class already fixed here for getBodyLocationAndStatus/getBatteryPackInfo/enterHighFreqSync.

purely additive optional {BandProfile profile = BandProfile.gen4} param, default unchanged so no existing caller's output changes.

added gen5 cases for both next to the existing gen4 toggle test.

Summary by Sourcery

Support profile-specific framing for heart-rate and optical-data commands without changing existing defaults.

Bug Fixes:

  • Allow heart-rate and optical-data commands to generate correctly framed packets for Gen5 callers while preserving Gen4 output by default.

Tests:

  • Add Gen5 conformance coverage for heart-rate and optical-data command framing.

both hardcoded gen4 framing with no way to override, so a gen5 caller
silently got a crc8 packet the strap can't parse. same bug class already
fixed for getBodyLocationAndStatus/getBatteryPackInfo/enterHighFreqSync.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 7 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 82d402b3-a232-4521-9969-dfa7e937e984

📥 Commits

Reviewing files that changed from the base of the PR and between 3a6ad6a and addce84.

📒 Files selected for processing (2)
  • lib/src/commands.dart
  • test/doc_conformance_test.dart

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Sep 19, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds optional profile support to cmdToggleHr and cmdEnableOptical, routing profile selection into command framing without changing existing gen4 callers, and adds tests confirming both commands produce parseable gen5 frames with unchanged bodies.

File-Level Changes

Change Details Files
Make heart-rate and optical-data commands honor the selected band profile while preserving gen4 behavior by default.
  • Add optional BandProfile profile = BandProfile.gen4 parameters.
  • Pass the profile through to buildCommand so gen5 uses its framing and CRC format.
lib/src/commands.dart
Add gen5 conformance coverage for the updated commands.
  • Verify gen5 heart-rate toggle frames retain the expected command body.
  • Verify gen5 optical-enable frames use the expected revision and enable flag and parse with gen5 framing.
test/doc_conformance_test.dart

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@abdulsaheel

Copy link
Copy Markdown
Contributor Author

subsumed by #65 (already merged), which covers cmdToggleHr/cmdEnableOptical's gen5 profile param as part of the broader gen5-framing sweep. closing, not a real gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant